@socketsecurity/cli-with-sentry 1.1.9 ā 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 +760 -560
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +31 -9
- package/dist/constants.js.map +1 -1
- package/dist/flags.js +16 -17
- package/dist/flags.js.map +1 -1
- package/dist/instrument-with-sentry.js +3 -3
- package/dist/instrument-with-sentry.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 +4 -4
- 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/socket-completion.bash +0 -0
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/analytics/cmd-analytics.d.mts +2 -3
- package/dist/types/commands/analytics/cmd-analytics.d.mts.map +1 -1
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts +2 -3
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts.map +1 -1
- package/dist/types/commands/ci/cmd-ci.d.mts +2 -3
- package/dist/types/commands/ci/cmd-ci.d.mts.map +1 -1
- package/dist/types/commands/config/cmd-config-auto.d.mts +2 -3
- package/dist/types/commands/config/cmd-config-auto.d.mts.map +1 -1
- package/dist/types/commands/config/cmd-config-get.d.mts +2 -3
- package/dist/types/commands/config/cmd-config-get.d.mts.map +1 -1
- package/dist/types/commands/config/cmd-config-list.d.mts +2 -3
- package/dist/types/commands/config/cmd-config-list.d.mts.map +1 -1
- package/dist/types/commands/config/cmd-config-set.d.mts +2 -3
- package/dist/types/commands/config/cmd-config-set.d.mts.map +1 -1
- package/dist/types/commands/config/cmd-config-unset.d.mts +2 -3
- package/dist/types/commands/config/cmd-config-unset.d.mts.map +1 -1
- package/dist/types/commands/fix/cmd-fix.d.mts +2 -3
- package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/env-helpers.d.mts +1 -1
- package/dist/types/commands/fix/env-helpers.d.mts.map +1 -1
- package/dist/types/commands/fix/git.d.mts +1 -1
- package/dist/types/commands/fix/git.d.mts.map +1 -1
- package/dist/types/commands/fix/pull-request.d.mts +1 -1
- package/dist/types/commands/fix/pull-request.d.mts.map +1 -1
- package/dist/types/commands/install/cmd-install-completion.d.mts +2 -3
- package/dist/types/commands/install/cmd-install-completion.d.mts.map +1 -1
- package/dist/types/commands/json/cmd-json.d.mts +2 -3
- package/dist/types/commands/json/cmd-json.d.mts.map +1 -1
- package/dist/types/commands/login/cmd-login.d.mts +2 -3
- package/dist/types/commands/login/cmd-login.d.mts.map +1 -1
- package/dist/types/commands/logout/cmd-logout.d.mts +2 -3
- package/dist/types/commands/logout/cmd-logout.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts +2 -3
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts +2 -3
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts +2 -3
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts +2 -3
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts +2 -3
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts +2 -3
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-setup.d.mts +2 -3
- package/dist/types/commands/manifest/cmd-manifest-setup.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest.d.mts +2 -3
- 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 +2 -3
- package/dist/types/commands/npm/cmd-npm.d.mts.map +1 -1
- package/dist/types/commands/npx/cmd-npx.d.mts +2 -3
- package/dist/types/commands/npx/cmd-npx.d.mts.map +1 -1
- package/dist/types/commands/oops/cmd-oops.d.mts +2 -3
- package/dist/types/commands/oops/cmd-oops.d.mts.map +1 -1
- package/dist/types/commands/optimize/cmd-optimize.d.mts +2 -3
- package/dist/types/commands/optimize/cmd-optimize.d.mts.map +1 -1
- package/dist/types/commands/organization/cmd-organization-dependencies.d.mts +2 -3
- package/dist/types/commands/organization/cmd-organization-dependencies.d.mts.map +1 -1
- package/dist/types/commands/organization/cmd-organization-list.d.mts +2 -3
- package/dist/types/commands/organization/cmd-organization-list.d.mts.map +1 -1
- package/dist/types/commands/organization/cmd-organization-policy-license.d.mts +2 -3
- package/dist/types/commands/organization/cmd-organization-policy-license.d.mts.map +1 -1
- package/dist/types/commands/organization/cmd-organization-policy-security.d.mts +2 -3
- package/dist/types/commands/organization/cmd-organization-policy-security.d.mts.map +1 -1
- package/dist/types/commands/organization/cmd-organization-quota.d.mts +2 -3
- package/dist/types/commands/organization/cmd-organization-quota.d.mts.map +1 -1
- package/dist/types/commands/package/cmd-package-score.d.mts +2 -3
- package/dist/types/commands/package/cmd-package-score.d.mts.map +1 -1
- package/dist/types/commands/package/cmd-package-shallow.d.mts +2 -3
- package/dist/types/commands/package/cmd-package-shallow.d.mts.map +1 -1
- package/dist/types/commands/patch/cmd-patch.d.mts +2 -3
- package/dist/types/commands/patch/cmd-patch.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/raw-npm/cmd-raw-npm.d.mts +2 -3
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts.map +1 -1
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts +2 -3
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts.map +1 -1
- package/dist/types/commands/repository/cmd-repository-create.d.mts +2 -3
- package/dist/types/commands/repository/cmd-repository-create.d.mts.map +1 -1
- package/dist/types/commands/repository/cmd-repository-del.d.mts +2 -3
- package/dist/types/commands/repository/cmd-repository-del.d.mts.map +1 -1
- package/dist/types/commands/repository/cmd-repository-list.d.mts +2 -3
- package/dist/types/commands/repository/cmd-repository-list.d.mts.map +1 -1
- package/dist/types/commands/repository/cmd-repository-update.d.mts +2 -3
- package/dist/types/commands/repository/cmd-repository-update.d.mts.map +1 -1
- package/dist/types/commands/repository/cmd-repository-view.d.mts +2 -3
- package/dist/types/commands/repository/cmd-repository-view.d.mts.map +1 -1
- package/dist/types/commands/repository/handle-list-repos.d.mts +2 -1
- package/dist/types/commands/repository/handle-list-repos.d.mts.map +1 -1
- package/dist/types/commands/repository/output-list-repos.d.mts +2 -1
- package/dist/types/commands/repository/output-list-repos.d.mts.map +1 -1
- package/dist/types/commands/repository/types.d.mts +2 -0
- package/dist/types/commands/repository/types.d.mts.map +1 -0
- package/dist/types/commands/scan/cmd-scan-create.d.mts +2 -3
- package/dist/types/commands/scan/cmd-scan-create.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-del.d.mts +2 -3
- package/dist/types/commands/scan/cmd-scan-del.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-diff.d.mts +2 -3
- package/dist/types/commands/scan/cmd-scan-diff.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-github.d.mts +2 -3
- package/dist/types/commands/scan/cmd-scan-github.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-list.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-metadata.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-reach.d.mts +2 -3
- package/dist/types/commands/scan/cmd-scan-reach.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-report.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-setup.d.mts +2 -3
- package/dist/types/commands/scan/cmd-scan-setup.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-view.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts +2 -3
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts +2 -3
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts.map +1 -1
- package/dist/types/commands/wrapper/cmd-wrapper.d.mts +2 -3
- package/dist/types/commands/wrapper/cmd-wrapper.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 +31 -63
- 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/flags.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/cmd.d.mts +25 -1
- package/dist/types/utils/cmd.d.mts.map +1 -1
- package/dist/types/utils/coana.d.mts.map +1 -1
- package/dist/types/utils/config.d.mts +1 -1
- package/dist/types/utils/config.d.mts.map +1 -1
- package/dist/types/utils/git.d.mts +4 -4
- package/dist/types/utils/git.d.mts.map +1 -1
- package/dist/types/utils/github.d.mts.map +1 -1
- package/dist/types/utils/lockfile.d.mts +1 -1
- package/dist/types/utils/lockfile.d.mts.map +1 -1
- package/dist/types/utils/meow-with-subcommands.d.mts +16 -1
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
- package/dist/types/utils/npm-config.d.mts +1 -1
- package/dist/types/utils/npm-config.d.mts.map +1 -1
- package/dist/types/utils/npm-package-arg.d.mts +1 -1
- package/dist/types/utils/npm-package-arg.d.mts.map +1 -1
- package/dist/types/utils/output-formatting.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/pnpm.d.mts +2 -2
- package/dist/types/utils/pnpm.d.mts.map +1 -1
- package/dist/types/utils/purl.d.mts +6 -6
- package/dist/types/utils/purl.d.mts.map +1 -1
- package/dist/types/utils/sdk.d.mts.map +1 -1
- package/dist/types/utils/semver.d.mts +2 -2
- package/dist/types/utils/semver.d.mts.map +1 -1
- 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/strings.d.mts +2 -0
- package/dist/types/utils/strings.d.mts.map +1 -0
- 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 +404 -104
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +58633 -64690
- package/dist/yarn-cli.js +26 -0
- package/dist/yarn-cli.js.map +1 -0
- package/external/blessed/lib/tput.js +13 -13
- package/external/blessed/lib/widgets/ansiimage.js +1 -1
- package/external/blessed/lib/widgets/bigtext.js +1 -1
- package/external/blessed/lib/widgets/box.js +1 -1
- package/external/blessed/lib/widgets/button.js +1 -1
- package/external/blessed/lib/widgets/checkbox.js +1 -1
- package/external/blessed/lib/widgets/element.js +1 -1
- package/external/blessed/lib/widgets/filemanager.js +1 -1
- package/external/blessed/lib/widgets/form.js +1 -1
- package/external/blessed/lib/widgets/image.js +1 -1
- package/external/blessed/lib/widgets/input.js +1 -1
- package/external/blessed/lib/widgets/layout.js +1 -1
- package/external/blessed/lib/widgets/line.js +1 -1
- package/external/blessed/lib/widgets/list.js +1 -1
- package/external/blessed/lib/widgets/listbar.js +1 -1
- package/external/blessed/lib/widgets/listtable.js +1 -1
- package/external/blessed/lib/widgets/loading.js +1 -1
- package/external/blessed/lib/widgets/log.js +1 -1
- package/external/blessed/lib/widgets/message.js +1 -1
- package/external/blessed/lib/widgets/node.js +3 -2
- package/external/blessed/lib/widgets/overlayimage.js +1 -1
- package/external/blessed/lib/widgets/progressbar.js +1 -1
- package/external/blessed/lib/widgets/prompt.js +1 -1
- package/external/blessed/lib/widgets/question.js +1 -1
- package/external/blessed/lib/widgets/radiobutton.js +1 -1
- package/external/blessed/lib/widgets/radioset.js +1 -1
- package/external/blessed/lib/widgets/screen.js +8 -6
- package/external/blessed/lib/widgets/scrollablebox.js +1 -1
- package/external/blessed/lib/widgets/scrollabletext.js +1 -1
- package/external/blessed/lib/widgets/table.js +1 -1
- package/external/blessed/lib/widgets/terminal.js +1 -1
- package/external/blessed/lib/widgets/text.js +1 -1
- package/external/blessed/lib/widgets/textarea.js +1 -1
- package/external/blessed/lib/widgets/textbox.js +1 -1
- package/external/blessed/lib/widgets/video.js +1 -1
- package/external/blessed/vendor/tng.js +11 -4
- package/external/blessed-contrib/lib/widget/charts/bar.js +4 -4
- package/external/blessed-contrib/lib/widget/charts/line.js +4 -4
- package/logo-dark.png +0 -0
- package/logo-light.png +0 -0
- package/package.json +67 -94
- 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
|
@@ -7,7 +7,7 @@ var require$$9 = require('../external/@socketsecurity/registry/lib/debug');
|
|
|
7
7
|
var logger = require('../external/@socketsecurity/registry/lib/logger');
|
|
8
8
|
var utils = require('./utils.js');
|
|
9
9
|
var fs = require('node:fs/promises');
|
|
10
|
-
var
|
|
10
|
+
var require$$5 = require('node:module');
|
|
11
11
|
var constants = require('./constants.js');
|
|
12
12
|
var flags = require('./flags.js');
|
|
13
13
|
var path = require('node:path');
|
|
@@ -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
|
});
|
|
@@ -3263,7 +3263,7 @@ async function openSocketFixPr(owner, repo, branch, ghsaIds, options) {
|
|
|
3263
3263
|
}
|
|
3264
3264
|
require$$9.debugFn('error', message);
|
|
3265
3265
|
}
|
|
3266
|
-
return
|
|
3266
|
+
return undefined;
|
|
3267
3267
|
}
|
|
3268
3268
|
async function getSocketFixPrs(owner, repo, options) {
|
|
3269
3269
|
return (await getSocketFixPrsWithContext(owner, repo, options)).map(d => d.match);
|
|
@@ -3388,7 +3388,7 @@ function ciRepoInfo() {
|
|
|
3388
3388
|
const ownerSlashRepo = GITHUB_REPOSITORY;
|
|
3389
3389
|
const slashIndex = ownerSlashRepo.indexOf('/');
|
|
3390
3390
|
if (slashIndex === -1) {
|
|
3391
|
-
return
|
|
3391
|
+
return undefined;
|
|
3392
3392
|
}
|
|
3393
3393
|
return {
|
|
3394
3394
|
owner: ownerSlashRepo.slice(0, slashIndex),
|
|
@@ -3411,7 +3411,7 @@ async function getFixEnv() {
|
|
|
3411
3411
|
const envVars = [...(constants.default.ENV.CI ? [] : ['process.env.CI']), ...(gitEmail ? [] : ['process.env.SOCKET_CLI_GIT_USER_EMAIL']), ...(gitUser ? [] : ['process.env.SOCKET_CLI_GIT_USER_NAME']), ...(githubToken ? [] : ['process.env.GITHUB_TOKEN'])];
|
|
3412
3412
|
require$$9.debugFn('notice', `miss: fixEnv.isCi is false, expected ${arrays.joinAnd(envVars)} to be set`);
|
|
3413
3413
|
}
|
|
3414
|
-
let repoInfo
|
|
3414
|
+
let repoInfo;
|
|
3415
3415
|
if (isCi) {
|
|
3416
3416
|
repoInfo = ciRepoInfo();
|
|
3417
3417
|
}
|
|
@@ -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)}
|
|
@@ -4055,7 +4055,7 @@ async function setupTabCompletion(targetName) {
|
|
|
4055
4055
|
};
|
|
4056
4056
|
}
|
|
4057
4057
|
function getTabCompletionScriptRaw() {
|
|
4058
|
-
const sourceDir = path.dirname(require$$0.fileURLToPath(
|
|
4058
|
+
const sourceDir = path.dirname(require$$0.fileURLToPath((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href))));
|
|
4059
4059
|
const sourcePath = path.join(sourceDir, 'socket-completion.bash');
|
|
4060
4060
|
if (!fs$1.existsSync(sourcePath)) {
|
|
4061
4061
|
return {
|
|
@@ -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;
|
|
@@ -4533,7 +4535,6 @@ function argvToArray(argvObj) {
|
|
|
4533
4535
|
return result;
|
|
4534
4536
|
}
|
|
4535
4537
|
async function runCdxgen(argvObj) {
|
|
4536
|
-
let cleanupPackageLock = false;
|
|
4537
4538
|
const argvMutable = {
|
|
4538
4539
|
__proto__: null,
|
|
4539
4540
|
...argvObj
|
|
@@ -4546,23 +4547,58 @@ async function runCdxgen(argvObj) {
|
|
|
4546
4547
|
},
|
|
4547
4548
|
stdio: 'inherit'
|
|
4548
4549
|
};
|
|
4549
|
-
|
|
4550
|
-
|
|
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
|
+
});
|
|
4561
|
+
let cleanupPackageLock = false;
|
|
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,11 +4821,15 @@ 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$
|
|
4791
|
-
|
|
4792
|
-
|
|
4826
|
+
async function run$F(argv, importMeta, context) {
|
|
4827
|
+
const {
|
|
4828
|
+
parentName
|
|
4829
|
+
} = {
|
|
4830
|
+
__proto__: null,
|
|
4831
|
+
...context
|
|
4832
|
+
};
|
|
4793
4833
|
const cli = utils.meowOrExit({
|
|
4794
4834
|
// Don't let meow take over --help.
|
|
4795
4835
|
argv: argv.filter(a => !utils.isHelpFlag(a)),
|
|
@@ -4797,11 +4837,17 @@ async function run$D(argv, importMeta, {
|
|
|
4797
4837
|
importMeta,
|
|
4798
4838
|
parentName
|
|
4799
4839
|
});
|
|
4800
|
-
const
|
|
4840
|
+
const {
|
|
4841
|
+
dryRun
|
|
4842
|
+
} = cli.flags;
|
|
4801
4843
|
|
|
4802
|
-
//
|
|
4844
|
+
// Filter Socket flags from argv but keep --no-banner and --help for cdxgen.
|
|
4845
|
+
const argsToProcess = utils.filterFlags(argv, {
|
|
4846
|
+
...flags.commonFlags,
|
|
4847
|
+
...flags.outputFlags
|
|
4848
|
+
}, ['--no-banner', '--help', '-h']);
|
|
4803
4849
|
const yargv = {
|
|
4804
|
-
...vendor.yargsParser(
|
|
4850
|
+
...vendor.yargsParser(argsToProcess, yargsConfig)
|
|
4805
4851
|
};
|
|
4806
4852
|
const pathArgs = [];
|
|
4807
4853
|
const unknowns = [];
|
|
@@ -4895,9 +4941,9 @@ const config$d = {
|
|
|
4895
4941
|
const cmdManifestAuto = {
|
|
4896
4942
|
description: config$d.description,
|
|
4897
4943
|
hidden: config$d.hidden,
|
|
4898
|
-
run: run$
|
|
4944
|
+
run: run$E
|
|
4899
4945
|
};
|
|
4900
|
-
async function run$
|
|
4946
|
+
async function run$E(argv, importMeta, {
|
|
4901
4947
|
parentName
|
|
4902
4948
|
}) {
|
|
4903
4949
|
const cli = utils.meowOrExit({
|
|
@@ -4956,14 +5002,15 @@ async function run$C(argv, importMeta, {
|
|
|
4956
5002
|
|
|
4957
5003
|
const config$c = {
|
|
4958
5004
|
commandName: 'conda',
|
|
4959
|
-
description:
|
|
5005
|
+
description: `[beta] Convert a Conda ${constants.ENVIRONMENT_YML} file to a python ${constants.REQUIREMENTS_TXT}`,
|
|
4960
5006
|
hidden: false,
|
|
4961
5007
|
flags: {
|
|
4962
5008
|
...flags.commonFlags,
|
|
4963
5009
|
...flags.outputFlags,
|
|
4964
5010
|
file: {
|
|
4965
5011
|
type: 'string',
|
|
4966
|
-
|
|
5012
|
+
default: '',
|
|
5013
|
+
description: `Input file name (by default for Conda this is "${constants.ENVIRONMENT_YML}"), relative to cwd`
|
|
4967
5014
|
},
|
|
4968
5015
|
stdin: {
|
|
4969
5016
|
type: 'boolean',
|
|
@@ -4971,11 +5018,12 @@ const config$c = {
|
|
|
4971
5018
|
},
|
|
4972
5019
|
out: {
|
|
4973
5020
|
type: 'string',
|
|
5021
|
+
default: '',
|
|
4974
5022
|
description: 'Output path (relative to cwd)'
|
|
4975
5023
|
},
|
|
4976
5024
|
stdout: {
|
|
4977
5025
|
type: 'boolean',
|
|
4978
|
-
description:
|
|
5026
|
+
description: `Print resulting ${constants.REQUIREMENTS_TXT} to stdout (supersedes --out)`
|
|
4979
5027
|
},
|
|
4980
5028
|
verbose: {
|
|
4981
5029
|
type: 'boolean',
|
|
@@ -4987,8 +5035,8 @@ const config$c = {
|
|
|
4987
5035
|
$ ${command} [options] [CWD=.]
|
|
4988
5036
|
|
|
4989
5037
|
Warning: While we don't support Conda necessarily, this tool extracts the pip
|
|
4990
|
-
block from an
|
|
4991
|
-
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.
|
|
4992
5040
|
|
|
4993
5041
|
USE AT YOUR OWN RISK
|
|
4994
5042
|
|
|
@@ -5001,15 +5049,15 @@ const config$c = {
|
|
|
5001
5049
|
Examples
|
|
5002
5050
|
|
|
5003
5051
|
$ ${command}
|
|
5004
|
-
$ ${command} ./project/foo --file
|
|
5052
|
+
$ ${command} ./project/foo --file ${constants.ENVIRONMENT_YAML}
|
|
5005
5053
|
`
|
|
5006
5054
|
};
|
|
5007
5055
|
const cmdManifestConda = {
|
|
5008
5056
|
description: config$c.description,
|
|
5009
5057
|
hidden: config$c.hidden,
|
|
5010
|
-
run: run$
|
|
5058
|
+
run: run$D
|
|
5011
5059
|
};
|
|
5012
|
-
async function run$
|
|
5060
|
+
async function run$D(argv, importMeta, {
|
|
5013
5061
|
parentName
|
|
5014
5062
|
}) {
|
|
5015
5063
|
const cli = utils.meowOrExit({
|
|
@@ -5019,10 +5067,10 @@ async function run$B(argv, importMeta, {
|
|
|
5019
5067
|
parentName
|
|
5020
5068
|
});
|
|
5021
5069
|
const {
|
|
5022
|
-
|
|
5023
|
-
|
|
5070
|
+
dryRun,
|
|
5071
|
+
json,
|
|
5072
|
+
markdown
|
|
5024
5073
|
} = cli.flags;
|
|
5025
|
-
const dryRun = !!cli.flags['dryRun'];
|
|
5026
5074
|
let [cwd = '.'] = cli.input;
|
|
5027
5075
|
// Note: path.resolve vs .join:
|
|
5028
5076
|
// If given path is absolute then cwd should not affect it.
|
|
@@ -5039,35 +5087,35 @@ async function run$B(argv, importMeta, {
|
|
|
5039
5087
|
// Set defaults for any flag/arg that is not given. Check socket.json first.
|
|
5040
5088
|
if (stdin === undefined && sockJson.defaults?.manifest?.conda?.stdin !== undefined) {
|
|
5041
5089
|
stdin = sockJson.defaults?.manifest?.conda?.stdin;
|
|
5042
|
-
logger.logger.info(
|
|
5090
|
+
logger.logger.info(`Using default --stdin from ${constants.SOCKET_JSON}:`, stdin);
|
|
5043
5091
|
}
|
|
5044
5092
|
if (stdin) {
|
|
5045
5093
|
filename = '-';
|
|
5046
5094
|
} else if (!filename) {
|
|
5047
5095
|
if (sockJson.defaults?.manifest?.conda?.infile) {
|
|
5048
5096
|
filename = sockJson.defaults?.manifest?.conda?.infile;
|
|
5049
|
-
logger.logger.info(
|
|
5097
|
+
logger.logger.info(`Using default --file from ${constants.SOCKET_JSON}:`, filename);
|
|
5050
5098
|
} else {
|
|
5051
|
-
filename =
|
|
5099
|
+
filename = constants.ENVIRONMENT_YML;
|
|
5052
5100
|
}
|
|
5053
5101
|
}
|
|
5054
5102
|
if (stdout === undefined && sockJson.defaults?.manifest?.conda?.stdout !== undefined) {
|
|
5055
5103
|
stdout = sockJson.defaults?.manifest?.conda?.stdout;
|
|
5056
|
-
logger.logger.info(
|
|
5104
|
+
logger.logger.info(`Using default --stdout from ${constants.SOCKET_JSON}:`, stdout);
|
|
5057
5105
|
}
|
|
5058
5106
|
if (stdout) {
|
|
5059
5107
|
out = '-';
|
|
5060
5108
|
} else if (!out) {
|
|
5061
5109
|
if (sockJson.defaults?.manifest?.conda?.outfile) {
|
|
5062
5110
|
out = sockJson.defaults?.manifest?.conda?.outfile;
|
|
5063
|
-
logger.logger.info(
|
|
5111
|
+
logger.logger.info(`Using default --out from ${constants.SOCKET_JSON}:`, out);
|
|
5064
5112
|
} else {
|
|
5065
|
-
out =
|
|
5113
|
+
out = constants.REQUIREMENTS_TXT;
|
|
5066
5114
|
}
|
|
5067
5115
|
}
|
|
5068
5116
|
if (verbose === undefined && sockJson.defaults?.manifest?.conda?.verbose !== undefined) {
|
|
5069
5117
|
verbose = sockJson.defaults?.manifest?.conda?.verbose;
|
|
5070
|
-
logger.logger.info(
|
|
5118
|
+
logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
|
|
5071
5119
|
} else if (verbose === undefined) {
|
|
5072
5120
|
verbose = false;
|
|
5073
5121
|
}
|
|
@@ -5101,10 +5149,10 @@ async function run$B(argv, importMeta, {
|
|
|
5101
5149
|
}
|
|
5102
5150
|
await handleManifestConda({
|
|
5103
5151
|
cwd,
|
|
5104
|
-
filename
|
|
5105
|
-
out
|
|
5152
|
+
filename,
|
|
5153
|
+
out,
|
|
5106
5154
|
outputKind,
|
|
5107
|
-
verbose
|
|
5155
|
+
verbose
|
|
5108
5156
|
});
|
|
5109
5157
|
}
|
|
5110
5158
|
|
|
@@ -5139,7 +5187,7 @@ const config$b = {
|
|
|
5139
5187
|
global \`gradle\` binary but that may not work (hard to predict).
|
|
5140
5188
|
|
|
5141
5189
|
The \`pom.xml\` is a manifest file similar to \`package.json\` for npm or
|
|
5142
|
-
or
|
|
5190
|
+
or ${constants.REQUIREMENTS_TXT} for PyPi), but specifically for Maven, which is Java's
|
|
5143
5191
|
dependency repository. Languages like Kotlin and Scala piggy back on it too.
|
|
5144
5192
|
|
|
5145
5193
|
There are some caveats with the gradle to \`pom.xml\` conversion:
|
|
@@ -5163,9 +5211,9 @@ const config$b = {
|
|
|
5163
5211
|
const cmdManifestGradle = {
|
|
5164
5212
|
description: config$b.description,
|
|
5165
5213
|
hidden: config$b.hidden,
|
|
5166
|
-
run: run$
|
|
5214
|
+
run: run$C
|
|
5167
5215
|
};
|
|
5168
|
-
async function run$
|
|
5216
|
+
async function run$C(argv, importMeta, {
|
|
5169
5217
|
parentName
|
|
5170
5218
|
}) {
|
|
5171
5219
|
const cli = utils.meowOrExit({
|
|
@@ -5187,7 +5235,7 @@ async function run$A(argv, importMeta, {
|
|
|
5187
5235
|
// If given path is absolute then cwd should not affect it.
|
|
5188
5236
|
cwd = path.resolve(process.cwd(), cwd);
|
|
5189
5237
|
const sockJson = utils.readOrDefaultSocketJson(cwd);
|
|
5190
|
-
require$$9.debugFn('inspect',
|
|
5238
|
+
require$$9.debugFn('inspect', `override: ${constants.SOCKET_JSON} gradle`, sockJson?.defaults?.manifest?.gradle);
|
|
5191
5239
|
let {
|
|
5192
5240
|
bin,
|
|
5193
5241
|
gradleOpts,
|
|
@@ -5198,7 +5246,7 @@ async function run$A(argv, importMeta, {
|
|
|
5198
5246
|
if (!bin) {
|
|
5199
5247
|
if (sockJson.defaults?.manifest?.gradle?.bin) {
|
|
5200
5248
|
bin = sockJson.defaults?.manifest?.gradle?.bin;
|
|
5201
|
-
logger.logger.info(
|
|
5249
|
+
logger.logger.info(`Using default --bin from ${constants.SOCKET_JSON}:`, bin);
|
|
5202
5250
|
} else {
|
|
5203
5251
|
bin = path.join(cwd, 'gradlew');
|
|
5204
5252
|
}
|
|
@@ -5206,7 +5254,7 @@ async function run$A(argv, importMeta, {
|
|
|
5206
5254
|
if (!gradleOpts) {
|
|
5207
5255
|
if (sockJson.defaults?.manifest?.gradle?.gradleOpts) {
|
|
5208
5256
|
gradleOpts = sockJson.defaults?.manifest?.gradle?.gradleOpts;
|
|
5209
|
-
logger.logger.info(
|
|
5257
|
+
logger.logger.info(`Using default --gradle-opts from ${constants.SOCKET_JSON}:`, gradleOpts);
|
|
5210
5258
|
} else {
|
|
5211
5259
|
gradleOpts = '';
|
|
5212
5260
|
}
|
|
@@ -5214,7 +5262,7 @@ async function run$A(argv, importMeta, {
|
|
|
5214
5262
|
if (verbose === undefined) {
|
|
5215
5263
|
if (sockJson.defaults?.manifest?.gradle?.verbose !== undefined) {
|
|
5216
5264
|
verbose = sockJson.defaults?.manifest?.gradle?.verbose;
|
|
5217
|
-
logger.logger.info(
|
|
5265
|
+
logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
|
|
5218
5266
|
} else {
|
|
5219
5267
|
verbose = false;
|
|
5220
5268
|
}
|
|
@@ -5294,7 +5342,7 @@ const config$a = {
|
|
|
5294
5342
|
global \`gradle\` binary but that may not work (hard to predict).
|
|
5295
5343
|
|
|
5296
5344
|
The \`pom.xml\` is a manifest file similar to \`package.json\` for npm or
|
|
5297
|
-
or
|
|
5345
|
+
or ${constants.REQUIREMENTS_TXT} for PyPi), but specifically for Maven, which is Java's
|
|
5298
5346
|
dependency repository. Languages like Kotlin and Scala piggy back on it too.
|
|
5299
5347
|
|
|
5300
5348
|
There are some caveats with the gradle to \`pom.xml\` conversion:
|
|
@@ -5318,9 +5366,9 @@ const config$a = {
|
|
|
5318
5366
|
const cmdManifestKotlin = {
|
|
5319
5367
|
description: config$a.description,
|
|
5320
5368
|
hidden: config$a.hidden,
|
|
5321
|
-
run: run$
|
|
5369
|
+
run: run$B
|
|
5322
5370
|
};
|
|
5323
|
-
async function run$
|
|
5371
|
+
async function run$B(argv, importMeta, {
|
|
5324
5372
|
parentName
|
|
5325
5373
|
}) {
|
|
5326
5374
|
const cli = utils.meowOrExit({
|
|
@@ -5342,7 +5390,7 @@ async function run$z(argv, importMeta, {
|
|
|
5342
5390
|
// If given path is absolute then cwd should not affect it.
|
|
5343
5391
|
cwd = path.resolve(process.cwd(), cwd);
|
|
5344
5392
|
const sockJson = utils.readOrDefaultSocketJson(cwd);
|
|
5345
|
-
require$$9.debugFn('inspect',
|
|
5393
|
+
require$$9.debugFn('inspect', `override: ${constants.SOCKET_JSON} gradle`, sockJson?.defaults?.manifest?.gradle);
|
|
5346
5394
|
let {
|
|
5347
5395
|
bin,
|
|
5348
5396
|
gradleOpts,
|
|
@@ -5353,7 +5401,7 @@ async function run$z(argv, importMeta, {
|
|
|
5353
5401
|
if (!bin) {
|
|
5354
5402
|
if (sockJson.defaults?.manifest?.gradle?.bin) {
|
|
5355
5403
|
bin = sockJson.defaults?.manifest?.gradle?.bin;
|
|
5356
|
-
logger.logger.info(
|
|
5404
|
+
logger.logger.info(`Using default --bin from ${constants.SOCKET_JSON}:`, bin);
|
|
5357
5405
|
} else {
|
|
5358
5406
|
bin = path.join(cwd, 'gradlew');
|
|
5359
5407
|
}
|
|
@@ -5361,7 +5409,7 @@ async function run$z(argv, importMeta, {
|
|
|
5361
5409
|
if (!gradleOpts) {
|
|
5362
5410
|
if (sockJson.defaults?.manifest?.gradle?.gradleOpts) {
|
|
5363
5411
|
gradleOpts = sockJson.defaults?.manifest?.gradle?.gradleOpts;
|
|
5364
|
-
logger.logger.info(
|
|
5412
|
+
logger.logger.info(`Using default --gradle-opts from ${constants.SOCKET_JSON}:`, gradleOpts);
|
|
5365
5413
|
} else {
|
|
5366
5414
|
gradleOpts = '';
|
|
5367
5415
|
}
|
|
@@ -5369,7 +5417,7 @@ async function run$z(argv, importMeta, {
|
|
|
5369
5417
|
if (verbose === undefined) {
|
|
5370
5418
|
if (sockJson.defaults?.manifest?.gradle?.verbose !== undefined) {
|
|
5371
5419
|
verbose = sockJson.defaults?.manifest?.gradle?.verbose;
|
|
5372
|
-
logger.logger.info(
|
|
5420
|
+
logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
|
|
5373
5421
|
} else {
|
|
5374
5422
|
verbose = false;
|
|
5375
5423
|
}
|
|
@@ -5449,7 +5497,7 @@ const config$9 = {
|
|
|
5449
5497
|
|
|
5450
5498
|
Uses \`sbt makePom\` to generate a \`pom.xml\` from your \`build.sbt\` file.
|
|
5451
5499
|
This xml file is the dependency manifest (like a package.json
|
|
5452
|
-
for Node.js or
|
|
5500
|
+
for Node.js or ${constants.REQUIREMENTS_TXT} for PyPi), but specifically for Scala.
|
|
5453
5501
|
|
|
5454
5502
|
There are some caveats with \`build.sbt\` to \`pom.xml\` conversion:
|
|
5455
5503
|
|
|
@@ -5481,9 +5529,9 @@ const config$9 = {
|
|
|
5481
5529
|
const cmdManifestScala = {
|
|
5482
5530
|
description: config$9.description,
|
|
5483
5531
|
hidden: config$9.hidden,
|
|
5484
|
-
run: run$
|
|
5532
|
+
run: run$A
|
|
5485
5533
|
};
|
|
5486
|
-
async function run$
|
|
5534
|
+
async function run$A(argv, importMeta, {
|
|
5487
5535
|
parentName
|
|
5488
5536
|
}) {
|
|
5489
5537
|
const cli = utils.meowOrExit({
|
|
@@ -5505,7 +5553,7 @@ async function run$y(argv, importMeta, {
|
|
|
5505
5553
|
// TODO: Implement json/md further.
|
|
5506
5554
|
const outputKind = utils.getOutputKind(json, markdown);
|
|
5507
5555
|
const sockJson = utils.readOrDefaultSocketJson(cwd);
|
|
5508
|
-
require$$9.debugFn('inspect',
|
|
5556
|
+
require$$9.debugFn('inspect', `override: ${constants.SOCKET_JSON} sbt`, sockJson?.defaults?.manifest?.sbt);
|
|
5509
5557
|
let {
|
|
5510
5558
|
bin,
|
|
5511
5559
|
out,
|
|
@@ -5518,21 +5566,21 @@ async function run$y(argv, importMeta, {
|
|
|
5518
5566
|
if (!bin) {
|
|
5519
5567
|
if (sockJson.defaults?.manifest?.sbt?.bin) {
|
|
5520
5568
|
bin = sockJson.defaults?.manifest?.sbt?.bin;
|
|
5521
|
-
logger.logger.info(
|
|
5569
|
+
logger.logger.info(`Using default --bin from ${constants.SOCKET_JSON}:`, bin);
|
|
5522
5570
|
} else {
|
|
5523
5571
|
bin = 'sbt';
|
|
5524
5572
|
}
|
|
5525
5573
|
}
|
|
5526
5574
|
if (stdout === undefined && sockJson.defaults?.manifest?.sbt?.stdout !== undefined) {
|
|
5527
5575
|
stdout = sockJson.defaults?.manifest?.sbt?.stdout;
|
|
5528
|
-
logger.logger.info(
|
|
5576
|
+
logger.logger.info(`Using default --stdout from ${constants.SOCKET_JSON}:`, stdout);
|
|
5529
5577
|
}
|
|
5530
5578
|
if (stdout) {
|
|
5531
5579
|
out = '-';
|
|
5532
5580
|
} else if (!out) {
|
|
5533
5581
|
if (sockJson.defaults?.manifest?.sbt?.outfile) {
|
|
5534
5582
|
out = sockJson.defaults?.manifest?.sbt?.outfile;
|
|
5535
|
-
logger.logger.info(
|
|
5583
|
+
logger.logger.info(`Using default --out from ${constants.SOCKET_JSON}:`, out);
|
|
5536
5584
|
} else {
|
|
5537
5585
|
out = './socket.pom.xml';
|
|
5538
5586
|
}
|
|
@@ -5540,14 +5588,14 @@ async function run$y(argv, importMeta, {
|
|
|
5540
5588
|
if (!sbtOpts) {
|
|
5541
5589
|
if (sockJson.defaults?.manifest?.sbt?.sbtOpts) {
|
|
5542
5590
|
sbtOpts = sockJson.defaults?.manifest?.sbt?.sbtOpts;
|
|
5543
|
-
logger.logger.info(
|
|
5591
|
+
logger.logger.info(`Using default --sbt-opts from ${constants.SOCKET_JSON}:`, sbtOpts);
|
|
5544
5592
|
} else {
|
|
5545
5593
|
sbtOpts = '';
|
|
5546
5594
|
}
|
|
5547
5595
|
}
|
|
5548
5596
|
if (verbose === undefined && sockJson.defaults?.manifest?.sbt?.verbose !== undefined) {
|
|
5549
5597
|
verbose = sockJson.defaults?.manifest?.sbt?.verbose;
|
|
5550
|
-
logger.logger.info(
|
|
5598
|
+
logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
|
|
5551
5599
|
} else if (verbose === undefined) {
|
|
5552
5600
|
verbose = false;
|
|
5553
5601
|
}
|
|
@@ -5615,18 +5663,18 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
|
|
|
5615
5663
|
// - each target will have its own specific options
|
|
5616
5664
|
// - record them to the socket.yml (or socket-cli.yml ? or just socket.json ?)
|
|
5617
5665
|
|
|
5618
|
-
const jsonPath = path.join(cwd,
|
|
5666
|
+
const jsonPath = path.join(cwd, constants.SOCKET_JSON);
|
|
5619
5667
|
if (fs$1.existsSync(jsonPath)) {
|
|
5620
|
-
logger.logger.info(`Found
|
|
5668
|
+
logger.logger.info(`Found ${constants.SOCKET_JSON} at ${jsonPath}`);
|
|
5621
5669
|
} else {
|
|
5622
|
-
logger.logger.info(`No
|
|
5670
|
+
logger.logger.info(`No ${constants.SOCKET_JSON} found at ${cwd}, will generate a new one`);
|
|
5623
5671
|
}
|
|
5624
5672
|
logger.logger.log('');
|
|
5625
5673
|
logger.logger.log('Note: This tool will set up flag and argument defaults for certain');
|
|
5626
5674
|
logger.logger.log(' CLI commands. You can still override them by explicitly');
|
|
5627
5675
|
logger.logger.log(' setting the flag. It is meant to be a convenience tool.');
|
|
5628
5676
|
logger.logger.log('');
|
|
5629
|
-
logger.logger.log(
|
|
5677
|
+
logger.logger.log(`This command will generate a ${constants.SOCKET_JSON} file in the target cwd.`);
|
|
5630
5678
|
logger.logger.log('You can choose to add this file to your repo (handy for collaboration)');
|
|
5631
5679
|
logger.logger.log('or to add it to the ignored files, or neither. This file is only');
|
|
5632
5680
|
logger.logger.log('used in CLI workflows.');
|
|
@@ -5634,7 +5682,7 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
|
|
|
5634
5682
|
const choices = [{
|
|
5635
5683
|
name: 'Conda'.padEnd(30, ' '),
|
|
5636
5684
|
value: 'conda',
|
|
5637
|
-
description:
|
|
5685
|
+
description: `Generate ${constants.REQUIREMENTS_TXT} from a Conda environment.yml`
|
|
5638
5686
|
}, {
|
|
5639
5687
|
name: 'Gradle'.padEnd(30, ' '),
|
|
5640
5688
|
value: 'gradle',
|
|
@@ -5727,7 +5775,7 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
|
|
|
5727
5775
|
return result;
|
|
5728
5776
|
}
|
|
5729
5777
|
logger.logger.log('');
|
|
5730
|
-
logger.logger.log(
|
|
5778
|
+
logger.logger.log(`Setup complete. Writing ${constants.SOCKET_JSON}`);
|
|
5731
5779
|
logger.logger.log('');
|
|
5732
5780
|
if (await prompts.select({
|
|
5733
5781
|
message: `Do you want to write the new config to ${jsonPath} ?`,
|
|
@@ -5778,7 +5826,7 @@ async function setupConda(config) {
|
|
|
5778
5826
|
delete config.stdout;
|
|
5779
5827
|
}
|
|
5780
5828
|
if (!config.stdout) {
|
|
5781
|
-
const out = await askForOutputFile(config.outfile ||
|
|
5829
|
+
const out = await askForOutputFile(config.outfile || constants.REQUIREMENTS_TXT);
|
|
5782
5830
|
if (out === undefined) {
|
|
5783
5831
|
return canceledByUser$1();
|
|
5784
5832
|
} else if (out === '-') {
|
|
@@ -6005,7 +6053,7 @@ const config$8 = {
|
|
|
6005
6053
|
...flags.commonFlags,
|
|
6006
6054
|
defaultOnReadError: {
|
|
6007
6055
|
type: 'boolean',
|
|
6008
|
-
description:
|
|
6056
|
+
description: `If reading the ${constants.SOCKET_JSON} fails, just use a default config? Warning: This might override the existing json file!`
|
|
6009
6057
|
}
|
|
6010
6058
|
},
|
|
6011
6059
|
help: (command, config) => `
|
|
@@ -6018,7 +6066,7 @@ const config$8 = {
|
|
|
6018
6066
|
This command will try to detect all supported ecosystems in given CWD. Then
|
|
6019
6067
|
it starts a configurator where you can setup default values for certain flags
|
|
6020
6068
|
when creating manifest files in that dir. These configuration details are
|
|
6021
|
-
then stored in a local
|
|
6069
|
+
then stored in a local \`${constants.SOCKET_JSON}\` file (which you may or may not commit
|
|
6022
6070
|
to the repo). Next time you run \`socket manifest ...\` it will load this
|
|
6023
6071
|
json file and any flags which are not explicitly set in the command but which
|
|
6024
6072
|
have been registered in the json file will get the default value set to that
|
|
@@ -6042,9 +6090,9 @@ const config$8 = {
|
|
|
6042
6090
|
const cmdManifestSetup = {
|
|
6043
6091
|
description: config$8.description,
|
|
6044
6092
|
hidden: config$8.hidden,
|
|
6045
|
-
run: run$
|
|
6093
|
+
run: run$z
|
|
6046
6094
|
};
|
|
6047
|
-
async function run$
|
|
6095
|
+
async function run$z(argv, importMeta, {
|
|
6048
6096
|
parentName
|
|
6049
6097
|
}) {
|
|
6050
6098
|
const cli = utils.meowOrExit({
|
|
@@ -6078,9 +6126,9 @@ const config$7 = {
|
|
|
6078
6126
|
const cmdManifest = {
|
|
6079
6127
|
description: config$7.description,
|
|
6080
6128
|
hidden: config$7.hidden,
|
|
6081
|
-
run: run$
|
|
6129
|
+
run: run$y
|
|
6082
6130
|
};
|
|
6083
|
-
async function run$
|
|
6131
|
+
async function run$y(argv, importMeta, {
|
|
6084
6132
|
parentName
|
|
6085
6133
|
}) {
|
|
6086
6134
|
await utils.meowWithSubcommands({
|
|
@@ -6107,22 +6155,26 @@ async function run$w(argv, importMeta, {
|
|
|
6107
6155
|
});
|
|
6108
6156
|
}
|
|
6109
6157
|
|
|
6110
|
-
const require$
|
|
6111
|
-
const CMD_NAME$
|
|
6112
|
-
const description$
|
|
6113
|
-
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;
|
|
6114
6162
|
const cmdNpm = {
|
|
6115
|
-
description: description$
|
|
6116
|
-
hidden: hidden$
|
|
6117
|
-
run: run$
|
|
6163
|
+
description: description$w,
|
|
6164
|
+
hidden: hidden$q,
|
|
6165
|
+
run: run$x
|
|
6118
6166
|
};
|
|
6119
|
-
async function run$
|
|
6120
|
-
|
|
6121
|
-
|
|
6167
|
+
async function run$x(argv, importMeta, context) {
|
|
6168
|
+
const {
|
|
6169
|
+
parentName
|
|
6170
|
+
} = {
|
|
6171
|
+
__proto__: null,
|
|
6172
|
+
...context
|
|
6173
|
+
};
|
|
6122
6174
|
const config = {
|
|
6123
|
-
commandName: CMD_NAME$
|
|
6124
|
-
description: description$
|
|
6125
|
-
hidden: hidden$
|
|
6175
|
+
commandName: CMD_NAME$r,
|
|
6176
|
+
description: description$w,
|
|
6177
|
+
hidden: hidden$q,
|
|
6126
6178
|
flags: {
|
|
6127
6179
|
...flags.commonFlags
|
|
6128
6180
|
},
|
|
@@ -6131,7 +6183,7 @@ async function run$v(argv, importMeta, {
|
|
|
6131
6183
|
$ ${command} ...
|
|
6132
6184
|
|
|
6133
6185
|
API Token Requirements
|
|
6134
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
6186
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$r}`)}
|
|
6135
6187
|
|
|
6136
6188
|
Note: Everything after "npm" is passed to the npm command.
|
|
6137
6189
|
Only the \`--dry-run\` and \`--help\` flags are caught here.
|
|
@@ -6141,6 +6193,7 @@ async function run$v(argv, importMeta, {
|
|
|
6141
6193
|
Examples
|
|
6142
6194
|
$ ${command}
|
|
6143
6195
|
$ ${command} install -g cowsay
|
|
6196
|
+
$ ${command} exec cowsay
|
|
6144
6197
|
`
|
|
6145
6198
|
};
|
|
6146
6199
|
const cli = utils.meowOrExit({
|
|
@@ -6154,11 +6207,17 @@ async function run$v(argv, importMeta, {
|
|
|
6154
6207
|
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
6155
6208
|
return;
|
|
6156
6209
|
}
|
|
6157
|
-
const shadowBin = /*@__PURE__*/require$
|
|
6210
|
+
const shadowBin = /*@__PURE__*/require$5(constants.default.shadowNpmBinPath);
|
|
6158
6211
|
process.exitCode = 1;
|
|
6212
|
+
|
|
6213
|
+
// Filter Socket flags from argv but keep --json for npm.
|
|
6214
|
+
const argsToForward = utils.filterFlags(argv, {
|
|
6215
|
+
...flags.commonFlags,
|
|
6216
|
+
...flags.outputFlags
|
|
6217
|
+
}, ['--json']);
|
|
6159
6218
|
const {
|
|
6160
6219
|
spawnPromise
|
|
6161
|
-
} = await shadowBin(constants.NPM,
|
|
6220
|
+
} = await shadowBin(constants.NPM, argsToForward, {
|
|
6162
6221
|
stdio: 'inherit'
|
|
6163
6222
|
});
|
|
6164
6223
|
|
|
@@ -6174,22 +6233,22 @@ async function run$v(argv, importMeta, {
|
|
|
6174
6233
|
await spawnPromise;
|
|
6175
6234
|
}
|
|
6176
6235
|
|
|
6177
|
-
const require$
|
|
6178
|
-
const CMD_NAME$
|
|
6179
|
-
const description$
|
|
6180
|
-
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;
|
|
6181
6240
|
const cmdNpx = {
|
|
6182
|
-
description: description$
|
|
6183
|
-
hidden: hidden$
|
|
6184
|
-
run: run$
|
|
6241
|
+
description: description$v,
|
|
6242
|
+
hidden: hidden$p,
|
|
6243
|
+
run: run$w
|
|
6185
6244
|
};
|
|
6186
|
-
async function run$
|
|
6245
|
+
async function run$w(argv, importMeta, {
|
|
6187
6246
|
parentName
|
|
6188
6247
|
}) {
|
|
6189
6248
|
const config = {
|
|
6190
|
-
commandName: CMD_NAME$
|
|
6191
|
-
description: description$
|
|
6192
|
-
hidden: hidden$
|
|
6249
|
+
commandName: CMD_NAME$q,
|
|
6250
|
+
description: description$v,
|
|
6251
|
+
hidden: hidden$p,
|
|
6193
6252
|
flags: {
|
|
6194
6253
|
...flags.commonFlags
|
|
6195
6254
|
},
|
|
@@ -6198,7 +6257,7 @@ async function run$u(argv, importMeta, {
|
|
|
6198
6257
|
$ ${command} ...
|
|
6199
6258
|
|
|
6200
6259
|
API Token Requirements
|
|
6201
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
6260
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$q}`)}
|
|
6202
6261
|
|
|
6203
6262
|
Note: Everything after "npx" is passed to the npx command.
|
|
6204
6263
|
Only the \`--dry-run\` and \`--help\` flags are caught here.
|
|
@@ -6207,6 +6266,7 @@ async function run$u(argv, importMeta, {
|
|
|
6207
6266
|
|
|
6208
6267
|
Examples
|
|
6209
6268
|
$ ${command} cowsay
|
|
6269
|
+
$ ${command} cowsay@1.6.0 hello
|
|
6210
6270
|
`
|
|
6211
6271
|
};
|
|
6212
6272
|
const cli = utils.meowOrExit({
|
|
@@ -6220,7 +6280,7 @@ async function run$u(argv, importMeta, {
|
|
|
6220
6280
|
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
6221
6281
|
return;
|
|
6222
6282
|
}
|
|
6223
|
-
const shadowBin = /*@__PURE__*/require$
|
|
6283
|
+
const shadowBin = /*@__PURE__*/require$4(constants.default.shadowNpmBinPath);
|
|
6224
6284
|
process.exitCode = 1;
|
|
6225
6285
|
const {
|
|
6226
6286
|
spawnPromise
|
|
@@ -6263,9 +6323,9 @@ const config$6 = {
|
|
|
6263
6323
|
const cmdOops = {
|
|
6264
6324
|
description: config$6.description,
|
|
6265
6325
|
hidden: config$6.hidden,
|
|
6266
|
-
run: run$
|
|
6326
|
+
run: run$v
|
|
6267
6327
|
};
|
|
6268
|
-
async function run$
|
|
6328
|
+
async function run$v(argv, importMeta, {
|
|
6269
6329
|
parentName
|
|
6270
6330
|
}) {
|
|
6271
6331
|
const cli = utils.meowOrExit({
|
|
@@ -6297,7 +6357,7 @@ async function run$t(argv, importMeta, {
|
|
|
6297
6357
|
logger.logger.fail(utils.failMsgWithBadge('Oops', 'This error was intentionally left blank'));
|
|
6298
6358
|
return;
|
|
6299
6359
|
}
|
|
6300
|
-
throw new Error('This error was intentionally left blank');
|
|
6360
|
+
throw new Error('This error was intentionally left blank.');
|
|
6301
6361
|
}
|
|
6302
6362
|
|
|
6303
6363
|
const {
|
|
@@ -6682,7 +6742,7 @@ async function listPackages(pkgEnvDetails, options) {
|
|
|
6682
6742
|
}
|
|
6683
6743
|
}
|
|
6684
6744
|
|
|
6685
|
-
const CMD_NAME$
|
|
6745
|
+
const CMD_NAME$p = 'socket optimize';
|
|
6686
6746
|
|
|
6687
6747
|
const {
|
|
6688
6748
|
BUN,
|
|
@@ -6854,7 +6914,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
|
|
|
6854
6914
|
npmExecPath === constants.NPM && !state.warnedPnpmWorkspaceRequiresNpm) {
|
|
6855
6915
|
state.warnedPnpmWorkspaceRequiresNpm = true;
|
|
6856
6916
|
spinner?.stop();
|
|
6857
|
-
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\``));
|
|
6858
6918
|
spinner?.start();
|
|
6859
6919
|
}
|
|
6860
6920
|
const overridesDataObjects = [];
|
|
@@ -7084,7 +7144,7 @@ async function applyOptimization(pkgEnvDetails, {
|
|
|
7084
7144
|
const pkgJsonChanged = addedCount > 0 || updatedCount > 0;
|
|
7085
7145
|
if (pkgJsonChanged || pkgEnvDetails.features.npmBuggyOverrides) {
|
|
7086
7146
|
const result = await updateLockfile(pkgEnvDetails, {
|
|
7087
|
-
cmdName: CMD_NAME$
|
|
7147
|
+
cmdName: CMD_NAME$p,
|
|
7088
7148
|
logger: logger.logger,
|
|
7089
7149
|
spinner
|
|
7090
7150
|
});
|
|
@@ -7146,7 +7206,7 @@ async function handleOptimize({
|
|
|
7146
7206
|
prod
|
|
7147
7207
|
}) {
|
|
7148
7208
|
const pkgEnvCResult = await utils.detectAndValidatePackageEnvironment(cwd, {
|
|
7149
|
-
cmdName: CMD_NAME$
|
|
7209
|
+
cmdName: CMD_NAME$p,
|
|
7150
7210
|
logger: logger.logger,
|
|
7151
7211
|
prod
|
|
7152
7212
|
});
|
|
@@ -7171,7 +7231,7 @@ async function handleOptimize({
|
|
|
7171
7231
|
await outputOptimizeResult({
|
|
7172
7232
|
ok: false,
|
|
7173
7233
|
message: 'Unsupported',
|
|
7174
|
-
cause: utils.cmdPrefixMessage(CMD_NAME$
|
|
7234
|
+
cause: utils.cmdPrefixMessage(CMD_NAME$p, `${agent} v${agentVersion} does not support overrides.`)
|
|
7175
7235
|
}, outputKind);
|
|
7176
7236
|
return;
|
|
7177
7237
|
}
|
|
@@ -7182,21 +7242,21 @@ async function handleOptimize({
|
|
|
7182
7242
|
}), outputKind);
|
|
7183
7243
|
}
|
|
7184
7244
|
|
|
7185
|
-
const CMD_NAME$
|
|
7186
|
-
const description$
|
|
7187
|
-
const hidden$
|
|
7245
|
+
const CMD_NAME$o = 'optimize';
|
|
7246
|
+
const description$u = 'Optimize dependencies with @socketregistry overrides';
|
|
7247
|
+
const hidden$o = false;
|
|
7188
7248
|
const cmdOptimize = {
|
|
7189
|
-
description: description$
|
|
7190
|
-
hidden: hidden$
|
|
7191
|
-
run: run$
|
|
7249
|
+
description: description$u,
|
|
7250
|
+
hidden: hidden$o,
|
|
7251
|
+
run: run$u
|
|
7192
7252
|
};
|
|
7193
|
-
async function run$
|
|
7253
|
+
async function run$u(argv, importMeta, {
|
|
7194
7254
|
parentName
|
|
7195
7255
|
}) {
|
|
7196
7256
|
const config = {
|
|
7197
|
-
commandName: CMD_NAME$
|
|
7198
|
-
description: description$
|
|
7199
|
-
hidden: hidden$
|
|
7257
|
+
commandName: CMD_NAME$o,
|
|
7258
|
+
description: description$u,
|
|
7259
|
+
hidden: hidden$o,
|
|
7200
7260
|
flags: {
|
|
7201
7261
|
...flags.commonFlags,
|
|
7202
7262
|
pin: {
|
|
@@ -7215,7 +7275,7 @@ async function run$s(argv, importMeta, {
|
|
|
7215
7275
|
$ ${command} [options] [CWD=.]
|
|
7216
7276
|
|
|
7217
7277
|
API Token Requirements
|
|
7218
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7278
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$o}`)}
|
|
7219
7279
|
|
|
7220
7280
|
Options
|
|
7221
7281
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7358,21 +7418,21 @@ async function handleDependencies({
|
|
|
7358
7418
|
});
|
|
7359
7419
|
}
|
|
7360
7420
|
|
|
7361
|
-
const CMD_NAME$
|
|
7362
|
-
const description$
|
|
7363
|
-
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;
|
|
7364
7424
|
const cmdOrganizationDependencies = {
|
|
7365
|
-
description: description$
|
|
7366
|
-
hidden: hidden$
|
|
7367
|
-
run: run$
|
|
7425
|
+
description: description$t,
|
|
7426
|
+
hidden: hidden$n,
|
|
7427
|
+
run: run$t
|
|
7368
7428
|
};
|
|
7369
|
-
async function run$
|
|
7429
|
+
async function run$t(argv, importMeta, {
|
|
7370
7430
|
parentName
|
|
7371
7431
|
}) {
|
|
7372
7432
|
const config = {
|
|
7373
|
-
commandName: CMD_NAME$
|
|
7374
|
-
description: description$
|
|
7375
|
-
hidden: hidden$
|
|
7433
|
+
commandName: CMD_NAME$n,
|
|
7434
|
+
description: description$t,
|
|
7435
|
+
hidden: hidden$n,
|
|
7376
7436
|
flags: {
|
|
7377
7437
|
...flags.commonFlags,
|
|
7378
7438
|
limit: {
|
|
@@ -7392,7 +7452,7 @@ async function run$r(argv, importMeta, {
|
|
|
7392
7452
|
${command} [options]
|
|
7393
7453
|
|
|
7394
7454
|
API Token Requirements
|
|
7395
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7455
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$n}`)}
|
|
7396
7456
|
|
|
7397
7457
|
Options
|
|
7398
7458
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7492,21 +7552,21 @@ async function handleLicensePolicy(orgSlug, outputKind) {
|
|
|
7492
7552
|
await outputLicensePolicy(data, outputKind);
|
|
7493
7553
|
}
|
|
7494
7554
|
|
|
7495
|
-
const CMD_NAME$
|
|
7496
|
-
const description$
|
|
7497
|
-
const hidden$
|
|
7555
|
+
const CMD_NAME$m = 'license';
|
|
7556
|
+
const description$s = 'Retrieve the license policy of an organization';
|
|
7557
|
+
const hidden$m = false;
|
|
7498
7558
|
const cmdOrganizationPolicyLicense = {
|
|
7499
|
-
description: description$
|
|
7500
|
-
hidden: hidden$
|
|
7501
|
-
run: run$
|
|
7559
|
+
description: description$s,
|
|
7560
|
+
hidden: hidden$m,
|
|
7561
|
+
run: run$s
|
|
7502
7562
|
};
|
|
7503
|
-
async function run$
|
|
7563
|
+
async function run$s(argv, importMeta, {
|
|
7504
7564
|
parentName
|
|
7505
7565
|
}) {
|
|
7506
7566
|
const config = {
|
|
7507
|
-
commandName: CMD_NAME$
|
|
7508
|
-
description: description$
|
|
7509
|
-
hidden: hidden$
|
|
7567
|
+
commandName: CMD_NAME$m,
|
|
7568
|
+
description: description$s,
|
|
7569
|
+
hidden: hidden$m,
|
|
7510
7570
|
flags: {
|
|
7511
7571
|
...flags.commonFlags,
|
|
7512
7572
|
...flags.outputFlags,
|
|
@@ -7525,7 +7585,7 @@ async function run$q(argv, importMeta, {
|
|
|
7525
7585
|
$ ${command} [options]
|
|
7526
7586
|
|
|
7527
7587
|
API Token Requirements
|
|
7528
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7588
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$m}`)}
|
|
7529
7589
|
|
|
7530
7590
|
Options
|
|
7531
7591
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7628,21 +7688,21 @@ async function handleSecurityPolicy(orgSlug, outputKind) {
|
|
|
7628
7688
|
await outputSecurityPolicy(data, outputKind);
|
|
7629
7689
|
}
|
|
7630
7690
|
|
|
7631
|
-
const CMD_NAME$
|
|
7632
|
-
const description$
|
|
7633
|
-
const hidden$
|
|
7691
|
+
const CMD_NAME$l = 'security';
|
|
7692
|
+
const description$r = 'Retrieve the security policy of an organization';
|
|
7693
|
+
const hidden$l = true;
|
|
7634
7694
|
const cmdOrganizationPolicySecurity = {
|
|
7635
|
-
description: description$
|
|
7636
|
-
hidden: hidden$
|
|
7637
|
-
run: run$
|
|
7695
|
+
description: description$r,
|
|
7696
|
+
hidden: hidden$l,
|
|
7697
|
+
run: run$r
|
|
7638
7698
|
};
|
|
7639
|
-
async function run$
|
|
7699
|
+
async function run$r(argv, importMeta, {
|
|
7640
7700
|
parentName
|
|
7641
7701
|
}) {
|
|
7642
7702
|
const config = {
|
|
7643
|
-
commandName: CMD_NAME$
|
|
7644
|
-
description: description$
|
|
7645
|
-
hidden: hidden$
|
|
7703
|
+
commandName: CMD_NAME$l,
|
|
7704
|
+
description: description$r,
|
|
7705
|
+
hidden: hidden$l,
|
|
7646
7706
|
flags: {
|
|
7647
7707
|
...flags.commonFlags,
|
|
7648
7708
|
...flags.outputFlags,
|
|
@@ -7661,7 +7721,7 @@ async function run$p(argv, importMeta, {
|
|
|
7661
7721
|
$ ${command} [options]
|
|
7662
7722
|
|
|
7663
7723
|
API Token Requirements
|
|
7664
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7724
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$l}`)}
|
|
7665
7725
|
|
|
7666
7726
|
Options
|
|
7667
7727
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7765,21 +7825,21 @@ async function handleOrganizationList(outputKind = 'text') {
|
|
|
7765
7825
|
await outputOrganizationList(data, outputKind);
|
|
7766
7826
|
}
|
|
7767
7827
|
|
|
7768
|
-
const CMD_NAME$
|
|
7769
|
-
const description$
|
|
7770
|
-
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;
|
|
7771
7831
|
const cmdOrganizationList = {
|
|
7772
|
-
description: description$
|
|
7773
|
-
hidden: hidden$
|
|
7774
|
-
run: run$
|
|
7832
|
+
description: description$q,
|
|
7833
|
+
hidden: hidden$k,
|
|
7834
|
+
run: run$q
|
|
7775
7835
|
};
|
|
7776
|
-
async function run$
|
|
7836
|
+
async function run$q(argv, importMeta, {
|
|
7777
7837
|
parentName
|
|
7778
7838
|
}) {
|
|
7779
7839
|
const config = {
|
|
7780
|
-
commandName: CMD_NAME$
|
|
7781
|
-
description: description$
|
|
7782
|
-
hidden: hidden$
|
|
7840
|
+
commandName: CMD_NAME$k,
|
|
7841
|
+
description: description$q,
|
|
7842
|
+
hidden: hidden$k,
|
|
7783
7843
|
flags: {
|
|
7784
7844
|
...flags.commonFlags,
|
|
7785
7845
|
...flags.outputFlags
|
|
@@ -7789,7 +7849,7 @@ async function run$o(argv, importMeta, {
|
|
|
7789
7849
|
$ ${command} [options]
|
|
7790
7850
|
|
|
7791
7851
|
API Token Requirements
|
|
7792
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7852
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$k}`)}
|
|
7793
7853
|
|
|
7794
7854
|
Options
|
|
7795
7855
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7833,9 +7893,9 @@ async function run$o(argv, importMeta, {
|
|
|
7833
7893
|
await handleOrganizationList(outputKind);
|
|
7834
7894
|
}
|
|
7835
7895
|
|
|
7836
|
-
const description$
|
|
7896
|
+
const description$p = 'Organization policy details';
|
|
7837
7897
|
const cmdOrganizationPolicy = {
|
|
7838
|
-
description: description$
|
|
7898
|
+
description: description$p,
|
|
7839
7899
|
// Hidden because it was broken all this time (nobody could be using it)
|
|
7840
7900
|
// and we're not sure if it's useful to anyone in its current state.
|
|
7841
7901
|
// Until we do, we'll hide this to keep the help tidier.
|
|
@@ -7849,7 +7909,7 @@ const cmdOrganizationPolicy = {
|
|
|
7849
7909
|
license: cmdOrganizationPolicyLicense
|
|
7850
7910
|
}, {
|
|
7851
7911
|
argv,
|
|
7852
|
-
description: description$
|
|
7912
|
+
description: description$p,
|
|
7853
7913
|
defaultSub: 'list',
|
|
7854
7914
|
// Backwards compat
|
|
7855
7915
|
importMeta,
|
|
@@ -7926,9 +7986,9 @@ const config$5 = {
|
|
|
7926
7986
|
const cmdOrganizationQuota = {
|
|
7927
7987
|
description: config$5.description,
|
|
7928
7988
|
hidden: config$5.hidden,
|
|
7929
|
-
run: run$
|
|
7989
|
+
run: run$p
|
|
7930
7990
|
};
|
|
7931
|
-
async function run$
|
|
7991
|
+
async function run$p(argv, importMeta, {
|
|
7932
7992
|
parentName
|
|
7933
7993
|
}) {
|
|
7934
7994
|
const cli = utils.meowOrExit({
|
|
@@ -7963,9 +8023,9 @@ async function run$n(argv, importMeta, {
|
|
|
7963
8023
|
await handleQuota(outputKind);
|
|
7964
8024
|
}
|
|
7965
8025
|
|
|
7966
|
-
const description$
|
|
8026
|
+
const description$o = 'Manage Socket organization account details';
|
|
7967
8027
|
const cmdOrganization = {
|
|
7968
|
-
description: description$
|
|
8028
|
+
description: description$o,
|
|
7969
8029
|
hidden: false,
|
|
7970
8030
|
async run(argv, importMeta, {
|
|
7971
8031
|
parentName
|
|
@@ -7994,7 +8054,7 @@ const cmdOrganization = {
|
|
|
7994
8054
|
}
|
|
7995
8055
|
},
|
|
7996
8056
|
argv,
|
|
7997
|
-
description: description$
|
|
8057
|
+
description: description$o,
|
|
7998
8058
|
importMeta,
|
|
7999
8059
|
name: `${parentName} organization`
|
|
8000
8060
|
});
|
|
@@ -8219,21 +8279,21 @@ function parsePackageSpecifiers(ecosystem, pkgs) {
|
|
|
8219
8279
|
};
|
|
8220
8280
|
}
|
|
8221
8281
|
|
|
8222
|
-
const CMD_NAME$
|
|
8223
|
-
const description$
|
|
8224
|
-
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;
|
|
8225
8285
|
const cmdPackageScore = {
|
|
8226
|
-
description: description$
|
|
8227
|
-
hidden: hidden$
|
|
8228
|
-
run: run$
|
|
8286
|
+
description: description$n,
|
|
8287
|
+
hidden: hidden$j,
|
|
8288
|
+
run: run$o
|
|
8229
8289
|
};
|
|
8230
|
-
async function run$
|
|
8290
|
+
async function run$o(argv, importMeta, {
|
|
8231
8291
|
parentName
|
|
8232
8292
|
}) {
|
|
8233
8293
|
const config = {
|
|
8234
|
-
commandName: CMD_NAME$
|
|
8235
|
-
description: description$
|
|
8236
|
-
hidden: hidden$
|
|
8294
|
+
commandName: CMD_NAME$j,
|
|
8295
|
+
description: description$n,
|
|
8296
|
+
hidden: hidden$j,
|
|
8237
8297
|
flags: {
|
|
8238
8298
|
...flags.commonFlags,
|
|
8239
8299
|
...flags.outputFlags
|
|
@@ -8243,7 +8303,7 @@ async function run$m(argv, importMeta, {
|
|
|
8243
8303
|
$ ${command} [options] <<ECOSYSTEM> <NAME> | <PURL>>
|
|
8244
8304
|
|
|
8245
8305
|
API Token Requirements
|
|
8246
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
8306
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$j}`)}
|
|
8247
8307
|
|
|
8248
8308
|
Options
|
|
8249
8309
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -8450,7 +8510,7 @@ function getAlertString(alerts, options) {
|
|
|
8450
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}`)])}`;
|
|
8451
8511
|
}
|
|
8452
8512
|
function preProcess(artifacts, requestedPurls) {
|
|
8453
|
-
// 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
|
|
8454
8514
|
// the same package version with same results. The duplication is irrelevant and annoying to the user.
|
|
8455
8515
|
|
|
8456
8516
|
// Make some effort to match the requested data with the response
|
|
@@ -8601,28 +8661,28 @@ async function handlePurlsShallowScore({
|
|
|
8601
8661
|
outputPurlsShallowScore(purls, packageData, outputKind);
|
|
8602
8662
|
}
|
|
8603
8663
|
|
|
8604
|
-
const CMD_NAME$
|
|
8605
|
-
const description$
|
|
8606
|
-
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;
|
|
8607
8667
|
const cmdPackageShallow = {
|
|
8608
|
-
description: description$
|
|
8609
|
-
hidden: hidden$
|
|
8668
|
+
description: description$m,
|
|
8669
|
+
hidden: hidden$i,
|
|
8610
8670
|
alias: {
|
|
8611
8671
|
shallowScore: {
|
|
8612
|
-
description: description$
|
|
8672
|
+
description: description$m,
|
|
8613
8673
|
hidden: true,
|
|
8614
8674
|
argv: []
|
|
8615
8675
|
}
|
|
8616
8676
|
},
|
|
8617
|
-
run: run$
|
|
8677
|
+
run: run$n
|
|
8618
8678
|
};
|
|
8619
|
-
async function run$
|
|
8679
|
+
async function run$n(argv, importMeta, {
|
|
8620
8680
|
parentName
|
|
8621
8681
|
}) {
|
|
8622
8682
|
const config = {
|
|
8623
|
-
commandName: CMD_NAME$
|
|
8624
|
-
description: description$
|
|
8625
|
-
hidden: hidden$
|
|
8683
|
+
commandName: CMD_NAME$i,
|
|
8684
|
+
description: description$m,
|
|
8685
|
+
hidden: hidden$i,
|
|
8626
8686
|
flags: {
|
|
8627
8687
|
...flags.commonFlags,
|
|
8628
8688
|
...flags.outputFlags
|
|
@@ -8632,7 +8692,7 @@ async function run$l(argv, importMeta, {
|
|
|
8632
8692
|
$ ${command} [options] <<ECOSYSTEM> <PKGNAME> [<PKGNAME> ...] | <PURL> [<PURL> ...]>
|
|
8633
8693
|
|
|
8634
8694
|
API Token Requirements
|
|
8635
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
8695
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$i}`)}
|
|
8636
8696
|
|
|
8637
8697
|
Options
|
|
8638
8698
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -8706,9 +8766,9 @@ async function run$l(argv, importMeta, {
|
|
|
8706
8766
|
});
|
|
8707
8767
|
}
|
|
8708
8768
|
|
|
8709
|
-
const description$
|
|
8769
|
+
const description$l = 'Look up published package details';
|
|
8710
8770
|
const cmdPackage = {
|
|
8711
|
-
description: description$
|
|
8771
|
+
description: description$l,
|
|
8712
8772
|
hidden: false,
|
|
8713
8773
|
async run(argv, importMeta, {
|
|
8714
8774
|
parentName
|
|
@@ -8719,13 +8779,13 @@ const cmdPackage = {
|
|
|
8719
8779
|
}, {
|
|
8720
8780
|
aliases: {
|
|
8721
8781
|
deep: {
|
|
8722
|
-
description: description$
|
|
8782
|
+
description: description$l,
|
|
8723
8783
|
hidden: true,
|
|
8724
8784
|
argv: ['score']
|
|
8725
8785
|
}
|
|
8726
8786
|
},
|
|
8727
8787
|
argv,
|
|
8728
|
-
description: description$
|
|
8788
|
+
description: description$l,
|
|
8729
8789
|
importMeta,
|
|
8730
8790
|
name: `${parentName} package`
|
|
8731
8791
|
});
|
|
@@ -8779,7 +8839,7 @@ async function outputPatchResult(result, outputKind) {
|
|
|
8779
8839
|
}
|
|
8780
8840
|
logger.logger.groupEnd();
|
|
8781
8841
|
} else {
|
|
8782
|
-
logger.logger.warn('No packages found requiring patches');
|
|
8842
|
+
logger.logger.warn('No packages found requiring patches.');
|
|
8783
8843
|
}
|
|
8784
8844
|
logger.logger.log('');
|
|
8785
8845
|
logger.logger.success('Patch command completed!');
|
|
@@ -9095,21 +9155,21 @@ async function handlePatch({
|
|
|
9095
9155
|
}
|
|
9096
9156
|
}
|
|
9097
9157
|
|
|
9098
|
-
const CMD_NAME$
|
|
9099
|
-
const description$
|
|
9100
|
-
const hidden$
|
|
9158
|
+
const CMD_NAME$h = 'patch';
|
|
9159
|
+
const description$k = 'Apply CVE patches to dependencies';
|
|
9160
|
+
const hidden$h = true;
|
|
9101
9161
|
const cmdPatch = {
|
|
9102
|
-
description: description$
|
|
9103
|
-
hidden: hidden$
|
|
9104
|
-
run: run$
|
|
9162
|
+
description: description$k,
|
|
9163
|
+
hidden: hidden$h,
|
|
9164
|
+
run: run$m
|
|
9105
9165
|
};
|
|
9106
|
-
async function run$
|
|
9166
|
+
async function run$m(argv, importMeta, {
|
|
9107
9167
|
parentName
|
|
9108
9168
|
}) {
|
|
9109
9169
|
const config = {
|
|
9110
|
-
commandName: CMD_NAME$
|
|
9111
|
-
description: description$
|
|
9112
|
-
hidden: hidden$
|
|
9170
|
+
commandName: CMD_NAME$h,
|
|
9171
|
+
description: description$k,
|
|
9172
|
+
hidden: hidden$h,
|
|
9113
9173
|
flags: {
|
|
9114
9174
|
...flags.commonFlags,
|
|
9115
9175
|
...flags.outputFlags,
|
|
@@ -9126,7 +9186,7 @@ async function run$k(argv, importMeta, {
|
|
|
9126
9186
|
$ ${command} [options] [CWD=.]
|
|
9127
9187
|
|
|
9128
9188
|
API Token Requirements
|
|
9129
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
9189
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$h}`)}
|
|
9130
9190
|
|
|
9131
9191
|
Options
|
|
9132
9192
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -9186,6 +9246,71 @@ async function run$k(argv, importMeta, {
|
|
|
9186
9246
|
});
|
|
9187
9247
|
}
|
|
9188
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
|
+
|
|
9189
9314
|
async function runRawNpm(argv) {
|
|
9190
9315
|
process.exitCode = 1;
|
|
9191
9316
|
const spawnPromise = spawn.spawn(utils.getNpmBinPath(), argv, {
|
|
@@ -9230,9 +9355,9 @@ const config$4 = {
|
|
|
9230
9355
|
const cmdRawNpm = {
|
|
9231
9356
|
description: config$4.description,
|
|
9232
9357
|
hidden: config$4.hidden,
|
|
9233
|
-
run: run$
|
|
9358
|
+
run: run$k
|
|
9234
9359
|
};
|
|
9235
|
-
async function run$
|
|
9360
|
+
async function run$k(argv, importMeta, {
|
|
9236
9361
|
parentName
|
|
9237
9362
|
}) {
|
|
9238
9363
|
const cli = utils.meowOrExit({
|
|
@@ -9293,9 +9418,9 @@ const config$3 = {
|
|
|
9293
9418
|
const cmdRawNpx = {
|
|
9294
9419
|
description: config$3.description,
|
|
9295
9420
|
hidden: config$3.hidden,
|
|
9296
|
-
run: run$
|
|
9421
|
+
run: run$j
|
|
9297
9422
|
};
|
|
9298
|
-
async function run$
|
|
9423
|
+
async function run$j(argv, importMeta, {
|
|
9299
9424
|
parentName
|
|
9300
9425
|
}) {
|
|
9301
9426
|
const cli = utils.meowOrExit({
|
|
@@ -9380,21 +9505,21 @@ async function handleCreateRepo({
|
|
|
9380
9505
|
outputCreateRepo(data, repoName, outputKind);
|
|
9381
9506
|
}
|
|
9382
9507
|
|
|
9383
|
-
const CMD_NAME$
|
|
9384
|
-
const description$
|
|
9385
|
-
const hidden$
|
|
9508
|
+
const CMD_NAME$f = 'create';
|
|
9509
|
+
const description$i = 'Create a repository in an organization';
|
|
9510
|
+
const hidden$f = false;
|
|
9386
9511
|
const cmdRepositoryCreate = {
|
|
9387
|
-
description: description$
|
|
9388
|
-
hidden: hidden$
|
|
9389
|
-
run: run$
|
|
9512
|
+
description: description$i,
|
|
9513
|
+
hidden: hidden$f,
|
|
9514
|
+
run: run$i
|
|
9390
9515
|
};
|
|
9391
|
-
async function run$
|
|
9516
|
+
async function run$i(argv, importMeta, {
|
|
9392
9517
|
parentName
|
|
9393
9518
|
}) {
|
|
9394
9519
|
const config = {
|
|
9395
|
-
commandName: CMD_NAME$
|
|
9396
|
-
description: description$
|
|
9397
|
-
hidden: hidden$
|
|
9520
|
+
commandName: CMD_NAME$f,
|
|
9521
|
+
description: description$i,
|
|
9522
|
+
hidden: hidden$f,
|
|
9398
9523
|
flags: {
|
|
9399
9524
|
...flags.commonFlags,
|
|
9400
9525
|
...flags.outputFlags,
|
|
@@ -9433,7 +9558,7 @@ async function run$h(argv, importMeta, {
|
|
|
9433
9558
|
$ ${command} [options] <REPO>
|
|
9434
9559
|
|
|
9435
9560
|
API Token Requirements
|
|
9436
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
9561
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$f}`)}
|
|
9437
9562
|
|
|
9438
9563
|
The REPO name should be a "slug". Follows the same naming convention as GitHub.
|
|
9439
9564
|
|
|
@@ -9539,21 +9664,21 @@ async function handleDeleteRepo(orgSlug, repoName, outputKind) {
|
|
|
9539
9664
|
await outputDeleteRepo(data, repoName, outputKind);
|
|
9540
9665
|
}
|
|
9541
9666
|
|
|
9542
|
-
const CMD_NAME$
|
|
9543
|
-
const description$
|
|
9544
|
-
const hidden$
|
|
9667
|
+
const CMD_NAME$e = 'del';
|
|
9668
|
+
const description$h = 'Delete a repository in an organization';
|
|
9669
|
+
const hidden$e = false;
|
|
9545
9670
|
const cmdRepositoryDel = {
|
|
9546
|
-
description: description$
|
|
9547
|
-
hidden: hidden$
|
|
9548
|
-
run: run$
|
|
9671
|
+
description: description$h,
|
|
9672
|
+
hidden: hidden$e,
|
|
9673
|
+
run: run$h
|
|
9549
9674
|
};
|
|
9550
|
-
async function run$
|
|
9675
|
+
async function run$h(argv, importMeta, {
|
|
9551
9676
|
parentName
|
|
9552
9677
|
}) {
|
|
9553
9678
|
const config = {
|
|
9554
|
-
commandName: CMD_NAME$
|
|
9555
|
-
description: description$
|
|
9556
|
-
hidden: hidden$
|
|
9679
|
+
commandName: CMD_NAME$e,
|
|
9680
|
+
description: description$h,
|
|
9681
|
+
hidden: hidden$e,
|
|
9557
9682
|
flags: {
|
|
9558
9683
|
...flags.commonFlags,
|
|
9559
9684
|
...flags.outputFlags,
|
|
@@ -9572,7 +9697,7 @@ async function run$g(argv, importMeta, {
|
|
|
9572
9697
|
$ ${command} [options] <REPO>
|
|
9573
9698
|
|
|
9574
9699
|
API Token Requirements
|
|
9575
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
9700
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$e}`)}
|
|
9576
9701
|
|
|
9577
9702
|
Options
|
|
9578
9703
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -9802,21 +9927,21 @@ async function handleListRepos({
|
|
|
9802
9927
|
}
|
|
9803
9928
|
}
|
|
9804
9929
|
|
|
9805
|
-
const CMD_NAME$
|
|
9806
|
-
const description$
|
|
9807
|
-
const hidden$
|
|
9930
|
+
const CMD_NAME$d = 'list';
|
|
9931
|
+
const description$g = 'List repositories in an organization';
|
|
9932
|
+
const hidden$d = false;
|
|
9808
9933
|
const cmdRepositoryList = {
|
|
9809
|
-
description: description$
|
|
9810
|
-
hidden: hidden$
|
|
9811
|
-
run: run$
|
|
9934
|
+
description: description$g,
|
|
9935
|
+
hidden: hidden$d,
|
|
9936
|
+
run: run$g
|
|
9812
9937
|
};
|
|
9813
|
-
async function run$
|
|
9938
|
+
async function run$g(argv, importMeta, {
|
|
9814
9939
|
parentName
|
|
9815
9940
|
}) {
|
|
9816
9941
|
const config = {
|
|
9817
|
-
commandName: CMD_NAME$
|
|
9818
|
-
description: description$
|
|
9819
|
-
hidden: hidden$
|
|
9942
|
+
commandName: CMD_NAME$d,
|
|
9943
|
+
description: description$g,
|
|
9944
|
+
hidden: hidden$d,
|
|
9820
9945
|
flags: {
|
|
9821
9946
|
...flags.commonFlags,
|
|
9822
9947
|
...flags.outputFlags,
|
|
@@ -9837,25 +9962,26 @@ async function run$f(argv, importMeta, {
|
|
|
9837
9962
|
},
|
|
9838
9963
|
org: {
|
|
9839
9964
|
type: 'string',
|
|
9965
|
+
default: '',
|
|
9840
9966
|
description: 'Force override the organization slug, overrides the default org from config'
|
|
9841
9967
|
},
|
|
9842
9968
|
perPage: {
|
|
9843
9969
|
type: 'number',
|
|
9844
|
-
shortFlag: 'pp',
|
|
9845
9970
|
default: 30,
|
|
9846
|
-
description: 'Number of results per page'
|
|
9971
|
+
description: 'Number of results per page',
|
|
9972
|
+
shortFlag: 'pp'
|
|
9847
9973
|
},
|
|
9848
9974
|
page: {
|
|
9849
9975
|
type: 'number',
|
|
9850
|
-
shortFlag: 'p',
|
|
9851
9976
|
default: 1,
|
|
9852
|
-
description: 'Page number'
|
|
9977
|
+
description: 'Page number',
|
|
9978
|
+
shortFlag: 'p'
|
|
9853
9979
|
},
|
|
9854
9980
|
sort: {
|
|
9855
9981
|
type: 'string',
|
|
9856
|
-
shortFlag: 's',
|
|
9857
9982
|
default: 'created_at',
|
|
9858
|
-
description: 'Sorting option'
|
|
9983
|
+
description: 'Sorting option',
|
|
9984
|
+
shortFlag: 's'
|
|
9859
9985
|
}
|
|
9860
9986
|
},
|
|
9861
9987
|
help: (command, config) => `
|
|
@@ -9863,7 +9989,7 @@ async function run$f(argv, importMeta, {
|
|
|
9863
9989
|
$ ${command} [options]
|
|
9864
9990
|
|
|
9865
9991
|
API Token Requirements
|
|
9866
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
9992
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$d}`)}
|
|
9867
9993
|
|
|
9868
9994
|
Options
|
|
9869
9995
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -9882,16 +10008,19 @@ async function run$f(argv, importMeta, {
|
|
|
9882
10008
|
const {
|
|
9883
10009
|
all,
|
|
9884
10010
|
direction = 'desc',
|
|
10011
|
+
dryRun,
|
|
10012
|
+
interactive,
|
|
9885
10013
|
json,
|
|
9886
10014
|
markdown,
|
|
9887
|
-
org: orgFlag
|
|
10015
|
+
org: orgFlag,
|
|
10016
|
+
page,
|
|
10017
|
+
perPage,
|
|
10018
|
+
sort
|
|
9888
10019
|
} = cli.flags;
|
|
9889
|
-
const dryRun = !!cli.flags['dryRun'];
|
|
9890
|
-
const interactive = !!cli.flags['interactive'];
|
|
9891
10020
|
const hasApiToken = utils.hasDefaultApiToken();
|
|
9892
10021
|
const {
|
|
9893
10022
|
0: orgSlug
|
|
9894
|
-
} = await utils.determineOrgSlug(
|
|
10023
|
+
} = await utils.determineOrgSlug(orgFlag, interactive, dryRun);
|
|
9895
10024
|
const outputKind = utils.getOutputKind(json, markdown);
|
|
9896
10025
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
9897
10026
|
nook: true,
|
|
@@ -9922,13 +10051,13 @@ async function run$f(argv, importMeta, {
|
|
|
9922
10051
|
return;
|
|
9923
10052
|
}
|
|
9924
10053
|
await handleListRepos({
|
|
9925
|
-
all
|
|
9926
|
-
direction
|
|
10054
|
+
all,
|
|
10055
|
+
direction,
|
|
9927
10056
|
orgSlug,
|
|
9928
10057
|
outputKind,
|
|
9929
|
-
page
|
|
9930
|
-
perPage
|
|
9931
|
-
sort
|
|
10058
|
+
page,
|
|
10059
|
+
perPage,
|
|
10060
|
+
sort
|
|
9932
10061
|
});
|
|
9933
10062
|
}
|
|
9934
10063
|
|
|
@@ -10001,21 +10130,21 @@ async function handleUpdateRepo({
|
|
|
10001
10130
|
await outputUpdateRepo(data, repoName, outputKind);
|
|
10002
10131
|
}
|
|
10003
10132
|
|
|
10004
|
-
const CMD_NAME$
|
|
10005
|
-
const description$
|
|
10006
|
-
const hidden$
|
|
10133
|
+
const CMD_NAME$c = 'update';
|
|
10134
|
+
const description$f = 'Update a repository in an organization';
|
|
10135
|
+
const hidden$c = false;
|
|
10007
10136
|
const cmdRepositoryUpdate = {
|
|
10008
|
-
description: description$
|
|
10009
|
-
hidden: hidden$
|
|
10010
|
-
run: run$
|
|
10137
|
+
description: description$f,
|
|
10138
|
+
hidden: hidden$c,
|
|
10139
|
+
run: run$f
|
|
10011
10140
|
};
|
|
10012
|
-
async function run$
|
|
10141
|
+
async function run$f(argv, importMeta, {
|
|
10013
10142
|
parentName
|
|
10014
10143
|
}) {
|
|
10015
10144
|
const config = {
|
|
10016
|
-
commandName: CMD_NAME$
|
|
10017
|
-
description: description$
|
|
10018
|
-
hidden: hidden$
|
|
10145
|
+
commandName: CMD_NAME$c,
|
|
10146
|
+
description: description$f,
|
|
10147
|
+
hidden: hidden$c,
|
|
10019
10148
|
flags: {
|
|
10020
10149
|
...flags.commonFlags,
|
|
10021
10150
|
...flags.outputFlags,
|
|
@@ -10058,7 +10187,7 @@ async function run$e(argv, importMeta, {
|
|
|
10058
10187
|
$ ${command} [options] <REPO>
|
|
10059
10188
|
|
|
10060
10189
|
API Token Requirements
|
|
10061
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
10190
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$c}`)}
|
|
10062
10191
|
|
|
10063
10192
|
Options
|
|
10064
10193
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -10187,21 +10316,21 @@ async function handleViewRepo(orgSlug, repoName, outputKind) {
|
|
|
10187
10316
|
await outputViewRepo(data, outputKind);
|
|
10188
10317
|
}
|
|
10189
10318
|
|
|
10190
|
-
const CMD_NAME$
|
|
10191
|
-
const description$
|
|
10192
|
-
const hidden$
|
|
10319
|
+
const CMD_NAME$b = 'view';
|
|
10320
|
+
const description$e = 'View repositories in an organization';
|
|
10321
|
+
const hidden$b = false;
|
|
10193
10322
|
const cmdRepositoryView = {
|
|
10194
|
-
description: description$
|
|
10195
|
-
hidden: hidden$
|
|
10196
|
-
run: run$
|
|
10323
|
+
description: description$e,
|
|
10324
|
+
hidden: hidden$b,
|
|
10325
|
+
run: run$e
|
|
10197
10326
|
};
|
|
10198
|
-
async function run$
|
|
10327
|
+
async function run$e(argv, importMeta, {
|
|
10199
10328
|
parentName
|
|
10200
10329
|
}) {
|
|
10201
10330
|
const config = {
|
|
10202
|
-
commandName: CMD_NAME$
|
|
10203
|
-
description: description$
|
|
10204
|
-
hidden: hidden$
|
|
10331
|
+
commandName: CMD_NAME$b,
|
|
10332
|
+
description: description$e,
|
|
10333
|
+
hidden: hidden$b,
|
|
10205
10334
|
flags: {
|
|
10206
10335
|
...flags.commonFlags,
|
|
10207
10336
|
...flags.outputFlags,
|
|
@@ -10220,7 +10349,7 @@ async function run$d(argv, importMeta, {
|
|
|
10220
10349
|
$ ${command} [options] <REPO>
|
|
10221
10350
|
|
|
10222
10351
|
API Token Requirements
|
|
10223
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
10352
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$b}`)}
|
|
10224
10353
|
|
|
10225
10354
|
Options
|
|
10226
10355
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -10285,9 +10414,9 @@ async function run$d(argv, importMeta, {
|
|
|
10285
10414
|
await handleViewRepo(orgSlug, String(repoName), outputKind);
|
|
10286
10415
|
}
|
|
10287
10416
|
|
|
10288
|
-
const description$
|
|
10417
|
+
const description$d = 'Manage registered repositories';
|
|
10289
10418
|
const cmdRepository = {
|
|
10290
|
-
description: description$
|
|
10419
|
+
description: description$d,
|
|
10291
10420
|
async run(argv, importMeta, {
|
|
10292
10421
|
parentName
|
|
10293
10422
|
}) {
|
|
@@ -10299,7 +10428,7 @@ const cmdRepository = {
|
|
|
10299
10428
|
update: cmdRepositoryUpdate
|
|
10300
10429
|
}, {
|
|
10301
10430
|
argv,
|
|
10302
|
-
description: description$
|
|
10431
|
+
description: description$d,
|
|
10303
10432
|
importMeta,
|
|
10304
10433
|
name: `${parentName} repository`
|
|
10305
10434
|
});
|
|
@@ -10357,9 +10486,9 @@ async function suggestTarget() {
|
|
|
10357
10486
|
return proceed ? ['.'] : [];
|
|
10358
10487
|
}
|
|
10359
10488
|
|
|
10360
|
-
const CMD_NAME$
|
|
10361
|
-
const description$
|
|
10362
|
-
const hidden$
|
|
10489
|
+
const CMD_NAME$a = 'create';
|
|
10490
|
+
const description$c = 'Create a new Socket scan and report';
|
|
10491
|
+
const hidden$a = false;
|
|
10363
10492
|
const generalFlags$1 = {
|
|
10364
10493
|
...flags.commonFlags,
|
|
10365
10494
|
...flags.outputFlags,
|
|
@@ -10455,17 +10584,17 @@ const generalFlags$1 = {
|
|
|
10455
10584
|
}
|
|
10456
10585
|
};
|
|
10457
10586
|
const cmdScanCreate = {
|
|
10458
|
-
description: description$
|
|
10459
|
-
hidden: hidden$
|
|
10460
|
-
run: run$
|
|
10587
|
+
description: description$c,
|
|
10588
|
+
hidden: hidden$a,
|
|
10589
|
+
run: run$d
|
|
10461
10590
|
};
|
|
10462
|
-
async function run$
|
|
10591
|
+
async function run$d(argv, importMeta, {
|
|
10463
10592
|
parentName
|
|
10464
10593
|
}) {
|
|
10465
10594
|
const config = {
|
|
10466
|
-
commandName: CMD_NAME$
|
|
10467
|
-
description: description$
|
|
10468
|
-
hidden: hidden$
|
|
10595
|
+
commandName: CMD_NAME$a,
|
|
10596
|
+
description: description$c,
|
|
10597
|
+
hidden: hidden$a,
|
|
10469
10598
|
flags: {
|
|
10470
10599
|
...generalFlags$1,
|
|
10471
10600
|
...reachabilityFlags
|
|
@@ -10476,7 +10605,7 @@ async function run$c(argv, importMeta, {
|
|
|
10476
10605
|
$ ${command} [options] [TARGET...]
|
|
10477
10606
|
|
|
10478
10607
|
API Token Requirements
|
|
10479
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
10608
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$a}`)}
|
|
10480
10609
|
|
|
10481
10610
|
Options
|
|
10482
10611
|
${utils.getFlagListOutput(generalFlags$1)}
|
|
@@ -10485,7 +10614,7 @@ async function run$c(argv, importMeta, {
|
|
|
10485
10614
|
${utils.getFlagListOutput(reachabilityFlags)}
|
|
10486
10615
|
|
|
10487
10616
|
Uploads the specified dependency manifest files for Go, Gradle, JavaScript,
|
|
10488
|
-
Kotlin, Python, and Scala. Files like "package.json" and "
|
|
10617
|
+
Kotlin, Python, and Scala. Files like "package.json" and "${constants.REQUIREMENTS_TXT}".
|
|
10489
10618
|
If any folder is specified, the ones found in there recursively are uploaded.
|
|
10490
10619
|
|
|
10491
10620
|
Details on TARGET:
|
|
@@ -10495,7 +10624,7 @@ async function run$c(argv, importMeta, {
|
|
|
10495
10624
|
- If a target is a file, only that file is checked
|
|
10496
10625
|
- If it is a dir, the dir is scanned for any supported manifest files
|
|
10497
10626
|
- Dirs MUST be within the current dir (cwd), you can use --cwd to change it
|
|
10498
|
-
- Supports globbing such as "**/package.json", "
|
|
10627
|
+
- Supports globbing such as "**/package.json", "**/${constants.REQUIREMENTS_TXT}", etc.
|
|
10499
10628
|
- Ignores any file specified in your project's ".gitignore"
|
|
10500
10629
|
- Also a sensible set of default ignores from the "ignore-by-default" module
|
|
10501
10630
|
|
|
@@ -10570,13 +10699,13 @@ async function run$c(argv, importMeta, {
|
|
|
10570
10699
|
} = await utils.determineOrgSlug(String(orgFlag || ''), interactive, dryRun);
|
|
10571
10700
|
const processCwd = process.cwd();
|
|
10572
10701
|
const cwd = cwdOverride && cwdOverride !== '.' && cwdOverride !== processCwd ? path.resolve(processCwd, cwdOverride) : processCwd;
|
|
10573
|
-
const sockJson = utils.
|
|
10702
|
+
const sockJson = await utils.readOrDefaultSocketJsonUp(cwd);
|
|
10574
10703
|
|
|
10575
10704
|
// Note: This needs meow booleanDefault=undefined.
|
|
10576
10705
|
if (typeof autoManifest !== 'boolean') {
|
|
10577
10706
|
if (sockJson.defaults?.scan?.create?.autoManifest !== undefined) {
|
|
10578
10707
|
autoManifest = sockJson.defaults.scan.create.autoManifest;
|
|
10579
|
-
logger.logger.info(
|
|
10708
|
+
logger.logger.info(`Using default --auto-manifest from ${constants.SOCKET_JSON}:`, autoManifest);
|
|
10580
10709
|
} else {
|
|
10581
10710
|
autoManifest = false;
|
|
10582
10711
|
}
|
|
@@ -10584,7 +10713,7 @@ async function run$c(argv, importMeta, {
|
|
|
10584
10713
|
if (!branchName) {
|
|
10585
10714
|
if (sockJson.defaults?.scan?.create?.branch) {
|
|
10586
10715
|
branchName = sockJson.defaults.scan.create.branch;
|
|
10587
|
-
logger.logger.info(
|
|
10716
|
+
logger.logger.info(`Using default --branch from ${constants.SOCKET_JSON}:`, branchName);
|
|
10588
10717
|
} else {
|
|
10589
10718
|
branchName = (await utils.gitBranch(cwd)) || (await utils.detectDefaultBranch(cwd));
|
|
10590
10719
|
}
|
|
@@ -10592,7 +10721,7 @@ async function run$c(argv, importMeta, {
|
|
|
10592
10721
|
if (!repoName) {
|
|
10593
10722
|
if (sockJson.defaults?.scan?.create?.repo) {
|
|
10594
10723
|
repoName = sockJson.defaults.scan.create.repo;
|
|
10595
|
-
logger.logger.info(
|
|
10724
|
+
logger.logger.info(`Using default --repo from ${constants.SOCKET_JSON}:`, repoName);
|
|
10596
10725
|
} else {
|
|
10597
10726
|
repoName = await utils.getRepoName(cwd);
|
|
10598
10727
|
}
|
|
@@ -10600,7 +10729,7 @@ async function run$c(argv, importMeta, {
|
|
|
10600
10729
|
if (typeof report !== 'boolean') {
|
|
10601
10730
|
if (sockJson.defaults?.scan?.create?.report !== undefined) {
|
|
10602
10731
|
report = sockJson.defaults.scan.create.report;
|
|
10603
|
-
logger.logger.info(
|
|
10732
|
+
logger.logger.info(`Using default --report from ${constants.SOCKET_JSON}:`, report);
|
|
10604
10733
|
} else {
|
|
10605
10734
|
report = false;
|
|
10606
10735
|
}
|
|
@@ -10657,7 +10786,7 @@ async function run$c(argv, importMeta, {
|
|
|
10657
10786
|
logger.logger.error(` socket scan create [other flags...] ${orgSlug} ${targets.join(' ')}`);
|
|
10658
10787
|
logger.logger.error('```');
|
|
10659
10788
|
logger.logger.error('');
|
|
10660
|
-
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.`);
|
|
10661
10790
|
logger.logger.error('');
|
|
10662
10791
|
}
|
|
10663
10792
|
const reachExcludePaths = utils.cmdFlagValueToArray(cli.flags['reachExcludePaths']);
|
|
@@ -10779,21 +10908,21 @@ async function handleDeleteScan(orgSlug, scanId, outputKind) {
|
|
|
10779
10908
|
await outputDeleteScan(data, outputKind);
|
|
10780
10909
|
}
|
|
10781
10910
|
|
|
10782
|
-
const CMD_NAME$
|
|
10783
|
-
const description$
|
|
10784
|
-
const hidden$
|
|
10911
|
+
const CMD_NAME$9 = 'del';
|
|
10912
|
+
const description$b = 'Delete a scan';
|
|
10913
|
+
const hidden$9 = false;
|
|
10785
10914
|
const cmdScanDel = {
|
|
10786
|
-
description: description$
|
|
10787
|
-
hidden: hidden$
|
|
10788
|
-
run: run$
|
|
10915
|
+
description: description$b,
|
|
10916
|
+
hidden: hidden$9,
|
|
10917
|
+
run: run$c
|
|
10789
10918
|
};
|
|
10790
|
-
async function run$
|
|
10919
|
+
async function run$c(argv, importMeta, {
|
|
10791
10920
|
parentName
|
|
10792
10921
|
}) {
|
|
10793
10922
|
const config = {
|
|
10794
|
-
commandName: CMD_NAME$
|
|
10795
|
-
description: description$
|
|
10796
|
-
hidden: hidden$
|
|
10923
|
+
commandName: CMD_NAME$9,
|
|
10924
|
+
description: description$b,
|
|
10925
|
+
hidden: hidden$9,
|
|
10797
10926
|
flags: {
|
|
10798
10927
|
...flags.commonFlags,
|
|
10799
10928
|
...flags.outputFlags,
|
|
@@ -10812,7 +10941,7 @@ async function run$b(argv, importMeta, {
|
|
|
10812
10941
|
$ ${command} [options] <SCAN_ID>
|
|
10813
10942
|
|
|
10814
10943
|
API Token Requirements
|
|
10815
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
10944
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$9}`)}
|
|
10816
10945
|
|
|
10817
10946
|
Options
|
|
10818
10947
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -11056,21 +11185,21 @@ async function handleDiffScan({
|
|
|
11056
11185
|
});
|
|
11057
11186
|
}
|
|
11058
11187
|
|
|
11059
|
-
const CMD_NAME$
|
|
11060
|
-
const description$
|
|
11061
|
-
const hidden$
|
|
11188
|
+
const CMD_NAME$8 = 'diff';
|
|
11189
|
+
const description$a = 'See what changed between two Scans';
|
|
11190
|
+
const hidden$8 = false;
|
|
11062
11191
|
const cmdScanDiff = {
|
|
11063
|
-
description: description$
|
|
11064
|
-
hidden: hidden$
|
|
11065
|
-
run: run$
|
|
11192
|
+
description: description$a,
|
|
11193
|
+
hidden: hidden$8,
|
|
11194
|
+
run: run$b
|
|
11066
11195
|
};
|
|
11067
|
-
async function run$
|
|
11196
|
+
async function run$b(argv, importMeta, {
|
|
11068
11197
|
parentName
|
|
11069
11198
|
}) {
|
|
11070
11199
|
const config = {
|
|
11071
|
-
commandName: CMD_NAME$
|
|
11072
|
-
description: description$
|
|
11073
|
-
hidden: hidden$
|
|
11200
|
+
commandName: CMD_NAME$8,
|
|
11201
|
+
description: description$a,
|
|
11202
|
+
hidden: hidden$8,
|
|
11074
11203
|
flags: {
|
|
11075
11204
|
...flags.commonFlags,
|
|
11076
11205
|
...flags.outputFlags,
|
|
@@ -11100,7 +11229,7 @@ async function run$a(argv, importMeta, {
|
|
|
11100
11229
|
$ ${command} [options] <SCAN_ID1> <SCAN_ID2>
|
|
11101
11230
|
|
|
11102
11231
|
API Token Requirements
|
|
11103
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
11232
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$8}`)}
|
|
11104
11233
|
|
|
11105
11234
|
This command displays the package changes between two scans. The full output
|
|
11106
11235
|
can be pretty large depending on the size of your repo and time range. It is
|
|
@@ -11128,12 +11257,12 @@ async function run$a(argv, importMeta, {
|
|
|
11128
11257
|
const SOCKET_SBOM_URL_PREFIX_LENGTH = SOCKET_SBOM_URL_PREFIX.length;
|
|
11129
11258
|
const {
|
|
11130
11259
|
depth,
|
|
11260
|
+
dryRun,
|
|
11131
11261
|
file,
|
|
11132
11262
|
json,
|
|
11133
11263
|
markdown,
|
|
11134
11264
|
org: orgFlag
|
|
11135
11265
|
} = cli.flags;
|
|
11136
|
-
const dryRun = !!cli.flags['dryRun'];
|
|
11137
11266
|
const interactive = !!cli.flags['interactive'];
|
|
11138
11267
|
let [id1 = '', id2 = ''] = cli.input;
|
|
11139
11268
|
// Support dropping in full socket urls to an sbom.
|
|
@@ -11176,12 +11305,12 @@ async function run$a(argv, importMeta, {
|
|
|
11176
11305
|
return;
|
|
11177
11306
|
}
|
|
11178
11307
|
await handleDiffScan({
|
|
11179
|
-
id1
|
|
11180
|
-
id2
|
|
11181
|
-
depth
|
|
11308
|
+
id1,
|
|
11309
|
+
id2,
|
|
11310
|
+
depth,
|
|
11182
11311
|
orgSlug,
|
|
11183
11312
|
outputKind,
|
|
11184
|
-
file
|
|
11313
|
+
file
|
|
11185
11314
|
});
|
|
11186
11315
|
}
|
|
11187
11316
|
|
|
@@ -11844,22 +11973,22 @@ async function handleCreateGithubScan({
|
|
|
11844
11973
|
await outputScanGithub(ghScanCResult, outputKind);
|
|
11845
11974
|
}
|
|
11846
11975
|
|
|
11847
|
-
const CMD_NAME$
|
|
11976
|
+
const CMD_NAME$7 = 'github';
|
|
11848
11977
|
const DEFAULT_GITHUB_URL = 'https://api.github.com';
|
|
11849
|
-
const description$
|
|
11850
|
-
const hidden$
|
|
11978
|
+
const description$9 = 'Create a scan for given GitHub repo';
|
|
11979
|
+
const hidden$7 = true;
|
|
11851
11980
|
const cmdScanGithub = {
|
|
11852
|
-
description: description$
|
|
11853
|
-
hidden: hidden$
|
|
11854
|
-
run: run$
|
|
11981
|
+
description: description$9,
|
|
11982
|
+
hidden: hidden$7,
|
|
11983
|
+
run: run$a
|
|
11855
11984
|
};
|
|
11856
|
-
async function run$
|
|
11985
|
+
async function run$a(argv, importMeta, {
|
|
11857
11986
|
parentName
|
|
11858
11987
|
}) {
|
|
11859
11988
|
const config = {
|
|
11860
|
-
commandName: CMD_NAME$
|
|
11861
|
-
description: description$
|
|
11862
|
-
hidden: hidden$
|
|
11989
|
+
commandName: CMD_NAME$7,
|
|
11990
|
+
description: description$9,
|
|
11991
|
+
hidden: hidden$7,
|
|
11863
11992
|
flags: {
|
|
11864
11993
|
...flags.commonFlags,
|
|
11865
11994
|
...flags.outputFlags,
|
|
@@ -11903,7 +12032,7 @@ async function run$9(argv, importMeta, {
|
|
|
11903
12032
|
$ ${command} [options] [CWD=.]
|
|
11904
12033
|
|
|
11905
12034
|
API Token Requirements
|
|
11906
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12035
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$7}`)}
|
|
11907
12036
|
|
|
11908
12037
|
This is similar to the \`socket scan create\` command except it pulls the files
|
|
11909
12038
|
from GitHub. See the help for that command for more details.
|
|
@@ -12160,21 +12289,21 @@ async function handleListScans({
|
|
|
12160
12289
|
await outputListScans(data, outputKind);
|
|
12161
12290
|
}
|
|
12162
12291
|
|
|
12163
|
-
const CMD_NAME$
|
|
12164
|
-
const description$
|
|
12165
|
-
const hidden$
|
|
12292
|
+
const CMD_NAME$6 = 'list';
|
|
12293
|
+
const description$8 = 'List the scans for an organization';
|
|
12294
|
+
const hidden$6 = false;
|
|
12166
12295
|
const cmdScanList = {
|
|
12167
|
-
description: description$
|
|
12168
|
-
hidden: hidden$
|
|
12169
|
-
run: run$
|
|
12296
|
+
description: description$8,
|
|
12297
|
+
hidden: hidden$6,
|
|
12298
|
+
run: run$9
|
|
12170
12299
|
};
|
|
12171
|
-
async function run$
|
|
12300
|
+
async function run$9(argv, importMeta, {
|
|
12172
12301
|
parentName
|
|
12173
12302
|
}) {
|
|
12174
12303
|
const config = {
|
|
12175
|
-
commandName: CMD_NAME$
|
|
12176
|
-
description: description$
|
|
12177
|
-
hidden: hidden$
|
|
12304
|
+
commandName: CMD_NAME$6,
|
|
12305
|
+
description: description$8,
|
|
12306
|
+
hidden: hidden$6,
|
|
12178
12307
|
flags: {
|
|
12179
12308
|
...flags.commonFlags,
|
|
12180
12309
|
...flags.outputFlags,
|
|
@@ -12233,7 +12362,7 @@ async function run$8(argv, importMeta, {
|
|
|
12233
12362
|
$ ${command} [options] [REPO [BRANCH]]
|
|
12234
12363
|
|
|
12235
12364
|
API Token Requirements
|
|
12236
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12365
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$6}`)}
|
|
12237
12366
|
|
|
12238
12367
|
Optionally filter by REPO. If you specify a repo, you can also specify a
|
|
12239
12368
|
branch to filter by. (Note: If you don't specify a repo then you must use
|
|
@@ -12369,21 +12498,21 @@ async function handleOrgScanMetadata(orgSlug, scanId, outputKind) {
|
|
|
12369
12498
|
await outputScanMetadata(data, scanId, outputKind);
|
|
12370
12499
|
}
|
|
12371
12500
|
|
|
12372
|
-
const CMD_NAME$
|
|
12373
|
-
const description$
|
|
12374
|
-
const hidden$
|
|
12501
|
+
const CMD_NAME$5 = 'metadata';
|
|
12502
|
+
const description$7 = "Get a scan's metadata";
|
|
12503
|
+
const hidden$5 = false;
|
|
12375
12504
|
const cmdScanMetadata = {
|
|
12376
|
-
description: description$
|
|
12377
|
-
hidden: hidden$
|
|
12378
|
-
run: run$
|
|
12505
|
+
description: description$7,
|
|
12506
|
+
hidden: hidden$5,
|
|
12507
|
+
run: run$8
|
|
12379
12508
|
};
|
|
12380
|
-
async function run$
|
|
12509
|
+
async function run$8(argv, importMeta, {
|
|
12381
12510
|
parentName
|
|
12382
12511
|
}) {
|
|
12383
12512
|
const config = {
|
|
12384
|
-
commandName: CMD_NAME$
|
|
12385
|
-
description: description$
|
|
12386
|
-
hidden: hidden$
|
|
12513
|
+
commandName: CMD_NAME$5,
|
|
12514
|
+
description: description$7,
|
|
12515
|
+
hidden: hidden$5,
|
|
12387
12516
|
flags: {
|
|
12388
12517
|
...flags.commonFlags,
|
|
12389
12518
|
...flags.outputFlags,
|
|
@@ -12402,7 +12531,7 @@ async function run$7(argv, importMeta, {
|
|
|
12402
12531
|
$ ${command} [options] <SCAN_ID>
|
|
12403
12532
|
|
|
12404
12533
|
API Token Requirements
|
|
12405
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12534
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$5}`)}
|
|
12406
12535
|
|
|
12407
12536
|
Options
|
|
12408
12537
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -12536,9 +12665,9 @@ async function handleScanReach({
|
|
|
12536
12665
|
});
|
|
12537
12666
|
}
|
|
12538
12667
|
|
|
12539
|
-
const CMD_NAME$
|
|
12540
|
-
const description$
|
|
12541
|
-
const hidden$
|
|
12668
|
+
const CMD_NAME$4 = 'reach';
|
|
12669
|
+
const description$6 = 'Compute tier 1 reachability';
|
|
12670
|
+
const hidden$4 = true;
|
|
12542
12671
|
const generalFlags = {
|
|
12543
12672
|
...flags.commonFlags,
|
|
12544
12673
|
...flags.outputFlags,
|
|
@@ -12554,17 +12683,17 @@ const generalFlags = {
|
|
|
12554
12683
|
}
|
|
12555
12684
|
};
|
|
12556
12685
|
const cmdScanReach = {
|
|
12557
|
-
description: description$
|
|
12558
|
-
hidden: hidden$
|
|
12559
|
-
run: run$
|
|
12686
|
+
description: description$6,
|
|
12687
|
+
hidden: hidden$4,
|
|
12688
|
+
run: run$7
|
|
12560
12689
|
};
|
|
12561
|
-
async function run$
|
|
12690
|
+
async function run$7(argv, importMeta, {
|
|
12562
12691
|
parentName
|
|
12563
12692
|
}) {
|
|
12564
12693
|
const config = {
|
|
12565
|
-
commandName: CMD_NAME$
|
|
12566
|
-
description: description$
|
|
12567
|
-
hidden: hidden$
|
|
12694
|
+
commandName: CMD_NAME$4,
|
|
12695
|
+
description: description$6,
|
|
12696
|
+
hidden: hidden$4,
|
|
12568
12697
|
flags: {
|
|
12569
12698
|
...generalFlags,
|
|
12570
12699
|
...reachabilityFlags
|
|
@@ -12574,7 +12703,7 @@ async function run$6(argv, importMeta, {
|
|
|
12574
12703
|
$ ${command} [options] [CWD=.]
|
|
12575
12704
|
|
|
12576
12705
|
API Token Requirements
|
|
12577
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12706
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$4}`)}
|
|
12578
12707
|
|
|
12579
12708
|
Options
|
|
12580
12709
|
${utils.getFlagListOutput(generalFlags)}
|
|
@@ -12682,21 +12811,21 @@ async function run$6(argv, importMeta, {
|
|
|
12682
12811
|
});
|
|
12683
12812
|
}
|
|
12684
12813
|
|
|
12685
|
-
const CMD_NAME$
|
|
12686
|
-
const description$
|
|
12687
|
-
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;
|
|
12688
12817
|
const cmdScanReport = {
|
|
12689
|
-
description: description$
|
|
12690
|
-
hidden: hidden$
|
|
12691
|
-
run: run$
|
|
12818
|
+
description: description$5,
|
|
12819
|
+
hidden: hidden$3,
|
|
12820
|
+
run: run$6
|
|
12692
12821
|
};
|
|
12693
|
-
async function run$
|
|
12822
|
+
async function run$6(argv, importMeta, {
|
|
12694
12823
|
parentName
|
|
12695
12824
|
}) {
|
|
12696
12825
|
const config = {
|
|
12697
|
-
commandName: CMD_NAME$
|
|
12698
|
-
description: description$
|
|
12699
|
-
hidden: hidden$
|
|
12826
|
+
commandName: CMD_NAME$3,
|
|
12827
|
+
description: description$5,
|
|
12828
|
+
hidden: hidden$3,
|
|
12700
12829
|
flags: {
|
|
12701
12830
|
...flags.commonFlags,
|
|
12702
12831
|
...flags.outputFlags,
|
|
@@ -12735,7 +12864,7 @@ async function run$5(argv, importMeta, {
|
|
|
12735
12864
|
$ ${command} [options] <SCAN_ID> [OUTPUT_PATH]
|
|
12736
12865
|
|
|
12737
12866
|
API Token Requirements
|
|
12738
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12867
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$3}`)}
|
|
12739
12868
|
|
|
12740
12869
|
Options
|
|
12741
12870
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -12846,18 +12975,18 @@ async function outputScanConfigResult(result) {
|
|
|
12846
12975
|
}
|
|
12847
12976
|
|
|
12848
12977
|
async function setupScanConfig(cwd, defaultOnReadError = false) {
|
|
12849
|
-
const jsonPath = path.join(cwd,
|
|
12978
|
+
const jsonPath = path.join(cwd, constants.SOCKET_JSON);
|
|
12850
12979
|
if (fs$1.existsSync(jsonPath)) {
|
|
12851
|
-
logger.logger.info(`Found
|
|
12980
|
+
logger.logger.info(`Found ${constants.SOCKET_JSON} at ${jsonPath}`);
|
|
12852
12981
|
} else {
|
|
12853
|
-
logger.logger.info(`No
|
|
12982
|
+
logger.logger.info(`No ${constants.SOCKET_JSON} found at ${cwd}, will generate a new one`);
|
|
12854
12983
|
}
|
|
12855
12984
|
logger.logger.log('');
|
|
12856
12985
|
logger.logger.log('Note: This tool will set up flag and argument defaults for certain');
|
|
12857
12986
|
logger.logger.log(' CLI commands. You can still override them by explicitly');
|
|
12858
12987
|
logger.logger.log(' setting the flag. It is meant to be a convenience tool.');
|
|
12859
12988
|
logger.logger.log('');
|
|
12860
|
-
logger.logger.log(
|
|
12989
|
+
logger.logger.log(`This command will generate a \`${constants.SOCKET_JSON}\` file in the target cwd.`);
|
|
12861
12990
|
logger.logger.log('You can choose to add this file to your repo (handy for collab)');
|
|
12862
12991
|
logger.logger.log('or to add it to the ignored files, or neither. This file is only');
|
|
12863
12992
|
logger.logger.log('used in CLI workflows.');
|
|
@@ -12918,7 +13047,7 @@ async function setupScanConfig(cwd, defaultOnReadError = false) {
|
|
|
12918
13047
|
}
|
|
12919
13048
|
}
|
|
12920
13049
|
logger.logger.log('');
|
|
12921
|
-
logger.logger.log(
|
|
13050
|
+
logger.logger.log(`Setup complete. Writing ${constants.SOCKET_JSON}`);
|
|
12922
13051
|
logger.logger.log('');
|
|
12923
13052
|
if (await prompts.select({
|
|
12924
13053
|
message: `Do you want to write the new config to ${jsonPath} ?`,
|
|
@@ -13134,7 +13263,7 @@ const config$2 = {
|
|
|
13134
13263
|
...flags.commonFlags,
|
|
13135
13264
|
defaultOnReadError: {
|
|
13136
13265
|
type: 'boolean',
|
|
13137
|
-
description:
|
|
13266
|
+
description: `If reading the ${constants.SOCKET_JSON} fails, just use a default config? Warning: This might override the existing json file!`
|
|
13138
13267
|
}
|
|
13139
13268
|
},
|
|
13140
13269
|
help: (command, config) => `
|
|
@@ -13164,9 +13293,9 @@ const config$2 = {
|
|
|
13164
13293
|
const cmdScanSetup = {
|
|
13165
13294
|
description: config$2.description,
|
|
13166
13295
|
hidden: config$2.hidden,
|
|
13167
|
-
run: run$
|
|
13296
|
+
run: run$5
|
|
13168
13297
|
};
|
|
13169
|
-
async function run$
|
|
13298
|
+
async function run$5(argv, importMeta, {
|
|
13170
13299
|
parentName
|
|
13171
13300
|
}) {
|
|
13172
13301
|
const cli = utils.meowOrExit({
|
|
@@ -13210,7 +13339,7 @@ async function fetchScan(orgSlug, scanId) {
|
|
|
13210
13339
|
error: e,
|
|
13211
13340
|
line
|
|
13212
13341
|
});
|
|
13213
|
-
return
|
|
13342
|
+
return undefined;
|
|
13214
13343
|
}
|
|
13215
13344
|
});
|
|
13216
13345
|
if (ok) {
|
|
@@ -13322,21 +13451,21 @@ async function streamScan(orgSlug, scanId, options) {
|
|
|
13322
13451
|
});
|
|
13323
13452
|
}
|
|
13324
13453
|
|
|
13325
|
-
const CMD_NAME$
|
|
13326
|
-
const description$
|
|
13327
|
-
const hidden$
|
|
13454
|
+
const CMD_NAME$2 = 'view';
|
|
13455
|
+
const description$4 = 'View the raw results of a scan';
|
|
13456
|
+
const hidden$2 = false;
|
|
13328
13457
|
const cmdScanView = {
|
|
13329
|
-
description: description$
|
|
13330
|
-
hidden: hidden$
|
|
13331
|
-
run: run$
|
|
13458
|
+
description: description$4,
|
|
13459
|
+
hidden: hidden$2,
|
|
13460
|
+
run: run$4
|
|
13332
13461
|
};
|
|
13333
|
-
async function run$
|
|
13462
|
+
async function run$4(argv, importMeta, {
|
|
13334
13463
|
parentName
|
|
13335
13464
|
}) {
|
|
13336
13465
|
const config = {
|
|
13337
|
-
commandName: CMD_NAME$
|
|
13338
|
-
description: description$
|
|
13339
|
-
hidden: hidden$
|
|
13466
|
+
commandName: CMD_NAME$2,
|
|
13467
|
+
description: description$4,
|
|
13468
|
+
hidden: hidden$2,
|
|
13340
13469
|
flags: {
|
|
13341
13470
|
...flags.commonFlags,
|
|
13342
13471
|
...flags.outputFlags,
|
|
@@ -13360,7 +13489,7 @@ async function run$3(argv, importMeta, {
|
|
|
13360
13489
|
$ ${command} [options] <SCAN_ID> [OUTPUT_FILE]
|
|
13361
13490
|
|
|
13362
13491
|
API Token Requirements
|
|
13363
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
13492
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$2}`)}
|
|
13364
13493
|
|
|
13365
13494
|
When no output path is given the contents is sent to stdout.
|
|
13366
13495
|
|
|
@@ -13433,9 +13562,9 @@ async function run$3(argv, importMeta, {
|
|
|
13433
13562
|
}
|
|
13434
13563
|
}
|
|
13435
13564
|
|
|
13436
|
-
const description$
|
|
13565
|
+
const description$3 = 'Manage Socket scans';
|
|
13437
13566
|
const cmdScan = {
|
|
13438
|
-
description: description$
|
|
13567
|
+
description: description$3,
|
|
13439
13568
|
async run(argv, importMeta, {
|
|
13440
13569
|
parentName
|
|
13441
13570
|
}) {
|
|
@@ -13464,7 +13593,7 @@ const cmdScan = {
|
|
|
13464
13593
|
}
|
|
13465
13594
|
},
|
|
13466
13595
|
argv,
|
|
13467
|
-
description: description$
|
|
13596
|
+
description: description$3,
|
|
13468
13597
|
importMeta,
|
|
13469
13598
|
name: `${parentName} scan`
|
|
13470
13599
|
});
|
|
@@ -13485,7 +13614,7 @@ async function fetchThreatFeed({
|
|
|
13485
13614
|
return await utils.queryApiSafeJson(`orgs/${orgSlug}/threat-feed?${queryParams}`, 'the Threat Feed data');
|
|
13486
13615
|
}
|
|
13487
13616
|
|
|
13488
|
-
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)));
|
|
13489
13618
|
async function outputThreatFeed(result, outputKind) {
|
|
13490
13619
|
if (!result.ok) {
|
|
13491
13620
|
process.exitCode = result.code ?? 1;
|
|
@@ -13499,14 +13628,14 @@ async function outputThreatFeed(result, outputKind) {
|
|
|
13499
13628
|
return;
|
|
13500
13629
|
}
|
|
13501
13630
|
if (!result.data?.results?.length) {
|
|
13502
|
-
logger.logger.warn('Did not receive any data to display
|
|
13631
|
+
logger.logger.warn('Did not receive any data to display.');
|
|
13503
13632
|
return;
|
|
13504
13633
|
}
|
|
13505
13634
|
const formattedOutput = formatResults(result.data.results);
|
|
13506
13635
|
const descriptions = result.data.results.map(d => d.description);
|
|
13507
13636
|
|
|
13508
13637
|
// Note: this temporarily takes over the terminal (just like `man` does).
|
|
13509
|
-
const ScreenWidget = /*@__PURE__*/require$
|
|
13638
|
+
const ScreenWidget = /*@__PURE__*/require$2('../external/blessed/lib/widgets/screen.js');
|
|
13510
13639
|
const screen = new ScreenWidget({
|
|
13511
13640
|
...constants.default.blessedOptions
|
|
13512
13641
|
});
|
|
@@ -13515,7 +13644,7 @@ async function outputThreatFeed(result, outputKind) {
|
|
|
13515
13644
|
// node process just to exit it. That's very bad UX.
|
|
13516
13645
|
// eslint-disable-next-line n/no-process-exit
|
|
13517
13646
|
screen.key(['escape', 'q', 'C-c'], () => process.exit(0));
|
|
13518
|
-
const TableWidget = /*@__PURE__*/require$
|
|
13647
|
+
const TableWidget = /*@__PURE__*/require$2('../external/blessed-contrib/lib/widget/table.js');
|
|
13519
13648
|
const detailsBoxHeight = 20; // bottom N rows for details box
|
|
13520
13649
|
const tipsBoxHeight = 1; // 1 row for tips box
|
|
13521
13650
|
|
|
@@ -13539,7 +13668,7 @@ async function outputThreatFeed(result, outputKind) {
|
|
|
13539
13668
|
columnSpacing: 1,
|
|
13540
13669
|
truncate: '_'
|
|
13541
13670
|
});
|
|
13542
|
-
const BoxWidget = /*@__PURE__*/require$
|
|
13671
|
+
const BoxWidget = /*@__PURE__*/require$2('../external/blessed/lib/widgets/box.js');
|
|
13543
13672
|
const tipsBox = new BoxWidget({
|
|
13544
13673
|
bottom: detailsBoxHeight,
|
|
13545
13674
|
// sits just above the details box
|
|
@@ -13646,23 +13775,23 @@ async function handleThreatFeed({
|
|
|
13646
13775
|
await outputThreatFeed(data, outputKind);
|
|
13647
13776
|
}
|
|
13648
13777
|
|
|
13649
|
-
const CMD_NAME = 'threat-feed';
|
|
13778
|
+
const CMD_NAME$1 = 'threat-feed';
|
|
13650
13779
|
const ECOSYSTEMS = new Set(['gem', 'golang', 'maven', constants.NPM, 'nuget', 'pypi']);
|
|
13651
13780
|
const TYPE_FILTERS = new Set(['anom', 'c', 'fp', 'joke', 'mal', 'secret', 'spy', 'tp', 'typo', 'u', 'vuln']);
|
|
13652
|
-
const description$
|
|
13653
|
-
const hidden = false;
|
|
13781
|
+
const description$2 = '[Beta] View the threat-feed';
|
|
13782
|
+
const hidden$1 = false;
|
|
13654
13783
|
const cmdThreatFeed = {
|
|
13655
|
-
description: description$
|
|
13656
|
-
hidden,
|
|
13657
|
-
run: run$
|
|
13784
|
+
description: description$2,
|
|
13785
|
+
hidden: hidden$1,
|
|
13786
|
+
run: run$3
|
|
13658
13787
|
};
|
|
13659
|
-
async function run$
|
|
13788
|
+
async function run$3(argv, importMeta, {
|
|
13660
13789
|
parentName
|
|
13661
13790
|
}) {
|
|
13662
13791
|
const config = {
|
|
13663
|
-
commandName: CMD_NAME,
|
|
13664
|
-
description: description$
|
|
13665
|
-
hidden,
|
|
13792
|
+
commandName: CMD_NAME$1,
|
|
13793
|
+
description: description$2,
|
|
13794
|
+
hidden: hidden$1,
|
|
13666
13795
|
flags: {
|
|
13667
13796
|
...flags.commonFlags,
|
|
13668
13797
|
...flags.outputFlags,
|
|
@@ -13717,7 +13846,7 @@ async function run$2(argv, importMeta, {
|
|
|
13717
13846
|
$ ${command} [options] [ECOSYSTEM] [TYPE_FILTER]
|
|
13718
13847
|
|
|
13719
13848
|
API Token Requirements
|
|
13720
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME}`)}
|
|
13849
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$1}`)}
|
|
13721
13850
|
- Special access
|
|
13722
13851
|
|
|
13723
13852
|
This feature requires a Threat Feed license. Please contact
|
|
@@ -13983,9 +14112,9 @@ const config$1 = {
|
|
|
13983
14112
|
const cmdUninstallCompletion = {
|
|
13984
14113
|
description: config$1.description,
|
|
13985
14114
|
hidden: config$1.hidden,
|
|
13986
|
-
run: run$
|
|
14115
|
+
run: run$2
|
|
13987
14116
|
};
|
|
13988
|
-
async function run$
|
|
14117
|
+
async function run$2(argv, importMeta, {
|
|
13989
14118
|
parentName
|
|
13990
14119
|
}) {
|
|
13991
14120
|
const cli = utils.meowOrExit({
|
|
@@ -14003,9 +14132,9 @@ async function run$1(argv, importMeta, {
|
|
|
14003
14132
|
await handleUninstallCompletion(String(targetName));
|
|
14004
14133
|
}
|
|
14005
14134
|
|
|
14006
|
-
const description = 'Uninstall Socket CLI tab completion';
|
|
14135
|
+
const description$1 = 'Uninstall Socket CLI tab completion';
|
|
14007
14136
|
const cmdUninstall = {
|
|
14008
|
-
description,
|
|
14137
|
+
description: description$1,
|
|
14009
14138
|
hidden: false,
|
|
14010
14139
|
async run(argv, importMeta, {
|
|
14011
14140
|
parentName
|
|
@@ -14014,7 +14143,7 @@ const cmdUninstall = {
|
|
|
14014
14143
|
completion: cmdUninstallCompletion
|
|
14015
14144
|
}, {
|
|
14016
14145
|
argv,
|
|
14017
|
-
description,
|
|
14146
|
+
description: description$1,
|
|
14018
14147
|
importMeta,
|
|
14019
14148
|
name: `${parentName} uninstall`
|
|
14020
14149
|
});
|
|
@@ -14179,9 +14308,9 @@ const config = {
|
|
|
14179
14308
|
const cmdWrapper = {
|
|
14180
14309
|
description: config.description,
|
|
14181
14310
|
hidden: config.hidden,
|
|
14182
|
-
run
|
|
14311
|
+
run: run$1
|
|
14183
14312
|
};
|
|
14184
|
-
async function run(argv, importMeta, {
|
|
14313
|
+
async function run$1(argv, importMeta, {
|
|
14185
14314
|
parentName
|
|
14186
14315
|
}) {
|
|
14187
14316
|
// I don't think meow would mess with this but ...
|
|
@@ -14254,6 +14383,71 @@ async function run(argv, importMeta, {
|
|
|
14254
14383
|
}
|
|
14255
14384
|
}
|
|
14256
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
|
+
|
|
14257
14451
|
const rootCommands = {
|
|
14258
14452
|
analytics: cmdAnalytics,
|
|
14259
14453
|
'audit-log': cmdAuditLog,
|
|
@@ -14270,6 +14464,7 @@ const rootCommands = {
|
|
|
14270
14464
|
manifest: cmdManifest,
|
|
14271
14465
|
npm: cmdNpm,
|
|
14272
14466
|
npx: cmdNpx,
|
|
14467
|
+
pnpm: cmdPnpm,
|
|
14273
14468
|
oops: cmdOops,
|
|
14274
14469
|
optimize: cmdOptimize,
|
|
14275
14470
|
organization: cmdOrganization,
|
|
@@ -14282,7 +14477,8 @@ const rootCommands = {
|
|
|
14282
14477
|
security: cmdOrganizationPolicySecurity,
|
|
14283
14478
|
'threat-feed': cmdThreatFeed,
|
|
14284
14479
|
uninstall: cmdUninstall,
|
|
14285
|
-
wrapper: cmdWrapper
|
|
14480
|
+
wrapper: cmdWrapper,
|
|
14481
|
+
yarn: cmdYarn
|
|
14286
14482
|
};
|
|
14287
14483
|
const rootAliases = {
|
|
14288
14484
|
audit: {
|
|
@@ -14362,7 +14558,7 @@ const rootAliases = {
|
|
|
14362
14558
|
}
|
|
14363
14559
|
};
|
|
14364
14560
|
|
|
14365
|
-
const __filename$1 = require$$0.fileURLToPath(
|
|
14561
|
+
const __filename$1 = require$$0.fileURLToPath((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
|
|
14366
14562
|
void (async () => {
|
|
14367
14563
|
const registryUrl = vendor.registryUrl();
|
|
14368
14564
|
await vendor.updater({
|
|
@@ -14372,7 +14568,11 @@ void (async () => {
|
|
|
14372
14568
|
name: constants.default.SOCKET_CLI_BIN_NAME,
|
|
14373
14569
|
registryUrl,
|
|
14374
14570
|
ttl: 86_400_000 /* 24 hours in milliseconds */,
|
|
14375
|
-
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
|
+
}
|
|
14376
14576
|
});
|
|
14377
14577
|
try {
|
|
14378
14578
|
await utils.meowWithSubcommands(rootCommands, {
|
|
@@ -14440,5 +14640,5 @@ void (async () => {
|
|
|
14440
14640
|
await utils.captureException(e);
|
|
14441
14641
|
}
|
|
14442
14642
|
})();
|
|
14443
|
-
//# debugId=
|
|
14643
|
+
//# debugId=daab38d0-ec51-45c9-a27a-928a16433b42
|
|
14444
14644
|
//# sourceMappingURL=cli.js.map
|