@socketsecurity/cli-with-sentry 1.1.9 ā 1.1.13
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 +49 -28
- 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 +786 -566
- 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/coana-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/handle-fix.d.mts +3 -1
- package/dist/types/commands/fix/handle-fix.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/fix/types.d.mts +2 -0
- package/dist/types/commands/fix/types.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/scan/fetch-create-org-full-scan.d.mts +1 -1
- package/dist/types/commands/scan/fetch-create-org-full-scan.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/npm/install.d.mts +1 -1
- package/dist/types/shadow/npm/install.d.mts.map +1 -1
- 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
|
}
|
|
@@ -3442,7 +3442,9 @@ async function coanaFix(fixConfig) {
|
|
|
3442
3442
|
cwd,
|
|
3443
3443
|
ghsas,
|
|
3444
3444
|
limit,
|
|
3445
|
+
onlyCompute,
|
|
3445
3446
|
orgSlug,
|
|
3447
|
+
outputFile,
|
|
3446
3448
|
spinner
|
|
3447
3449
|
} = fixConfig;
|
|
3448
3450
|
const fixEnv = await getFixEnv();
|
|
@@ -3494,7 +3496,7 @@ async function coanaFix(fixConfig) {
|
|
|
3494
3496
|
}
|
|
3495
3497
|
};
|
|
3496
3498
|
}
|
|
3497
|
-
const fixCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
|
|
3499
|
+
const fixCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...fixConfig.unknownFlags, ...(onlyCompute ? ['--dry-run'] : []), ...(outputFile ? ['--output-file', outputFile] : [])], fixConfig.orgSlug, {
|
|
3498
3500
|
cwd,
|
|
3499
3501
|
spinner,
|
|
3500
3502
|
stdio: 'inherit'
|
|
@@ -3769,7 +3771,9 @@ async function handleFix({
|
|
|
3769
3771
|
ghsas,
|
|
3770
3772
|
limit,
|
|
3771
3773
|
minSatisfying,
|
|
3774
|
+
onlyCompute,
|
|
3772
3775
|
orgSlug,
|
|
3776
|
+
outputFile,
|
|
3773
3777
|
outputKind,
|
|
3774
3778
|
prCheck,
|
|
3775
3779
|
rangeStyle,
|
|
@@ -3785,18 +3789,20 @@ async function handleFix({
|
|
|
3785
3789
|
orgSlug,
|
|
3786
3790
|
rangeStyle,
|
|
3787
3791
|
spinner,
|
|
3788
|
-
unknownFlags
|
|
3792
|
+
unknownFlags,
|
|
3793
|
+
onlyCompute,
|
|
3794
|
+
outputFile
|
|
3789
3795
|
}), outputKind);
|
|
3790
3796
|
}
|
|
3791
3797
|
|
|
3792
|
-
const CMD_NAME$
|
|
3798
|
+
const CMD_NAME$t = 'fix';
|
|
3793
3799
|
const DEFAULT_LIMIT = 10;
|
|
3794
|
-
const description$
|
|
3795
|
-
const hidden$
|
|
3800
|
+
const description$z = 'Update dependencies with "fixable" Socket alerts';
|
|
3801
|
+
const hidden$s = false;
|
|
3796
3802
|
const cmdFix = {
|
|
3797
|
-
description: description$
|
|
3798
|
-
hidden: hidden$
|
|
3799
|
-
run: run$
|
|
3803
|
+
description: description$z,
|
|
3804
|
+
hidden: hidden$s,
|
|
3805
|
+
run: run$K
|
|
3800
3806
|
};
|
|
3801
3807
|
const generalFlags$2 = {
|
|
3802
3808
|
autopilot: {
|
|
@@ -3828,6 +3834,16 @@ Available styles:
|
|
|
3828
3834
|
* pin - Use the exact version (e.g. 1.2.3)
|
|
3829
3835
|
* preserve - Retain the existing version range style as-is
|
|
3830
3836
|
`.trim()
|
|
3837
|
+
},
|
|
3838
|
+
onlyCompute: {
|
|
3839
|
+
type: 'boolean',
|
|
3840
|
+
default: false,
|
|
3841
|
+
description: 'Compute fixes only, do not apply them. Logs what upgrades would be applied. If combined with --output-file, the output file will contain the upgrades that would be applied.'
|
|
3842
|
+
},
|
|
3843
|
+
outputFile: {
|
|
3844
|
+
type: 'string',
|
|
3845
|
+
default: '',
|
|
3846
|
+
description: 'Path to store upgrades as a JSON file at this path.'
|
|
3831
3847
|
}
|
|
3832
3848
|
};
|
|
3833
3849
|
const hiddenFlags = {
|
|
@@ -3878,13 +3894,13 @@ const hiddenFlags = {
|
|
|
3878
3894
|
hidden: true
|
|
3879
3895
|
}
|
|
3880
3896
|
};
|
|
3881
|
-
async function run$
|
|
3897
|
+
async function run$K(argv, importMeta, {
|
|
3882
3898
|
parentName
|
|
3883
3899
|
}) {
|
|
3884
3900
|
const config = {
|
|
3885
|
-
commandName: CMD_NAME$
|
|
3886
|
-
description: description$
|
|
3887
|
-
hidden: hidden$
|
|
3901
|
+
commandName: CMD_NAME$t,
|
|
3902
|
+
description: description$z,
|
|
3903
|
+
hidden: hidden$s,
|
|
3888
3904
|
flags: {
|
|
3889
3905
|
...flags.commonFlags,
|
|
3890
3906
|
...flags.outputFlags,
|
|
@@ -3896,14 +3912,14 @@ async function run$I(argv, importMeta, {
|
|
|
3896
3912
|
$ ${command} [options] [CWD=.]
|
|
3897
3913
|
|
|
3898
3914
|
API Token Requirements
|
|
3899
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
3915
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$t}`)}
|
|
3900
3916
|
|
|
3901
3917
|
Options
|
|
3902
3918
|
${utils.getFlagListOutput(config.flags)}
|
|
3903
3919
|
|
|
3904
3920
|
Examples
|
|
3905
3921
|
$ ${command}
|
|
3906
|
-
$ ${command} ./
|
|
3922
|
+
$ ${command} ./path/to/project --range-style pin
|
|
3907
3923
|
`
|
|
3908
3924
|
};
|
|
3909
3925
|
const cli = utils.meowOrExit({
|
|
@@ -3919,6 +3935,8 @@ async function run$I(argv, importMeta, {
|
|
|
3919
3935
|
limit,
|
|
3920
3936
|
markdown,
|
|
3921
3937
|
maxSatisfying,
|
|
3938
|
+
onlyCompute,
|
|
3939
|
+
outputFile,
|
|
3922
3940
|
prCheck,
|
|
3923
3941
|
rangeStyle,
|
|
3924
3942
|
// We patched in this feature with `npx custompatch meow` at
|
|
@@ -3971,7 +3989,9 @@ async function run$I(argv, importMeta, {
|
|
|
3971
3989
|
outputKind,
|
|
3972
3990
|
rangeStyle,
|
|
3973
3991
|
spinner,
|
|
3974
|
-
unknownFlags
|
|
3992
|
+
unknownFlags,
|
|
3993
|
+
onlyCompute,
|
|
3994
|
+
outputFile
|
|
3975
3995
|
});
|
|
3976
3996
|
}
|
|
3977
3997
|
|
|
@@ -4055,7 +4075,7 @@ async function setupTabCompletion(targetName) {
|
|
|
4055
4075
|
};
|
|
4056
4076
|
}
|
|
4057
4077
|
function getTabCompletionScriptRaw() {
|
|
4058
|
-
const sourceDir = path.dirname(require$$0.fileURLToPath(
|
|
4078
|
+
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
4079
|
const sourcePath = path.join(sourceDir, 'socket-completion.bash');
|
|
4060
4080
|
if (!fs$1.existsSync(sourcePath)) {
|
|
4061
4081
|
return {
|
|
@@ -4128,9 +4148,9 @@ const config$h = {
|
|
|
4128
4148
|
const cmdInstallCompletion = {
|
|
4129
4149
|
description: config$h.description,
|
|
4130
4150
|
hidden: config$h.hidden,
|
|
4131
|
-
run: run$
|
|
4151
|
+
run: run$J
|
|
4132
4152
|
};
|
|
4133
|
-
async function run$
|
|
4153
|
+
async function run$J(argv, importMeta, {
|
|
4134
4154
|
parentName
|
|
4135
4155
|
}) {
|
|
4136
4156
|
const cli = utils.meowOrExit({
|
|
@@ -4148,9 +4168,9 @@ async function run$H(argv, importMeta, {
|
|
|
4148
4168
|
await handleInstallCompletion(String(targetName));
|
|
4149
4169
|
}
|
|
4150
4170
|
|
|
4151
|
-
const description$
|
|
4171
|
+
const description$y = 'Install Socket CLI tab completion';
|
|
4152
4172
|
const cmdInstall = {
|
|
4153
|
-
description: description$
|
|
4173
|
+
description: description$y,
|
|
4154
4174
|
hidden: false,
|
|
4155
4175
|
async run(argv, importMeta, {
|
|
4156
4176
|
parentName
|
|
@@ -4159,7 +4179,7 @@ const cmdInstall = {
|
|
|
4159
4179
|
completion: cmdInstallCompletion
|
|
4160
4180
|
}, {
|
|
4161
4181
|
argv,
|
|
4162
|
-
description: description$
|
|
4182
|
+
description: description$y,
|
|
4163
4183
|
importMeta,
|
|
4164
4184
|
name: `${parentName} install`
|
|
4165
4185
|
});
|
|
@@ -4168,7 +4188,7 @@ const cmdInstall = {
|
|
|
4168
4188
|
|
|
4169
4189
|
async function outputCmdJson(cwd) {
|
|
4170
4190
|
logger.logger.info('Target cwd:', constants.default.ENV.VITEST ? '<redacted>' : utils.tildify(cwd));
|
|
4171
|
-
const sockJsonPath = path.join(cwd,
|
|
4191
|
+
const sockJsonPath = path.join(cwd, constants.SOCKET_JSON);
|
|
4172
4192
|
const tildeSockJsonPath = constants.default.ENV.VITEST ? '<redacted>' : utils.tildify(sockJsonPath);
|
|
4173
4193
|
if (!fs$1.existsSync(sockJsonPath)) {
|
|
4174
4194
|
logger.logger.fail(`Not found: ${tildeSockJsonPath}`);
|
|
@@ -4192,7 +4212,7 @@ async function handleCmdJson(cwd) {
|
|
|
4192
4212
|
|
|
4193
4213
|
const config$g = {
|
|
4194
4214
|
commandName: 'json',
|
|
4195
|
-
description:
|
|
4215
|
+
description: `Display the \`${constants.SOCKET_JSON}\` that would be applied for target folder`,
|
|
4196
4216
|
hidden: true,
|
|
4197
4217
|
flags: {
|
|
4198
4218
|
...flags.commonFlags
|
|
@@ -4201,7 +4221,7 @@ const config$g = {
|
|
|
4201
4221
|
Usage
|
|
4202
4222
|
$ ${command} [options] [CWD=.]
|
|
4203
4223
|
|
|
4204
|
-
Display the
|
|
4224
|
+
Display the \`${constants.SOCKET_JSON}\` file that would apply when running relevant commands
|
|
4205
4225
|
in the target directory.
|
|
4206
4226
|
|
|
4207
4227
|
Examples
|
|
@@ -4211,9 +4231,9 @@ const config$g = {
|
|
|
4211
4231
|
const cmdJson = {
|
|
4212
4232
|
description: config$g.description,
|
|
4213
4233
|
hidden: config$g.hidden,
|
|
4214
|
-
run: run$
|
|
4234
|
+
run: run$I
|
|
4215
4235
|
};
|
|
4216
|
-
async function run$
|
|
4236
|
+
async function run$I(argv, importMeta, {
|
|
4217
4237
|
parentName
|
|
4218
4238
|
}) {
|
|
4219
4239
|
const cli = utils.meowOrExit({
|
|
@@ -4367,21 +4387,21 @@ async function attemptLogin(apiBaseUrl, apiProxy) {
|
|
|
4367
4387
|
}
|
|
4368
4388
|
}
|
|
4369
4389
|
|
|
4370
|
-
const CMD_NAME$
|
|
4371
|
-
const description$
|
|
4372
|
-
const hidden$
|
|
4390
|
+
const CMD_NAME$s = 'login';
|
|
4391
|
+
const description$x = 'Setup Socket CLI with an API token and defaults';
|
|
4392
|
+
const hidden$r = false;
|
|
4373
4393
|
const cmdLogin = {
|
|
4374
|
-
description: description$
|
|
4375
|
-
hidden: hidden$
|
|
4376
|
-
run: run$
|
|
4394
|
+
description: description$x,
|
|
4395
|
+
hidden: hidden$r,
|
|
4396
|
+
run: run$H
|
|
4377
4397
|
};
|
|
4378
|
-
async function run$
|
|
4398
|
+
async function run$H(argv, importMeta, {
|
|
4379
4399
|
parentName
|
|
4380
4400
|
}) {
|
|
4381
4401
|
const config = {
|
|
4382
|
-
commandName: CMD_NAME$
|
|
4383
|
-
description: description$
|
|
4384
|
-
hidden: hidden$
|
|
4402
|
+
commandName: CMD_NAME$s,
|
|
4403
|
+
description: description$x,
|
|
4404
|
+
hidden: hidden$r,
|
|
4385
4405
|
flags: {
|
|
4386
4406
|
...flags.commonFlags,
|
|
4387
4407
|
apiBaseUrl: {
|
|
@@ -4400,7 +4420,7 @@ async function run$F(argv, importMeta, {
|
|
|
4400
4420
|
$ ${command} [options]
|
|
4401
4421
|
|
|
4402
4422
|
API Token Requirements
|
|
4403
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
4423
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$s}`)}
|
|
4404
4424
|
|
|
4405
4425
|
Logs into the Socket API by prompting for an API token
|
|
4406
4426
|
|
|
@@ -4473,9 +4493,9 @@ const config$f = {
|
|
|
4473
4493
|
const cmdLogout = {
|
|
4474
4494
|
description: config$f.description,
|
|
4475
4495
|
hidden: config$f.hidden,
|
|
4476
|
-
run: run$
|
|
4496
|
+
run: run$G
|
|
4477
4497
|
};
|
|
4478
|
-
async function run$
|
|
4498
|
+
async function run$G(argv, importMeta, {
|
|
4479
4499
|
parentName
|
|
4480
4500
|
}) {
|
|
4481
4501
|
const cli = utils.meowOrExit({
|
|
@@ -4492,8 +4512,10 @@ async function run$E(argv, importMeta, {
|
|
|
4492
4512
|
attemptLogout();
|
|
4493
4513
|
}
|
|
4494
4514
|
|
|
4515
|
+
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
4516
|
const {
|
|
4496
4517
|
PACKAGE_LOCK_JSON,
|
|
4518
|
+
PNPM_LOCK_YAML,
|
|
4497
4519
|
YARN,
|
|
4498
4520
|
YARN_LOCK
|
|
4499
4521
|
} = constants.default;
|
|
@@ -4533,7 +4555,6 @@ function argvToArray(argvObj) {
|
|
|
4533
4555
|
return result;
|
|
4534
4556
|
}
|
|
4535
4557
|
async function runCdxgen(argvObj) {
|
|
4536
|
-
let cleanupPackageLock = false;
|
|
4537
4558
|
const argvMutable = {
|
|
4538
4559
|
__proto__: null,
|
|
4539
4560
|
...argvObj
|
|
@@ -4546,23 +4567,58 @@ async function runCdxgen(argvObj) {
|
|
|
4546
4567
|
},
|
|
4547
4568
|
stdio: 'inherit'
|
|
4548
4569
|
};
|
|
4549
|
-
|
|
4550
|
-
|
|
4570
|
+
|
|
4571
|
+
// Detect package manager based on lockfiles
|
|
4572
|
+
const pnpmLockPath = await utils.findUp(PNPM_LOCK_YAML, {
|
|
4573
|
+
onlyFiles: true
|
|
4574
|
+
});
|
|
4575
|
+
const npmLockPath = pnpmLockPath ? undefined : await utils.findUp(PACKAGE_LOCK_JSON, {
|
|
4576
|
+
onlyFiles: true
|
|
4577
|
+
});
|
|
4578
|
+
const yarnLockPath = pnpmLockPath || npmLockPath ? undefined : await utils.findUp(YARN_LOCK, {
|
|
4579
|
+
onlyFiles: true
|
|
4580
|
+
});
|
|
4581
|
+
let cleanupPackageLock = false;
|
|
4582
|
+
if (argvMutable['type'] !== YARN && nodejsPlatformTypes.has(argvMutable['type']) && yarnLockPath) {
|
|
4583
|
+
if (npmLockPath) {
|
|
4551
4584
|
argvMutable['type'] = constants.NPM;
|
|
4552
4585
|
} else {
|
|
4553
4586
|
// Use synp to create a package-lock.json from the yarn.lock,
|
|
4554
4587
|
// based on the node_modules folder, for a more accurate SBOM.
|
|
4555
4588
|
try {
|
|
4556
|
-
const
|
|
4557
|
-
|
|
4558
|
-
|
|
4589
|
+
const useYarnBerry = utils.isYarnBerry();
|
|
4590
|
+
let args;
|
|
4591
|
+
let synpPromise;
|
|
4592
|
+
if (pnpmLockPath) {
|
|
4593
|
+
args = ['dlx', `synp@${constants.default.ENV.INLINED_SOCKET_CLI_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`];
|
|
4594
|
+
const shadowPnpmBin = /*@__PURE__*/require$6(constants.default.shadowPnpmBinPath);
|
|
4595
|
+
synpPromise = (await shadowPnpmBin(args, shadowOpts)).spawnPromise;
|
|
4596
|
+
} else if (useYarnBerry) {
|
|
4597
|
+
args = ['dlx', `synp@${constants.default.ENV.INLINED_SOCKET_CLI_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`];
|
|
4598
|
+
const shadowYarnBin = /*@__PURE__*/require$6(constants.default.shadowYarnBinPath);
|
|
4599
|
+
synpPromise = (await shadowYarnBin(args, shadowOpts)).spawnPromise;
|
|
4600
|
+
} else {
|
|
4601
|
+
args = ['exec', '--yes', `synp@${constants.default.ENV.INLINED_SOCKET_CLI_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`];
|
|
4602
|
+
synpPromise = (await shadowNpmBin('npm', args, shadowOpts)).spawnPromise;
|
|
4603
|
+
}
|
|
4559
4604
|
await synpPromise;
|
|
4560
4605
|
argvMutable['type'] = constants.NPM;
|
|
4561
4606
|
cleanupPackageLock = true;
|
|
4562
4607
|
} catch {}
|
|
4563
4608
|
}
|
|
4564
4609
|
}
|
|
4565
|
-
|
|
4610
|
+
|
|
4611
|
+
// Use appropriate package manager for cdxgen
|
|
4612
|
+
let shadowResult;
|
|
4613
|
+
if (pnpmLockPath) {
|
|
4614
|
+
const shadowPnpmBin = /*@__PURE__*/require$6(constants.default.shadowPnpmBinPath);
|
|
4615
|
+
shadowResult = await shadowPnpmBin(['dlx', '--silent', `@cyclonedx/cdxgen@${constants.default.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION}`, ...argvToArray(argvMutable)], shadowOpts);
|
|
4616
|
+
} else if (yarnLockPath && utils.isYarnBerry()) {
|
|
4617
|
+
const shadowYarnBin = /*@__PURE__*/require$6(constants.default.shadowYarnBinPath);
|
|
4618
|
+
shadowResult = await shadowYarnBin(['dlx', '--quiet', `@cyclonedx/cdxgen@${constants.default.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION}`, ...argvToArray(argvMutable)], shadowOpts);
|
|
4619
|
+
} else {
|
|
4620
|
+
shadowResult = await shadowNpmBin('npm', ['exec', '--silent', '--yes', `@cyclonedx/cdxgen@${constants.default.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION}`, '--', ...argvToArray(argvMutable)], shadowOpts);
|
|
4621
|
+
}
|
|
4566
4622
|
shadowResult.spawnPromise.process.on('exit', () => {
|
|
4567
4623
|
if (cleanupPackageLock) {
|
|
4568
4624
|
try {
|
|
@@ -4785,11 +4841,15 @@ const config$e = {
|
|
|
4785
4841
|
const cmdManifestCdxgen = {
|
|
4786
4842
|
description: config$e.description,
|
|
4787
4843
|
hidden: config$e.hidden,
|
|
4788
|
-
run: run$
|
|
4844
|
+
run: run$F
|
|
4789
4845
|
};
|
|
4790
|
-
async function run$
|
|
4791
|
-
|
|
4792
|
-
|
|
4846
|
+
async function run$F(argv, importMeta, context) {
|
|
4847
|
+
const {
|
|
4848
|
+
parentName
|
|
4849
|
+
} = {
|
|
4850
|
+
__proto__: null,
|
|
4851
|
+
...context
|
|
4852
|
+
};
|
|
4793
4853
|
const cli = utils.meowOrExit({
|
|
4794
4854
|
// Don't let meow take over --help.
|
|
4795
4855
|
argv: argv.filter(a => !utils.isHelpFlag(a)),
|
|
@@ -4797,11 +4857,17 @@ async function run$D(argv, importMeta, {
|
|
|
4797
4857
|
importMeta,
|
|
4798
4858
|
parentName
|
|
4799
4859
|
});
|
|
4800
|
-
const
|
|
4860
|
+
const {
|
|
4861
|
+
dryRun
|
|
4862
|
+
} = cli.flags;
|
|
4801
4863
|
|
|
4802
|
-
//
|
|
4864
|
+
// Filter Socket flags from argv but keep --no-banner and --help for cdxgen.
|
|
4865
|
+
const argsToProcess = utils.filterFlags(argv, {
|
|
4866
|
+
...flags.commonFlags,
|
|
4867
|
+
...flags.outputFlags
|
|
4868
|
+
}, ['--no-banner', '--help', '-h']);
|
|
4803
4869
|
const yargv = {
|
|
4804
|
-
...vendor.yargsParser(
|
|
4870
|
+
...vendor.yargsParser(argsToProcess, yargsConfig)
|
|
4805
4871
|
};
|
|
4806
4872
|
const pathArgs = [];
|
|
4807
4873
|
const unknowns = [];
|
|
@@ -4895,9 +4961,9 @@ const config$d = {
|
|
|
4895
4961
|
const cmdManifestAuto = {
|
|
4896
4962
|
description: config$d.description,
|
|
4897
4963
|
hidden: config$d.hidden,
|
|
4898
|
-
run: run$
|
|
4964
|
+
run: run$E
|
|
4899
4965
|
};
|
|
4900
|
-
async function run$
|
|
4966
|
+
async function run$E(argv, importMeta, {
|
|
4901
4967
|
parentName
|
|
4902
4968
|
}) {
|
|
4903
4969
|
const cli = utils.meowOrExit({
|
|
@@ -4956,14 +5022,15 @@ async function run$C(argv, importMeta, {
|
|
|
4956
5022
|
|
|
4957
5023
|
const config$c = {
|
|
4958
5024
|
commandName: 'conda',
|
|
4959
|
-
description:
|
|
5025
|
+
description: `[beta] Convert a Conda ${constants.ENVIRONMENT_YML} file to a python ${constants.REQUIREMENTS_TXT}`,
|
|
4960
5026
|
hidden: false,
|
|
4961
5027
|
flags: {
|
|
4962
5028
|
...flags.commonFlags,
|
|
4963
5029
|
...flags.outputFlags,
|
|
4964
5030
|
file: {
|
|
4965
5031
|
type: 'string',
|
|
4966
|
-
|
|
5032
|
+
default: '',
|
|
5033
|
+
description: `Input file name (by default for Conda this is "${constants.ENVIRONMENT_YML}"), relative to cwd`
|
|
4967
5034
|
},
|
|
4968
5035
|
stdin: {
|
|
4969
5036
|
type: 'boolean',
|
|
@@ -4971,11 +5038,12 @@ const config$c = {
|
|
|
4971
5038
|
},
|
|
4972
5039
|
out: {
|
|
4973
5040
|
type: 'string',
|
|
5041
|
+
default: '',
|
|
4974
5042
|
description: 'Output path (relative to cwd)'
|
|
4975
5043
|
},
|
|
4976
5044
|
stdout: {
|
|
4977
5045
|
type: 'boolean',
|
|
4978
|
-
description:
|
|
5046
|
+
description: `Print resulting ${constants.REQUIREMENTS_TXT} to stdout (supersedes --out)`
|
|
4979
5047
|
},
|
|
4980
5048
|
verbose: {
|
|
4981
5049
|
type: 'boolean',
|
|
@@ -4987,8 +5055,8 @@ const config$c = {
|
|
|
4987
5055
|
$ ${command} [options] [CWD=.]
|
|
4988
5056
|
|
|
4989
5057
|
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
|
|
5058
|
+
block from an ${constants.ENVIRONMENT_YML} and outputs it as a ${constants.REQUIREMENTS_TXT}
|
|
5059
|
+
which you can scan as if it were a PyPI package.
|
|
4992
5060
|
|
|
4993
5061
|
USE AT YOUR OWN RISK
|
|
4994
5062
|
|
|
@@ -5001,15 +5069,15 @@ const config$c = {
|
|
|
5001
5069
|
Examples
|
|
5002
5070
|
|
|
5003
5071
|
$ ${command}
|
|
5004
|
-
$ ${command} ./project/foo --file
|
|
5072
|
+
$ ${command} ./project/foo --file ${constants.ENVIRONMENT_YAML}
|
|
5005
5073
|
`
|
|
5006
5074
|
};
|
|
5007
5075
|
const cmdManifestConda = {
|
|
5008
5076
|
description: config$c.description,
|
|
5009
5077
|
hidden: config$c.hidden,
|
|
5010
|
-
run: run$
|
|
5078
|
+
run: run$D
|
|
5011
5079
|
};
|
|
5012
|
-
async function run$
|
|
5080
|
+
async function run$D(argv, importMeta, {
|
|
5013
5081
|
parentName
|
|
5014
5082
|
}) {
|
|
5015
5083
|
const cli = utils.meowOrExit({
|
|
@@ -5019,10 +5087,10 @@ async function run$B(argv, importMeta, {
|
|
|
5019
5087
|
parentName
|
|
5020
5088
|
});
|
|
5021
5089
|
const {
|
|
5022
|
-
|
|
5023
|
-
|
|
5090
|
+
dryRun,
|
|
5091
|
+
json,
|
|
5092
|
+
markdown
|
|
5024
5093
|
} = cli.flags;
|
|
5025
|
-
const dryRun = !!cli.flags['dryRun'];
|
|
5026
5094
|
let [cwd = '.'] = cli.input;
|
|
5027
5095
|
// Note: path.resolve vs .join:
|
|
5028
5096
|
// If given path is absolute then cwd should not affect it.
|
|
@@ -5039,35 +5107,35 @@ async function run$B(argv, importMeta, {
|
|
|
5039
5107
|
// Set defaults for any flag/arg that is not given. Check socket.json first.
|
|
5040
5108
|
if (stdin === undefined && sockJson.defaults?.manifest?.conda?.stdin !== undefined) {
|
|
5041
5109
|
stdin = sockJson.defaults?.manifest?.conda?.stdin;
|
|
5042
|
-
logger.logger.info(
|
|
5110
|
+
logger.logger.info(`Using default --stdin from ${constants.SOCKET_JSON}:`, stdin);
|
|
5043
5111
|
}
|
|
5044
5112
|
if (stdin) {
|
|
5045
5113
|
filename = '-';
|
|
5046
5114
|
} else if (!filename) {
|
|
5047
5115
|
if (sockJson.defaults?.manifest?.conda?.infile) {
|
|
5048
5116
|
filename = sockJson.defaults?.manifest?.conda?.infile;
|
|
5049
|
-
logger.logger.info(
|
|
5117
|
+
logger.logger.info(`Using default --file from ${constants.SOCKET_JSON}:`, filename);
|
|
5050
5118
|
} else {
|
|
5051
|
-
filename =
|
|
5119
|
+
filename = constants.ENVIRONMENT_YML;
|
|
5052
5120
|
}
|
|
5053
5121
|
}
|
|
5054
5122
|
if (stdout === undefined && sockJson.defaults?.manifest?.conda?.stdout !== undefined) {
|
|
5055
5123
|
stdout = sockJson.defaults?.manifest?.conda?.stdout;
|
|
5056
|
-
logger.logger.info(
|
|
5124
|
+
logger.logger.info(`Using default --stdout from ${constants.SOCKET_JSON}:`, stdout);
|
|
5057
5125
|
}
|
|
5058
5126
|
if (stdout) {
|
|
5059
5127
|
out = '-';
|
|
5060
5128
|
} else if (!out) {
|
|
5061
5129
|
if (sockJson.defaults?.manifest?.conda?.outfile) {
|
|
5062
5130
|
out = sockJson.defaults?.manifest?.conda?.outfile;
|
|
5063
|
-
logger.logger.info(
|
|
5131
|
+
logger.logger.info(`Using default --out from ${constants.SOCKET_JSON}:`, out);
|
|
5064
5132
|
} else {
|
|
5065
|
-
out =
|
|
5133
|
+
out = constants.REQUIREMENTS_TXT;
|
|
5066
5134
|
}
|
|
5067
5135
|
}
|
|
5068
5136
|
if (verbose === undefined && sockJson.defaults?.manifest?.conda?.verbose !== undefined) {
|
|
5069
5137
|
verbose = sockJson.defaults?.manifest?.conda?.verbose;
|
|
5070
|
-
logger.logger.info(
|
|
5138
|
+
logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
|
|
5071
5139
|
} else if (verbose === undefined) {
|
|
5072
5140
|
verbose = false;
|
|
5073
5141
|
}
|
|
@@ -5101,10 +5169,10 @@ async function run$B(argv, importMeta, {
|
|
|
5101
5169
|
}
|
|
5102
5170
|
await handleManifestConda({
|
|
5103
5171
|
cwd,
|
|
5104
|
-
filename
|
|
5105
|
-
out
|
|
5172
|
+
filename,
|
|
5173
|
+
out,
|
|
5106
5174
|
outputKind,
|
|
5107
|
-
verbose
|
|
5175
|
+
verbose
|
|
5108
5176
|
});
|
|
5109
5177
|
}
|
|
5110
5178
|
|
|
@@ -5139,7 +5207,7 @@ const config$b = {
|
|
|
5139
5207
|
global \`gradle\` binary but that may not work (hard to predict).
|
|
5140
5208
|
|
|
5141
5209
|
The \`pom.xml\` is a manifest file similar to \`package.json\` for npm or
|
|
5142
|
-
or
|
|
5210
|
+
or ${constants.REQUIREMENTS_TXT} for PyPi), but specifically for Maven, which is Java's
|
|
5143
5211
|
dependency repository. Languages like Kotlin and Scala piggy back on it too.
|
|
5144
5212
|
|
|
5145
5213
|
There are some caveats with the gradle to \`pom.xml\` conversion:
|
|
@@ -5163,9 +5231,9 @@ const config$b = {
|
|
|
5163
5231
|
const cmdManifestGradle = {
|
|
5164
5232
|
description: config$b.description,
|
|
5165
5233
|
hidden: config$b.hidden,
|
|
5166
|
-
run: run$
|
|
5234
|
+
run: run$C
|
|
5167
5235
|
};
|
|
5168
|
-
async function run$
|
|
5236
|
+
async function run$C(argv, importMeta, {
|
|
5169
5237
|
parentName
|
|
5170
5238
|
}) {
|
|
5171
5239
|
const cli = utils.meowOrExit({
|
|
@@ -5187,7 +5255,7 @@ async function run$A(argv, importMeta, {
|
|
|
5187
5255
|
// If given path is absolute then cwd should not affect it.
|
|
5188
5256
|
cwd = path.resolve(process.cwd(), cwd);
|
|
5189
5257
|
const sockJson = utils.readOrDefaultSocketJson(cwd);
|
|
5190
|
-
require$$9.debugFn('inspect',
|
|
5258
|
+
require$$9.debugFn('inspect', `override: ${constants.SOCKET_JSON} gradle`, sockJson?.defaults?.manifest?.gradle);
|
|
5191
5259
|
let {
|
|
5192
5260
|
bin,
|
|
5193
5261
|
gradleOpts,
|
|
@@ -5198,7 +5266,7 @@ async function run$A(argv, importMeta, {
|
|
|
5198
5266
|
if (!bin) {
|
|
5199
5267
|
if (sockJson.defaults?.manifest?.gradle?.bin) {
|
|
5200
5268
|
bin = sockJson.defaults?.manifest?.gradle?.bin;
|
|
5201
|
-
logger.logger.info(
|
|
5269
|
+
logger.logger.info(`Using default --bin from ${constants.SOCKET_JSON}:`, bin);
|
|
5202
5270
|
} else {
|
|
5203
5271
|
bin = path.join(cwd, 'gradlew');
|
|
5204
5272
|
}
|
|
@@ -5206,7 +5274,7 @@ async function run$A(argv, importMeta, {
|
|
|
5206
5274
|
if (!gradleOpts) {
|
|
5207
5275
|
if (sockJson.defaults?.manifest?.gradle?.gradleOpts) {
|
|
5208
5276
|
gradleOpts = sockJson.defaults?.manifest?.gradle?.gradleOpts;
|
|
5209
|
-
logger.logger.info(
|
|
5277
|
+
logger.logger.info(`Using default --gradle-opts from ${constants.SOCKET_JSON}:`, gradleOpts);
|
|
5210
5278
|
} else {
|
|
5211
5279
|
gradleOpts = '';
|
|
5212
5280
|
}
|
|
@@ -5214,7 +5282,7 @@ async function run$A(argv, importMeta, {
|
|
|
5214
5282
|
if (verbose === undefined) {
|
|
5215
5283
|
if (sockJson.defaults?.manifest?.gradle?.verbose !== undefined) {
|
|
5216
5284
|
verbose = sockJson.defaults?.manifest?.gradle?.verbose;
|
|
5217
|
-
logger.logger.info(
|
|
5285
|
+
logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
|
|
5218
5286
|
} else {
|
|
5219
5287
|
verbose = false;
|
|
5220
5288
|
}
|
|
@@ -5294,7 +5362,7 @@ const config$a = {
|
|
|
5294
5362
|
global \`gradle\` binary but that may not work (hard to predict).
|
|
5295
5363
|
|
|
5296
5364
|
The \`pom.xml\` is a manifest file similar to \`package.json\` for npm or
|
|
5297
|
-
or
|
|
5365
|
+
or ${constants.REQUIREMENTS_TXT} for PyPi), but specifically for Maven, which is Java's
|
|
5298
5366
|
dependency repository. Languages like Kotlin and Scala piggy back on it too.
|
|
5299
5367
|
|
|
5300
5368
|
There are some caveats with the gradle to \`pom.xml\` conversion:
|
|
@@ -5318,9 +5386,9 @@ const config$a = {
|
|
|
5318
5386
|
const cmdManifestKotlin = {
|
|
5319
5387
|
description: config$a.description,
|
|
5320
5388
|
hidden: config$a.hidden,
|
|
5321
|
-
run: run$
|
|
5389
|
+
run: run$B
|
|
5322
5390
|
};
|
|
5323
|
-
async function run$
|
|
5391
|
+
async function run$B(argv, importMeta, {
|
|
5324
5392
|
parentName
|
|
5325
5393
|
}) {
|
|
5326
5394
|
const cli = utils.meowOrExit({
|
|
@@ -5342,7 +5410,7 @@ async function run$z(argv, importMeta, {
|
|
|
5342
5410
|
// If given path is absolute then cwd should not affect it.
|
|
5343
5411
|
cwd = path.resolve(process.cwd(), cwd);
|
|
5344
5412
|
const sockJson = utils.readOrDefaultSocketJson(cwd);
|
|
5345
|
-
require$$9.debugFn('inspect',
|
|
5413
|
+
require$$9.debugFn('inspect', `override: ${constants.SOCKET_JSON} gradle`, sockJson?.defaults?.manifest?.gradle);
|
|
5346
5414
|
let {
|
|
5347
5415
|
bin,
|
|
5348
5416
|
gradleOpts,
|
|
@@ -5353,7 +5421,7 @@ async function run$z(argv, importMeta, {
|
|
|
5353
5421
|
if (!bin) {
|
|
5354
5422
|
if (sockJson.defaults?.manifest?.gradle?.bin) {
|
|
5355
5423
|
bin = sockJson.defaults?.manifest?.gradle?.bin;
|
|
5356
|
-
logger.logger.info(
|
|
5424
|
+
logger.logger.info(`Using default --bin from ${constants.SOCKET_JSON}:`, bin);
|
|
5357
5425
|
} else {
|
|
5358
5426
|
bin = path.join(cwd, 'gradlew');
|
|
5359
5427
|
}
|
|
@@ -5361,7 +5429,7 @@ async function run$z(argv, importMeta, {
|
|
|
5361
5429
|
if (!gradleOpts) {
|
|
5362
5430
|
if (sockJson.defaults?.manifest?.gradle?.gradleOpts) {
|
|
5363
5431
|
gradleOpts = sockJson.defaults?.manifest?.gradle?.gradleOpts;
|
|
5364
|
-
logger.logger.info(
|
|
5432
|
+
logger.logger.info(`Using default --gradle-opts from ${constants.SOCKET_JSON}:`, gradleOpts);
|
|
5365
5433
|
} else {
|
|
5366
5434
|
gradleOpts = '';
|
|
5367
5435
|
}
|
|
@@ -5369,7 +5437,7 @@ async function run$z(argv, importMeta, {
|
|
|
5369
5437
|
if (verbose === undefined) {
|
|
5370
5438
|
if (sockJson.defaults?.manifest?.gradle?.verbose !== undefined) {
|
|
5371
5439
|
verbose = sockJson.defaults?.manifest?.gradle?.verbose;
|
|
5372
|
-
logger.logger.info(
|
|
5440
|
+
logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
|
|
5373
5441
|
} else {
|
|
5374
5442
|
verbose = false;
|
|
5375
5443
|
}
|
|
@@ -5449,7 +5517,7 @@ const config$9 = {
|
|
|
5449
5517
|
|
|
5450
5518
|
Uses \`sbt makePom\` to generate a \`pom.xml\` from your \`build.sbt\` file.
|
|
5451
5519
|
This xml file is the dependency manifest (like a package.json
|
|
5452
|
-
for Node.js or
|
|
5520
|
+
for Node.js or ${constants.REQUIREMENTS_TXT} for PyPi), but specifically for Scala.
|
|
5453
5521
|
|
|
5454
5522
|
There are some caveats with \`build.sbt\` to \`pom.xml\` conversion:
|
|
5455
5523
|
|
|
@@ -5481,9 +5549,9 @@ const config$9 = {
|
|
|
5481
5549
|
const cmdManifestScala = {
|
|
5482
5550
|
description: config$9.description,
|
|
5483
5551
|
hidden: config$9.hidden,
|
|
5484
|
-
run: run$
|
|
5552
|
+
run: run$A
|
|
5485
5553
|
};
|
|
5486
|
-
async function run$
|
|
5554
|
+
async function run$A(argv, importMeta, {
|
|
5487
5555
|
parentName
|
|
5488
5556
|
}) {
|
|
5489
5557
|
const cli = utils.meowOrExit({
|
|
@@ -5505,7 +5573,7 @@ async function run$y(argv, importMeta, {
|
|
|
5505
5573
|
// TODO: Implement json/md further.
|
|
5506
5574
|
const outputKind = utils.getOutputKind(json, markdown);
|
|
5507
5575
|
const sockJson = utils.readOrDefaultSocketJson(cwd);
|
|
5508
|
-
require$$9.debugFn('inspect',
|
|
5576
|
+
require$$9.debugFn('inspect', `override: ${constants.SOCKET_JSON} sbt`, sockJson?.defaults?.manifest?.sbt);
|
|
5509
5577
|
let {
|
|
5510
5578
|
bin,
|
|
5511
5579
|
out,
|
|
@@ -5518,21 +5586,21 @@ async function run$y(argv, importMeta, {
|
|
|
5518
5586
|
if (!bin) {
|
|
5519
5587
|
if (sockJson.defaults?.manifest?.sbt?.bin) {
|
|
5520
5588
|
bin = sockJson.defaults?.manifest?.sbt?.bin;
|
|
5521
|
-
logger.logger.info(
|
|
5589
|
+
logger.logger.info(`Using default --bin from ${constants.SOCKET_JSON}:`, bin);
|
|
5522
5590
|
} else {
|
|
5523
5591
|
bin = 'sbt';
|
|
5524
5592
|
}
|
|
5525
5593
|
}
|
|
5526
5594
|
if (stdout === undefined && sockJson.defaults?.manifest?.sbt?.stdout !== undefined) {
|
|
5527
5595
|
stdout = sockJson.defaults?.manifest?.sbt?.stdout;
|
|
5528
|
-
logger.logger.info(
|
|
5596
|
+
logger.logger.info(`Using default --stdout from ${constants.SOCKET_JSON}:`, stdout);
|
|
5529
5597
|
}
|
|
5530
5598
|
if (stdout) {
|
|
5531
5599
|
out = '-';
|
|
5532
5600
|
} else if (!out) {
|
|
5533
5601
|
if (sockJson.defaults?.manifest?.sbt?.outfile) {
|
|
5534
5602
|
out = sockJson.defaults?.manifest?.sbt?.outfile;
|
|
5535
|
-
logger.logger.info(
|
|
5603
|
+
logger.logger.info(`Using default --out from ${constants.SOCKET_JSON}:`, out);
|
|
5536
5604
|
} else {
|
|
5537
5605
|
out = './socket.pom.xml';
|
|
5538
5606
|
}
|
|
@@ -5540,14 +5608,14 @@ async function run$y(argv, importMeta, {
|
|
|
5540
5608
|
if (!sbtOpts) {
|
|
5541
5609
|
if (sockJson.defaults?.manifest?.sbt?.sbtOpts) {
|
|
5542
5610
|
sbtOpts = sockJson.defaults?.manifest?.sbt?.sbtOpts;
|
|
5543
|
-
logger.logger.info(
|
|
5611
|
+
logger.logger.info(`Using default --sbt-opts from ${constants.SOCKET_JSON}:`, sbtOpts);
|
|
5544
5612
|
} else {
|
|
5545
5613
|
sbtOpts = '';
|
|
5546
5614
|
}
|
|
5547
5615
|
}
|
|
5548
5616
|
if (verbose === undefined && sockJson.defaults?.manifest?.sbt?.verbose !== undefined) {
|
|
5549
5617
|
verbose = sockJson.defaults?.manifest?.sbt?.verbose;
|
|
5550
|
-
logger.logger.info(
|
|
5618
|
+
logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
|
|
5551
5619
|
} else if (verbose === undefined) {
|
|
5552
5620
|
verbose = false;
|
|
5553
5621
|
}
|
|
@@ -5615,18 +5683,18 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
|
|
|
5615
5683
|
// - each target will have its own specific options
|
|
5616
5684
|
// - record them to the socket.yml (or socket-cli.yml ? or just socket.json ?)
|
|
5617
5685
|
|
|
5618
|
-
const jsonPath = path.join(cwd,
|
|
5686
|
+
const jsonPath = path.join(cwd, constants.SOCKET_JSON);
|
|
5619
5687
|
if (fs$1.existsSync(jsonPath)) {
|
|
5620
|
-
logger.logger.info(`Found
|
|
5688
|
+
logger.logger.info(`Found ${constants.SOCKET_JSON} at ${jsonPath}`);
|
|
5621
5689
|
} else {
|
|
5622
|
-
logger.logger.info(`No
|
|
5690
|
+
logger.logger.info(`No ${constants.SOCKET_JSON} found at ${cwd}, will generate a new one`);
|
|
5623
5691
|
}
|
|
5624
5692
|
logger.logger.log('');
|
|
5625
5693
|
logger.logger.log('Note: This tool will set up flag and argument defaults for certain');
|
|
5626
5694
|
logger.logger.log(' CLI commands. You can still override them by explicitly');
|
|
5627
5695
|
logger.logger.log(' setting the flag. It is meant to be a convenience tool.');
|
|
5628
5696
|
logger.logger.log('');
|
|
5629
|
-
logger.logger.log(
|
|
5697
|
+
logger.logger.log(`This command will generate a ${constants.SOCKET_JSON} file in the target cwd.`);
|
|
5630
5698
|
logger.logger.log('You can choose to add this file to your repo (handy for collaboration)');
|
|
5631
5699
|
logger.logger.log('or to add it to the ignored files, or neither. This file is only');
|
|
5632
5700
|
logger.logger.log('used in CLI workflows.');
|
|
@@ -5634,7 +5702,7 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
|
|
|
5634
5702
|
const choices = [{
|
|
5635
5703
|
name: 'Conda'.padEnd(30, ' '),
|
|
5636
5704
|
value: 'conda',
|
|
5637
|
-
description:
|
|
5705
|
+
description: `Generate ${constants.REQUIREMENTS_TXT} from a Conda environment.yml`
|
|
5638
5706
|
}, {
|
|
5639
5707
|
name: 'Gradle'.padEnd(30, ' '),
|
|
5640
5708
|
value: 'gradle',
|
|
@@ -5727,7 +5795,7 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
|
|
|
5727
5795
|
return result;
|
|
5728
5796
|
}
|
|
5729
5797
|
logger.logger.log('');
|
|
5730
|
-
logger.logger.log(
|
|
5798
|
+
logger.logger.log(`Setup complete. Writing ${constants.SOCKET_JSON}`);
|
|
5731
5799
|
logger.logger.log('');
|
|
5732
5800
|
if (await prompts.select({
|
|
5733
5801
|
message: `Do you want to write the new config to ${jsonPath} ?`,
|
|
@@ -5778,7 +5846,7 @@ async function setupConda(config) {
|
|
|
5778
5846
|
delete config.stdout;
|
|
5779
5847
|
}
|
|
5780
5848
|
if (!config.stdout) {
|
|
5781
|
-
const out = await askForOutputFile(config.outfile ||
|
|
5849
|
+
const out = await askForOutputFile(config.outfile || constants.REQUIREMENTS_TXT);
|
|
5782
5850
|
if (out === undefined) {
|
|
5783
5851
|
return canceledByUser$1();
|
|
5784
5852
|
} else if (out === '-') {
|
|
@@ -6005,7 +6073,7 @@ const config$8 = {
|
|
|
6005
6073
|
...flags.commonFlags,
|
|
6006
6074
|
defaultOnReadError: {
|
|
6007
6075
|
type: 'boolean',
|
|
6008
|
-
description:
|
|
6076
|
+
description: `If reading the ${constants.SOCKET_JSON} fails, just use a default config? Warning: This might override the existing json file!`
|
|
6009
6077
|
}
|
|
6010
6078
|
},
|
|
6011
6079
|
help: (command, config) => `
|
|
@@ -6018,7 +6086,7 @@ const config$8 = {
|
|
|
6018
6086
|
This command will try to detect all supported ecosystems in given CWD. Then
|
|
6019
6087
|
it starts a configurator where you can setup default values for certain flags
|
|
6020
6088
|
when creating manifest files in that dir. These configuration details are
|
|
6021
|
-
then stored in a local
|
|
6089
|
+
then stored in a local \`${constants.SOCKET_JSON}\` file (which you may or may not commit
|
|
6022
6090
|
to the repo). Next time you run \`socket manifest ...\` it will load this
|
|
6023
6091
|
json file and any flags which are not explicitly set in the command but which
|
|
6024
6092
|
have been registered in the json file will get the default value set to that
|
|
@@ -6042,9 +6110,9 @@ const config$8 = {
|
|
|
6042
6110
|
const cmdManifestSetup = {
|
|
6043
6111
|
description: config$8.description,
|
|
6044
6112
|
hidden: config$8.hidden,
|
|
6045
|
-
run: run$
|
|
6113
|
+
run: run$z
|
|
6046
6114
|
};
|
|
6047
|
-
async function run$
|
|
6115
|
+
async function run$z(argv, importMeta, {
|
|
6048
6116
|
parentName
|
|
6049
6117
|
}) {
|
|
6050
6118
|
const cli = utils.meowOrExit({
|
|
@@ -6078,9 +6146,9 @@ const config$7 = {
|
|
|
6078
6146
|
const cmdManifest = {
|
|
6079
6147
|
description: config$7.description,
|
|
6080
6148
|
hidden: config$7.hidden,
|
|
6081
|
-
run: run$
|
|
6149
|
+
run: run$y
|
|
6082
6150
|
};
|
|
6083
|
-
async function run$
|
|
6151
|
+
async function run$y(argv, importMeta, {
|
|
6084
6152
|
parentName
|
|
6085
6153
|
}) {
|
|
6086
6154
|
await utils.meowWithSubcommands({
|
|
@@ -6107,22 +6175,26 @@ async function run$w(argv, importMeta, {
|
|
|
6107
6175
|
});
|
|
6108
6176
|
}
|
|
6109
6177
|
|
|
6110
|
-
const require$
|
|
6111
|
-
const CMD_NAME$
|
|
6112
|
-
const description$
|
|
6113
|
-
const hidden$
|
|
6178
|
+
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)));
|
|
6179
|
+
const CMD_NAME$r = constants.NPM;
|
|
6180
|
+
const description$w = 'Run npm with the Socket wrapper';
|
|
6181
|
+
const hidden$q = false;
|
|
6114
6182
|
const cmdNpm = {
|
|
6115
|
-
description: description$
|
|
6116
|
-
hidden: hidden$
|
|
6117
|
-
run: run$
|
|
6183
|
+
description: description$w,
|
|
6184
|
+
hidden: hidden$q,
|
|
6185
|
+
run: run$x
|
|
6118
6186
|
};
|
|
6119
|
-
async function run$
|
|
6120
|
-
|
|
6121
|
-
|
|
6187
|
+
async function run$x(argv, importMeta, context) {
|
|
6188
|
+
const {
|
|
6189
|
+
parentName
|
|
6190
|
+
} = {
|
|
6191
|
+
__proto__: null,
|
|
6192
|
+
...context
|
|
6193
|
+
};
|
|
6122
6194
|
const config = {
|
|
6123
|
-
commandName: CMD_NAME$
|
|
6124
|
-
description: description$
|
|
6125
|
-
hidden: hidden$
|
|
6195
|
+
commandName: CMD_NAME$r,
|
|
6196
|
+
description: description$w,
|
|
6197
|
+
hidden: hidden$q,
|
|
6126
6198
|
flags: {
|
|
6127
6199
|
...flags.commonFlags
|
|
6128
6200
|
},
|
|
@@ -6131,7 +6203,7 @@ async function run$v(argv, importMeta, {
|
|
|
6131
6203
|
$ ${command} ...
|
|
6132
6204
|
|
|
6133
6205
|
API Token Requirements
|
|
6134
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
6206
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$r}`)}
|
|
6135
6207
|
|
|
6136
6208
|
Note: Everything after "npm" is passed to the npm command.
|
|
6137
6209
|
Only the \`--dry-run\` and \`--help\` flags are caught here.
|
|
@@ -6141,6 +6213,7 @@ async function run$v(argv, importMeta, {
|
|
|
6141
6213
|
Examples
|
|
6142
6214
|
$ ${command}
|
|
6143
6215
|
$ ${command} install -g cowsay
|
|
6216
|
+
$ ${command} exec cowsay
|
|
6144
6217
|
`
|
|
6145
6218
|
};
|
|
6146
6219
|
const cli = utils.meowOrExit({
|
|
@@ -6154,11 +6227,17 @@ async function run$v(argv, importMeta, {
|
|
|
6154
6227
|
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
6155
6228
|
return;
|
|
6156
6229
|
}
|
|
6157
|
-
const shadowBin = /*@__PURE__*/require$
|
|
6230
|
+
const shadowBin = /*@__PURE__*/require$5(constants.default.shadowNpmBinPath);
|
|
6158
6231
|
process.exitCode = 1;
|
|
6232
|
+
|
|
6233
|
+
// Filter Socket flags from argv but keep --json for npm.
|
|
6234
|
+
const argsToForward = utils.filterFlags(argv, {
|
|
6235
|
+
...flags.commonFlags,
|
|
6236
|
+
...flags.outputFlags
|
|
6237
|
+
}, ['--json']);
|
|
6159
6238
|
const {
|
|
6160
6239
|
spawnPromise
|
|
6161
|
-
} = await shadowBin(constants.NPM,
|
|
6240
|
+
} = await shadowBin(constants.NPM, argsToForward, {
|
|
6162
6241
|
stdio: 'inherit'
|
|
6163
6242
|
});
|
|
6164
6243
|
|
|
@@ -6174,22 +6253,22 @@ async function run$v(argv, importMeta, {
|
|
|
6174
6253
|
await spawnPromise;
|
|
6175
6254
|
}
|
|
6176
6255
|
|
|
6177
|
-
const require$
|
|
6178
|
-
const CMD_NAME$
|
|
6179
|
-
const description$
|
|
6180
|
-
const hidden$
|
|
6256
|
+
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)));
|
|
6257
|
+
const CMD_NAME$q = constants.NPX;
|
|
6258
|
+
const description$v = 'Run npx with the Socket wrapper';
|
|
6259
|
+
const hidden$p = false;
|
|
6181
6260
|
const cmdNpx = {
|
|
6182
|
-
description: description$
|
|
6183
|
-
hidden: hidden$
|
|
6184
|
-
run: run$
|
|
6261
|
+
description: description$v,
|
|
6262
|
+
hidden: hidden$p,
|
|
6263
|
+
run: run$w
|
|
6185
6264
|
};
|
|
6186
|
-
async function run$
|
|
6265
|
+
async function run$w(argv, importMeta, {
|
|
6187
6266
|
parentName
|
|
6188
6267
|
}) {
|
|
6189
6268
|
const config = {
|
|
6190
|
-
commandName: CMD_NAME$
|
|
6191
|
-
description: description$
|
|
6192
|
-
hidden: hidden$
|
|
6269
|
+
commandName: CMD_NAME$q,
|
|
6270
|
+
description: description$v,
|
|
6271
|
+
hidden: hidden$p,
|
|
6193
6272
|
flags: {
|
|
6194
6273
|
...flags.commonFlags
|
|
6195
6274
|
},
|
|
@@ -6198,7 +6277,7 @@ async function run$u(argv, importMeta, {
|
|
|
6198
6277
|
$ ${command} ...
|
|
6199
6278
|
|
|
6200
6279
|
API Token Requirements
|
|
6201
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
6280
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$q}`)}
|
|
6202
6281
|
|
|
6203
6282
|
Note: Everything after "npx" is passed to the npx command.
|
|
6204
6283
|
Only the \`--dry-run\` and \`--help\` flags are caught here.
|
|
@@ -6207,6 +6286,7 @@ async function run$u(argv, importMeta, {
|
|
|
6207
6286
|
|
|
6208
6287
|
Examples
|
|
6209
6288
|
$ ${command} cowsay
|
|
6289
|
+
$ ${command} cowsay@1.6.0 hello
|
|
6210
6290
|
`
|
|
6211
6291
|
};
|
|
6212
6292
|
const cli = utils.meowOrExit({
|
|
@@ -6220,7 +6300,7 @@ async function run$u(argv, importMeta, {
|
|
|
6220
6300
|
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
6221
6301
|
return;
|
|
6222
6302
|
}
|
|
6223
|
-
const shadowBin = /*@__PURE__*/require$
|
|
6303
|
+
const shadowBin = /*@__PURE__*/require$4(constants.default.shadowNpmBinPath);
|
|
6224
6304
|
process.exitCode = 1;
|
|
6225
6305
|
const {
|
|
6226
6306
|
spawnPromise
|
|
@@ -6263,9 +6343,9 @@ const config$6 = {
|
|
|
6263
6343
|
const cmdOops = {
|
|
6264
6344
|
description: config$6.description,
|
|
6265
6345
|
hidden: config$6.hidden,
|
|
6266
|
-
run: run$
|
|
6346
|
+
run: run$v
|
|
6267
6347
|
};
|
|
6268
|
-
async function run$
|
|
6348
|
+
async function run$v(argv, importMeta, {
|
|
6269
6349
|
parentName
|
|
6270
6350
|
}) {
|
|
6271
6351
|
const cli = utils.meowOrExit({
|
|
@@ -6297,7 +6377,7 @@ async function run$t(argv, importMeta, {
|
|
|
6297
6377
|
logger.logger.fail(utils.failMsgWithBadge('Oops', 'This error was intentionally left blank'));
|
|
6298
6378
|
return;
|
|
6299
6379
|
}
|
|
6300
|
-
throw new Error('This error was intentionally left blank');
|
|
6380
|
+
throw new Error('This error was intentionally left blank.');
|
|
6301
6381
|
}
|
|
6302
6382
|
|
|
6303
6383
|
const {
|
|
@@ -6682,7 +6762,7 @@ async function listPackages(pkgEnvDetails, options) {
|
|
|
6682
6762
|
}
|
|
6683
6763
|
}
|
|
6684
6764
|
|
|
6685
|
-
const CMD_NAME$
|
|
6765
|
+
const CMD_NAME$p = 'socket optimize';
|
|
6686
6766
|
|
|
6687
6767
|
const {
|
|
6688
6768
|
BUN,
|
|
@@ -6854,7 +6934,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
|
|
|
6854
6934
|
npmExecPath === constants.NPM && !state.warnedPnpmWorkspaceRequiresNpm) {
|
|
6855
6935
|
state.warnedPnpmWorkspaceRequiresNpm = true;
|
|
6856
6936
|
spinner?.stop();
|
|
6857
|
-
logger?.warn(utils.cmdPrefixMessage(CMD_NAME$
|
|
6937
|
+
logger?.warn(utils.cmdPrefixMessage(CMD_NAME$p, `${agent} workspace support requires \`npm ls\`, falling back to \`${agent} list\``));
|
|
6858
6938
|
spinner?.start();
|
|
6859
6939
|
}
|
|
6860
6940
|
const overridesDataObjects = [];
|
|
@@ -7084,7 +7164,7 @@ async function applyOptimization(pkgEnvDetails, {
|
|
|
7084
7164
|
const pkgJsonChanged = addedCount > 0 || updatedCount > 0;
|
|
7085
7165
|
if (pkgJsonChanged || pkgEnvDetails.features.npmBuggyOverrides) {
|
|
7086
7166
|
const result = await updateLockfile(pkgEnvDetails, {
|
|
7087
|
-
cmdName: CMD_NAME$
|
|
7167
|
+
cmdName: CMD_NAME$p,
|
|
7088
7168
|
logger: logger.logger,
|
|
7089
7169
|
spinner
|
|
7090
7170
|
});
|
|
@@ -7146,7 +7226,7 @@ async function handleOptimize({
|
|
|
7146
7226
|
prod
|
|
7147
7227
|
}) {
|
|
7148
7228
|
const pkgEnvCResult = await utils.detectAndValidatePackageEnvironment(cwd, {
|
|
7149
|
-
cmdName: CMD_NAME$
|
|
7229
|
+
cmdName: CMD_NAME$p,
|
|
7150
7230
|
logger: logger.logger,
|
|
7151
7231
|
prod
|
|
7152
7232
|
});
|
|
@@ -7171,7 +7251,7 @@ async function handleOptimize({
|
|
|
7171
7251
|
await outputOptimizeResult({
|
|
7172
7252
|
ok: false,
|
|
7173
7253
|
message: 'Unsupported',
|
|
7174
|
-
cause: utils.cmdPrefixMessage(CMD_NAME$
|
|
7254
|
+
cause: utils.cmdPrefixMessage(CMD_NAME$p, `${agent} v${agentVersion} does not support overrides.`)
|
|
7175
7255
|
}, outputKind);
|
|
7176
7256
|
return;
|
|
7177
7257
|
}
|
|
@@ -7182,21 +7262,21 @@ async function handleOptimize({
|
|
|
7182
7262
|
}), outputKind);
|
|
7183
7263
|
}
|
|
7184
7264
|
|
|
7185
|
-
const CMD_NAME$
|
|
7186
|
-
const description$
|
|
7187
|
-
const hidden$
|
|
7265
|
+
const CMD_NAME$o = 'optimize';
|
|
7266
|
+
const description$u = 'Optimize dependencies with @socketregistry overrides';
|
|
7267
|
+
const hidden$o = false;
|
|
7188
7268
|
const cmdOptimize = {
|
|
7189
|
-
description: description$
|
|
7190
|
-
hidden: hidden$
|
|
7191
|
-
run: run$
|
|
7269
|
+
description: description$u,
|
|
7270
|
+
hidden: hidden$o,
|
|
7271
|
+
run: run$u
|
|
7192
7272
|
};
|
|
7193
|
-
async function run$
|
|
7273
|
+
async function run$u(argv, importMeta, {
|
|
7194
7274
|
parentName
|
|
7195
7275
|
}) {
|
|
7196
7276
|
const config = {
|
|
7197
|
-
commandName: CMD_NAME$
|
|
7198
|
-
description: description$
|
|
7199
|
-
hidden: hidden$
|
|
7277
|
+
commandName: CMD_NAME$o,
|
|
7278
|
+
description: description$u,
|
|
7279
|
+
hidden: hidden$o,
|
|
7200
7280
|
flags: {
|
|
7201
7281
|
...flags.commonFlags,
|
|
7202
7282
|
pin: {
|
|
@@ -7215,14 +7295,14 @@ async function run$s(argv, importMeta, {
|
|
|
7215
7295
|
$ ${command} [options] [CWD=.]
|
|
7216
7296
|
|
|
7217
7297
|
API Token Requirements
|
|
7218
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7298
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$o}`)}
|
|
7219
7299
|
|
|
7220
7300
|
Options
|
|
7221
7301
|
${utils.getFlagListOutput(config.flags)}
|
|
7222
7302
|
|
|
7223
7303
|
Examples
|
|
7224
7304
|
$ ${command}
|
|
7225
|
-
$ ${command} ./
|
|
7305
|
+
$ ${command} ./path/to/project --pin
|
|
7226
7306
|
`
|
|
7227
7307
|
};
|
|
7228
7308
|
const cli = utils.meowOrExit({
|
|
@@ -7358,21 +7438,21 @@ async function handleDependencies({
|
|
|
7358
7438
|
});
|
|
7359
7439
|
}
|
|
7360
7440
|
|
|
7361
|
-
const CMD_NAME$
|
|
7362
|
-
const description$
|
|
7363
|
-
const hidden$
|
|
7441
|
+
const CMD_NAME$n = 'dependencies';
|
|
7442
|
+
const description$t = 'Search for any dependency that is being used in your organization';
|
|
7443
|
+
const hidden$n = false;
|
|
7364
7444
|
const cmdOrganizationDependencies = {
|
|
7365
|
-
description: description$
|
|
7366
|
-
hidden: hidden$
|
|
7367
|
-
run: run$
|
|
7445
|
+
description: description$t,
|
|
7446
|
+
hidden: hidden$n,
|
|
7447
|
+
run: run$t
|
|
7368
7448
|
};
|
|
7369
|
-
async function run$
|
|
7449
|
+
async function run$t(argv, importMeta, {
|
|
7370
7450
|
parentName
|
|
7371
7451
|
}) {
|
|
7372
7452
|
const config = {
|
|
7373
|
-
commandName: CMD_NAME$
|
|
7374
|
-
description: description$
|
|
7375
|
-
hidden: hidden$
|
|
7453
|
+
commandName: CMD_NAME$n,
|
|
7454
|
+
description: description$t,
|
|
7455
|
+
hidden: hidden$n,
|
|
7376
7456
|
flags: {
|
|
7377
7457
|
...flags.commonFlags,
|
|
7378
7458
|
limit: {
|
|
@@ -7392,7 +7472,7 @@ async function run$r(argv, importMeta, {
|
|
|
7392
7472
|
${command} [options]
|
|
7393
7473
|
|
|
7394
7474
|
API Token Requirements
|
|
7395
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7475
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$n}`)}
|
|
7396
7476
|
|
|
7397
7477
|
Options
|
|
7398
7478
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7492,21 +7572,21 @@ async function handleLicensePolicy(orgSlug, outputKind) {
|
|
|
7492
7572
|
await outputLicensePolicy(data, outputKind);
|
|
7493
7573
|
}
|
|
7494
7574
|
|
|
7495
|
-
const CMD_NAME$
|
|
7496
|
-
const description$
|
|
7497
|
-
const hidden$
|
|
7575
|
+
const CMD_NAME$m = 'license';
|
|
7576
|
+
const description$s = 'Retrieve the license policy of an organization';
|
|
7577
|
+
const hidden$m = false;
|
|
7498
7578
|
const cmdOrganizationPolicyLicense = {
|
|
7499
|
-
description: description$
|
|
7500
|
-
hidden: hidden$
|
|
7501
|
-
run: run$
|
|
7579
|
+
description: description$s,
|
|
7580
|
+
hidden: hidden$m,
|
|
7581
|
+
run: run$s
|
|
7502
7582
|
};
|
|
7503
|
-
async function run$
|
|
7583
|
+
async function run$s(argv, importMeta, {
|
|
7504
7584
|
parentName
|
|
7505
7585
|
}) {
|
|
7506
7586
|
const config = {
|
|
7507
|
-
commandName: CMD_NAME$
|
|
7508
|
-
description: description$
|
|
7509
|
-
hidden: hidden$
|
|
7587
|
+
commandName: CMD_NAME$m,
|
|
7588
|
+
description: description$s,
|
|
7589
|
+
hidden: hidden$m,
|
|
7510
7590
|
flags: {
|
|
7511
7591
|
...flags.commonFlags,
|
|
7512
7592
|
...flags.outputFlags,
|
|
@@ -7525,7 +7605,7 @@ async function run$q(argv, importMeta, {
|
|
|
7525
7605
|
$ ${command} [options]
|
|
7526
7606
|
|
|
7527
7607
|
API Token Requirements
|
|
7528
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7608
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$m}`)}
|
|
7529
7609
|
|
|
7530
7610
|
Options
|
|
7531
7611
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7628,21 +7708,21 @@ async function handleSecurityPolicy(orgSlug, outputKind) {
|
|
|
7628
7708
|
await outputSecurityPolicy(data, outputKind);
|
|
7629
7709
|
}
|
|
7630
7710
|
|
|
7631
|
-
const CMD_NAME$
|
|
7632
|
-
const description$
|
|
7633
|
-
const hidden$
|
|
7711
|
+
const CMD_NAME$l = 'security';
|
|
7712
|
+
const description$r = 'Retrieve the security policy of an organization';
|
|
7713
|
+
const hidden$l = true;
|
|
7634
7714
|
const cmdOrganizationPolicySecurity = {
|
|
7635
|
-
description: description$
|
|
7636
|
-
hidden: hidden$
|
|
7637
|
-
run: run$
|
|
7715
|
+
description: description$r,
|
|
7716
|
+
hidden: hidden$l,
|
|
7717
|
+
run: run$r
|
|
7638
7718
|
};
|
|
7639
|
-
async function run$
|
|
7719
|
+
async function run$r(argv, importMeta, {
|
|
7640
7720
|
parentName
|
|
7641
7721
|
}) {
|
|
7642
7722
|
const config = {
|
|
7643
|
-
commandName: CMD_NAME$
|
|
7644
|
-
description: description$
|
|
7645
|
-
hidden: hidden$
|
|
7723
|
+
commandName: CMD_NAME$l,
|
|
7724
|
+
description: description$r,
|
|
7725
|
+
hidden: hidden$l,
|
|
7646
7726
|
flags: {
|
|
7647
7727
|
...flags.commonFlags,
|
|
7648
7728
|
...flags.outputFlags,
|
|
@@ -7661,7 +7741,7 @@ async function run$p(argv, importMeta, {
|
|
|
7661
7741
|
$ ${command} [options]
|
|
7662
7742
|
|
|
7663
7743
|
API Token Requirements
|
|
7664
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7744
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$l}`)}
|
|
7665
7745
|
|
|
7666
7746
|
Options
|
|
7667
7747
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7765,21 +7845,21 @@ async function handleOrganizationList(outputKind = 'text') {
|
|
|
7765
7845
|
await outputOrganizationList(data, outputKind);
|
|
7766
7846
|
}
|
|
7767
7847
|
|
|
7768
|
-
const CMD_NAME$
|
|
7769
|
-
const description$
|
|
7770
|
-
const hidden$
|
|
7848
|
+
const CMD_NAME$k = 'list';
|
|
7849
|
+
const description$q = 'List organizations associated with the Socket API token';
|
|
7850
|
+
const hidden$k = false;
|
|
7771
7851
|
const cmdOrganizationList = {
|
|
7772
|
-
description: description$
|
|
7773
|
-
hidden: hidden$
|
|
7774
|
-
run: run$
|
|
7852
|
+
description: description$q,
|
|
7853
|
+
hidden: hidden$k,
|
|
7854
|
+
run: run$q
|
|
7775
7855
|
};
|
|
7776
|
-
async function run$
|
|
7856
|
+
async function run$q(argv, importMeta, {
|
|
7777
7857
|
parentName
|
|
7778
7858
|
}) {
|
|
7779
7859
|
const config = {
|
|
7780
|
-
commandName: CMD_NAME$
|
|
7781
|
-
description: description$
|
|
7782
|
-
hidden: hidden$
|
|
7860
|
+
commandName: CMD_NAME$k,
|
|
7861
|
+
description: description$q,
|
|
7862
|
+
hidden: hidden$k,
|
|
7783
7863
|
flags: {
|
|
7784
7864
|
...flags.commonFlags,
|
|
7785
7865
|
...flags.outputFlags
|
|
@@ -7789,7 +7869,7 @@ async function run$o(argv, importMeta, {
|
|
|
7789
7869
|
$ ${command} [options]
|
|
7790
7870
|
|
|
7791
7871
|
API Token Requirements
|
|
7792
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
7872
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$k}`)}
|
|
7793
7873
|
|
|
7794
7874
|
Options
|
|
7795
7875
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -7833,9 +7913,9 @@ async function run$o(argv, importMeta, {
|
|
|
7833
7913
|
await handleOrganizationList(outputKind);
|
|
7834
7914
|
}
|
|
7835
7915
|
|
|
7836
|
-
const description$
|
|
7916
|
+
const description$p = 'Organization policy details';
|
|
7837
7917
|
const cmdOrganizationPolicy = {
|
|
7838
|
-
description: description$
|
|
7918
|
+
description: description$p,
|
|
7839
7919
|
// Hidden because it was broken all this time (nobody could be using it)
|
|
7840
7920
|
// and we're not sure if it's useful to anyone in its current state.
|
|
7841
7921
|
// Until we do, we'll hide this to keep the help tidier.
|
|
@@ -7849,7 +7929,7 @@ const cmdOrganizationPolicy = {
|
|
|
7849
7929
|
license: cmdOrganizationPolicyLicense
|
|
7850
7930
|
}, {
|
|
7851
7931
|
argv,
|
|
7852
|
-
description: description$
|
|
7932
|
+
description: description$p,
|
|
7853
7933
|
defaultSub: 'list',
|
|
7854
7934
|
// Backwards compat
|
|
7855
7935
|
importMeta,
|
|
@@ -7926,9 +8006,9 @@ const config$5 = {
|
|
|
7926
8006
|
const cmdOrganizationQuota = {
|
|
7927
8007
|
description: config$5.description,
|
|
7928
8008
|
hidden: config$5.hidden,
|
|
7929
|
-
run: run$
|
|
8009
|
+
run: run$p
|
|
7930
8010
|
};
|
|
7931
|
-
async function run$
|
|
8011
|
+
async function run$p(argv, importMeta, {
|
|
7932
8012
|
parentName
|
|
7933
8013
|
}) {
|
|
7934
8014
|
const cli = utils.meowOrExit({
|
|
@@ -7963,9 +8043,9 @@ async function run$n(argv, importMeta, {
|
|
|
7963
8043
|
await handleQuota(outputKind);
|
|
7964
8044
|
}
|
|
7965
8045
|
|
|
7966
|
-
const description$
|
|
8046
|
+
const description$o = 'Manage Socket organization account details';
|
|
7967
8047
|
const cmdOrganization = {
|
|
7968
|
-
description: description$
|
|
8048
|
+
description: description$o,
|
|
7969
8049
|
hidden: false,
|
|
7970
8050
|
async run(argv, importMeta, {
|
|
7971
8051
|
parentName
|
|
@@ -7994,7 +8074,7 @@ const cmdOrganization = {
|
|
|
7994
8074
|
}
|
|
7995
8075
|
},
|
|
7996
8076
|
argv,
|
|
7997
|
-
description: description$
|
|
8077
|
+
description: description$o,
|
|
7998
8078
|
importMeta,
|
|
7999
8079
|
name: `${parentName} organization`
|
|
8000
8080
|
});
|
|
@@ -8219,21 +8299,21 @@ function parsePackageSpecifiers(ecosystem, pkgs) {
|
|
|
8219
8299
|
};
|
|
8220
8300
|
}
|
|
8221
8301
|
|
|
8222
|
-
const CMD_NAME$
|
|
8223
|
-
const description$
|
|
8224
|
-
const hidden$
|
|
8302
|
+
const CMD_NAME$j = 'score';
|
|
8303
|
+
const description$n = 'Look up score for one package which reflects all of its transitive dependencies as well';
|
|
8304
|
+
const hidden$j = false;
|
|
8225
8305
|
const cmdPackageScore = {
|
|
8226
|
-
description: description$
|
|
8227
|
-
hidden: hidden$
|
|
8228
|
-
run: run$
|
|
8306
|
+
description: description$n,
|
|
8307
|
+
hidden: hidden$j,
|
|
8308
|
+
run: run$o
|
|
8229
8309
|
};
|
|
8230
|
-
async function run$
|
|
8310
|
+
async function run$o(argv, importMeta, {
|
|
8231
8311
|
parentName
|
|
8232
8312
|
}) {
|
|
8233
8313
|
const config = {
|
|
8234
|
-
commandName: CMD_NAME$
|
|
8235
|
-
description: description$
|
|
8236
|
-
hidden: hidden$
|
|
8314
|
+
commandName: CMD_NAME$j,
|
|
8315
|
+
description: description$n,
|
|
8316
|
+
hidden: hidden$j,
|
|
8237
8317
|
flags: {
|
|
8238
8318
|
...flags.commonFlags,
|
|
8239
8319
|
...flags.outputFlags
|
|
@@ -8243,7 +8323,7 @@ async function run$m(argv, importMeta, {
|
|
|
8243
8323
|
$ ${command} [options] <<ECOSYSTEM> <NAME> | <PURL>>
|
|
8244
8324
|
|
|
8245
8325
|
API Token Requirements
|
|
8246
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
8326
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$j}`)}
|
|
8247
8327
|
|
|
8248
8328
|
Options
|
|
8249
8329
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -8450,7 +8530,7 @@ function getAlertString(alerts, options) {
|
|
|
8450
8530
|
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
8531
|
}
|
|
8452
8532
|
function preProcess(artifacts, requestedPurls) {
|
|
8453
|
-
// Dedupe results (for example,
|
|
8533
|
+
// Dedupe results (for example, PyPI will emit one package for each system release (win/mac/cpu) even if it's
|
|
8454
8534
|
// the same package version with same results. The duplication is irrelevant and annoying to the user.
|
|
8455
8535
|
|
|
8456
8536
|
// Make some effort to match the requested data with the response
|
|
@@ -8601,28 +8681,28 @@ async function handlePurlsShallowScore({
|
|
|
8601
8681
|
outputPurlsShallowScore(purls, packageData, outputKind);
|
|
8602
8682
|
}
|
|
8603
8683
|
|
|
8604
|
-
const CMD_NAME$
|
|
8605
|
-
const description$
|
|
8606
|
-
const hidden$
|
|
8684
|
+
const CMD_NAME$i = 'shallow';
|
|
8685
|
+
const description$m = 'Look up info regarding one or more packages but not their transitives';
|
|
8686
|
+
const hidden$i = false;
|
|
8607
8687
|
const cmdPackageShallow = {
|
|
8608
|
-
description: description$
|
|
8609
|
-
hidden: hidden$
|
|
8688
|
+
description: description$m,
|
|
8689
|
+
hidden: hidden$i,
|
|
8610
8690
|
alias: {
|
|
8611
8691
|
shallowScore: {
|
|
8612
|
-
description: description$
|
|
8692
|
+
description: description$m,
|
|
8613
8693
|
hidden: true,
|
|
8614
8694
|
argv: []
|
|
8615
8695
|
}
|
|
8616
8696
|
},
|
|
8617
|
-
run: run$
|
|
8697
|
+
run: run$n
|
|
8618
8698
|
};
|
|
8619
|
-
async function run$
|
|
8699
|
+
async function run$n(argv, importMeta, {
|
|
8620
8700
|
parentName
|
|
8621
8701
|
}) {
|
|
8622
8702
|
const config = {
|
|
8623
|
-
commandName: CMD_NAME$
|
|
8624
|
-
description: description$
|
|
8625
|
-
hidden: hidden$
|
|
8703
|
+
commandName: CMD_NAME$i,
|
|
8704
|
+
description: description$m,
|
|
8705
|
+
hidden: hidden$i,
|
|
8626
8706
|
flags: {
|
|
8627
8707
|
...flags.commonFlags,
|
|
8628
8708
|
...flags.outputFlags
|
|
@@ -8632,7 +8712,7 @@ async function run$l(argv, importMeta, {
|
|
|
8632
8712
|
$ ${command} [options] <<ECOSYSTEM> <PKGNAME> [<PKGNAME> ...] | <PURL> [<PURL> ...]>
|
|
8633
8713
|
|
|
8634
8714
|
API Token Requirements
|
|
8635
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
8715
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$i}`)}
|
|
8636
8716
|
|
|
8637
8717
|
Options
|
|
8638
8718
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -8706,9 +8786,9 @@ async function run$l(argv, importMeta, {
|
|
|
8706
8786
|
});
|
|
8707
8787
|
}
|
|
8708
8788
|
|
|
8709
|
-
const description$
|
|
8789
|
+
const description$l = 'Look up published package details';
|
|
8710
8790
|
const cmdPackage = {
|
|
8711
|
-
description: description$
|
|
8791
|
+
description: description$l,
|
|
8712
8792
|
hidden: false,
|
|
8713
8793
|
async run(argv, importMeta, {
|
|
8714
8794
|
parentName
|
|
@@ -8719,13 +8799,13 @@ const cmdPackage = {
|
|
|
8719
8799
|
}, {
|
|
8720
8800
|
aliases: {
|
|
8721
8801
|
deep: {
|
|
8722
|
-
description: description$
|
|
8802
|
+
description: description$l,
|
|
8723
8803
|
hidden: true,
|
|
8724
8804
|
argv: ['score']
|
|
8725
8805
|
}
|
|
8726
8806
|
},
|
|
8727
8807
|
argv,
|
|
8728
|
-
description: description$
|
|
8808
|
+
description: description$l,
|
|
8729
8809
|
importMeta,
|
|
8730
8810
|
name: `${parentName} package`
|
|
8731
8811
|
});
|
|
@@ -8779,7 +8859,7 @@ async function outputPatchResult(result, outputKind) {
|
|
|
8779
8859
|
}
|
|
8780
8860
|
logger.logger.groupEnd();
|
|
8781
8861
|
} else {
|
|
8782
|
-
logger.logger.warn('No packages found requiring patches');
|
|
8862
|
+
logger.logger.warn('No packages found requiring patches.');
|
|
8783
8863
|
}
|
|
8784
8864
|
logger.logger.log('');
|
|
8785
8865
|
logger.logger.success('Patch command completed!');
|
|
@@ -9095,21 +9175,21 @@ async function handlePatch({
|
|
|
9095
9175
|
}
|
|
9096
9176
|
}
|
|
9097
9177
|
|
|
9098
|
-
const CMD_NAME$
|
|
9099
|
-
const description$
|
|
9100
|
-
const hidden$
|
|
9178
|
+
const CMD_NAME$h = 'patch';
|
|
9179
|
+
const description$k = 'Apply CVE patches to dependencies';
|
|
9180
|
+
const hidden$h = true;
|
|
9101
9181
|
const cmdPatch = {
|
|
9102
|
-
description: description$
|
|
9103
|
-
hidden: hidden$
|
|
9104
|
-
run: run$
|
|
9182
|
+
description: description$k,
|
|
9183
|
+
hidden: hidden$h,
|
|
9184
|
+
run: run$m
|
|
9105
9185
|
};
|
|
9106
|
-
async function run$
|
|
9186
|
+
async function run$m(argv, importMeta, {
|
|
9107
9187
|
parentName
|
|
9108
9188
|
}) {
|
|
9109
9189
|
const config = {
|
|
9110
|
-
commandName: CMD_NAME$
|
|
9111
|
-
description: description$
|
|
9112
|
-
hidden: hidden$
|
|
9190
|
+
commandName: CMD_NAME$h,
|
|
9191
|
+
description: description$k,
|
|
9192
|
+
hidden: hidden$h,
|
|
9113
9193
|
flags: {
|
|
9114
9194
|
...flags.commonFlags,
|
|
9115
9195
|
...flags.outputFlags,
|
|
@@ -9126,7 +9206,7 @@ async function run$k(argv, importMeta, {
|
|
|
9126
9206
|
$ ${command} [options] [CWD=.]
|
|
9127
9207
|
|
|
9128
9208
|
API Token Requirements
|
|
9129
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
9209
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$h}`)}
|
|
9130
9210
|
|
|
9131
9211
|
Options
|
|
9132
9212
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -9134,7 +9214,7 @@ async function run$k(argv, importMeta, {
|
|
|
9134
9214
|
Examples
|
|
9135
9215
|
$ ${command}
|
|
9136
9216
|
$ ${command} --package lodash
|
|
9137
|
-
$ ${command} ./
|
|
9217
|
+
$ ${command} ./path/to/project --package lodash,react
|
|
9138
9218
|
`
|
|
9139
9219
|
};
|
|
9140
9220
|
const cli = utils.meowOrExit({
|
|
@@ -9186,6 +9266,71 @@ async function run$k(argv, importMeta, {
|
|
|
9186
9266
|
});
|
|
9187
9267
|
}
|
|
9188
9268
|
|
|
9269
|
+
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)));
|
|
9270
|
+
const CMD_NAME$g = constants.PNPM;
|
|
9271
|
+
const description$j = 'Run pnpm with the Socket wrapper';
|
|
9272
|
+
const hidden$g = true;
|
|
9273
|
+
const cmdPnpm = {
|
|
9274
|
+
description: description$j,
|
|
9275
|
+
hidden: hidden$g,
|
|
9276
|
+
run: run$l
|
|
9277
|
+
};
|
|
9278
|
+
async function run$l(argv, importMeta, context) {
|
|
9279
|
+
const {
|
|
9280
|
+
parentName
|
|
9281
|
+
} = {
|
|
9282
|
+
__proto__: null,
|
|
9283
|
+
...context
|
|
9284
|
+
};
|
|
9285
|
+
const config = {
|
|
9286
|
+
commandName: CMD_NAME$g,
|
|
9287
|
+
description: description$j,
|
|
9288
|
+
hidden: hidden$g,
|
|
9289
|
+
flags: {
|
|
9290
|
+
...flags.commonFlags
|
|
9291
|
+
},
|
|
9292
|
+
help: command => `
|
|
9293
|
+
Usage
|
|
9294
|
+
$ ${command} ...
|
|
9295
|
+
|
|
9296
|
+
API Token Requirements
|
|
9297
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$g}`)}
|
|
9298
|
+
|
|
9299
|
+
Note: Everything after "pnpm" is passed to the pnpm command.
|
|
9300
|
+
Only the \`--dry-run\` and \`--help\` flags are caught here.
|
|
9301
|
+
|
|
9302
|
+
Use \`socket wrapper on\` to alias this command as \`pnpm\`.
|
|
9303
|
+
|
|
9304
|
+
Examples
|
|
9305
|
+
$ ${command}
|
|
9306
|
+
$ ${command} install
|
|
9307
|
+
$ ${command} add package-name
|
|
9308
|
+
$ ${command} dlx package-name
|
|
9309
|
+
`
|
|
9310
|
+
};
|
|
9311
|
+
const cli = utils.meowOrExit({
|
|
9312
|
+
argv,
|
|
9313
|
+
config,
|
|
9314
|
+
importMeta,
|
|
9315
|
+
parentName
|
|
9316
|
+
});
|
|
9317
|
+
const dryRun = !!cli.flags['dryRun'];
|
|
9318
|
+
if (dryRun) {
|
|
9319
|
+
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
9320
|
+
return;
|
|
9321
|
+
}
|
|
9322
|
+
const shadowBin = /*@__PURE__*/require$3(constants.default.shadowPnpmBinPath);
|
|
9323
|
+
process.exitCode = 1;
|
|
9324
|
+
|
|
9325
|
+
// Filter Socket flags from argv.
|
|
9326
|
+
const filteredArgv = utils.filterFlags(argv, config.flags);
|
|
9327
|
+
const {
|
|
9328
|
+
spawnPromise
|
|
9329
|
+
} = await shadowBin(filteredArgv);
|
|
9330
|
+
await spawnPromise;
|
|
9331
|
+
process.exitCode = 0;
|
|
9332
|
+
}
|
|
9333
|
+
|
|
9189
9334
|
async function runRawNpm(argv) {
|
|
9190
9335
|
process.exitCode = 1;
|
|
9191
9336
|
const spawnPromise = spawn.spawn(utils.getNpmBinPath(), argv, {
|
|
@@ -9230,9 +9375,9 @@ const config$4 = {
|
|
|
9230
9375
|
const cmdRawNpm = {
|
|
9231
9376
|
description: config$4.description,
|
|
9232
9377
|
hidden: config$4.hidden,
|
|
9233
|
-
run: run$
|
|
9378
|
+
run: run$k
|
|
9234
9379
|
};
|
|
9235
|
-
async function run$
|
|
9380
|
+
async function run$k(argv, importMeta, {
|
|
9236
9381
|
parentName
|
|
9237
9382
|
}) {
|
|
9238
9383
|
const cli = utils.meowOrExit({
|
|
@@ -9293,9 +9438,9 @@ const config$3 = {
|
|
|
9293
9438
|
const cmdRawNpx = {
|
|
9294
9439
|
description: config$3.description,
|
|
9295
9440
|
hidden: config$3.hidden,
|
|
9296
|
-
run: run$
|
|
9441
|
+
run: run$j
|
|
9297
9442
|
};
|
|
9298
|
-
async function run$
|
|
9443
|
+
async function run$j(argv, importMeta, {
|
|
9299
9444
|
parentName
|
|
9300
9445
|
}) {
|
|
9301
9446
|
const cli = utils.meowOrExit({
|
|
@@ -9380,21 +9525,21 @@ async function handleCreateRepo({
|
|
|
9380
9525
|
outputCreateRepo(data, repoName, outputKind);
|
|
9381
9526
|
}
|
|
9382
9527
|
|
|
9383
|
-
const CMD_NAME$
|
|
9384
|
-
const description$
|
|
9385
|
-
const hidden$
|
|
9528
|
+
const CMD_NAME$f = 'create';
|
|
9529
|
+
const description$i = 'Create a repository in an organization';
|
|
9530
|
+
const hidden$f = false;
|
|
9386
9531
|
const cmdRepositoryCreate = {
|
|
9387
|
-
description: description$
|
|
9388
|
-
hidden: hidden$
|
|
9389
|
-
run: run$
|
|
9532
|
+
description: description$i,
|
|
9533
|
+
hidden: hidden$f,
|
|
9534
|
+
run: run$i
|
|
9390
9535
|
};
|
|
9391
|
-
async function run$
|
|
9536
|
+
async function run$i(argv, importMeta, {
|
|
9392
9537
|
parentName
|
|
9393
9538
|
}) {
|
|
9394
9539
|
const config = {
|
|
9395
|
-
commandName: CMD_NAME$
|
|
9396
|
-
description: description$
|
|
9397
|
-
hidden: hidden$
|
|
9540
|
+
commandName: CMD_NAME$f,
|
|
9541
|
+
description: description$i,
|
|
9542
|
+
hidden: hidden$f,
|
|
9398
9543
|
flags: {
|
|
9399
9544
|
...flags.commonFlags,
|
|
9400
9545
|
...flags.outputFlags,
|
|
@@ -9433,7 +9578,7 @@ async function run$h(argv, importMeta, {
|
|
|
9433
9578
|
$ ${command} [options] <REPO>
|
|
9434
9579
|
|
|
9435
9580
|
API Token Requirements
|
|
9436
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
9581
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$f}`)}
|
|
9437
9582
|
|
|
9438
9583
|
The REPO name should be a "slug". Follows the same naming convention as GitHub.
|
|
9439
9584
|
|
|
@@ -9539,21 +9684,21 @@ async function handleDeleteRepo(orgSlug, repoName, outputKind) {
|
|
|
9539
9684
|
await outputDeleteRepo(data, repoName, outputKind);
|
|
9540
9685
|
}
|
|
9541
9686
|
|
|
9542
|
-
const CMD_NAME$
|
|
9543
|
-
const description$
|
|
9544
|
-
const hidden$
|
|
9687
|
+
const CMD_NAME$e = 'del';
|
|
9688
|
+
const description$h = 'Delete a repository in an organization';
|
|
9689
|
+
const hidden$e = false;
|
|
9545
9690
|
const cmdRepositoryDel = {
|
|
9546
|
-
description: description$
|
|
9547
|
-
hidden: hidden$
|
|
9548
|
-
run: run$
|
|
9691
|
+
description: description$h,
|
|
9692
|
+
hidden: hidden$e,
|
|
9693
|
+
run: run$h
|
|
9549
9694
|
};
|
|
9550
|
-
async function run$
|
|
9695
|
+
async function run$h(argv, importMeta, {
|
|
9551
9696
|
parentName
|
|
9552
9697
|
}) {
|
|
9553
9698
|
const config = {
|
|
9554
|
-
commandName: CMD_NAME$
|
|
9555
|
-
description: description$
|
|
9556
|
-
hidden: hidden$
|
|
9699
|
+
commandName: CMD_NAME$e,
|
|
9700
|
+
description: description$h,
|
|
9701
|
+
hidden: hidden$e,
|
|
9557
9702
|
flags: {
|
|
9558
9703
|
...flags.commonFlags,
|
|
9559
9704
|
...flags.outputFlags,
|
|
@@ -9572,7 +9717,7 @@ async function run$g(argv, importMeta, {
|
|
|
9572
9717
|
$ ${command} [options] <REPO>
|
|
9573
9718
|
|
|
9574
9719
|
API Token Requirements
|
|
9575
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
9720
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$e}`)}
|
|
9576
9721
|
|
|
9577
9722
|
Options
|
|
9578
9723
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -9802,21 +9947,21 @@ async function handleListRepos({
|
|
|
9802
9947
|
}
|
|
9803
9948
|
}
|
|
9804
9949
|
|
|
9805
|
-
const CMD_NAME$
|
|
9806
|
-
const description$
|
|
9807
|
-
const hidden$
|
|
9950
|
+
const CMD_NAME$d = 'list';
|
|
9951
|
+
const description$g = 'List repositories in an organization';
|
|
9952
|
+
const hidden$d = false;
|
|
9808
9953
|
const cmdRepositoryList = {
|
|
9809
|
-
description: description$
|
|
9810
|
-
hidden: hidden$
|
|
9811
|
-
run: run$
|
|
9954
|
+
description: description$g,
|
|
9955
|
+
hidden: hidden$d,
|
|
9956
|
+
run: run$g
|
|
9812
9957
|
};
|
|
9813
|
-
async function run$
|
|
9958
|
+
async function run$g(argv, importMeta, {
|
|
9814
9959
|
parentName
|
|
9815
9960
|
}) {
|
|
9816
9961
|
const config = {
|
|
9817
|
-
commandName: CMD_NAME$
|
|
9818
|
-
description: description$
|
|
9819
|
-
hidden: hidden$
|
|
9962
|
+
commandName: CMD_NAME$d,
|
|
9963
|
+
description: description$g,
|
|
9964
|
+
hidden: hidden$d,
|
|
9820
9965
|
flags: {
|
|
9821
9966
|
...flags.commonFlags,
|
|
9822
9967
|
...flags.outputFlags,
|
|
@@ -9837,25 +9982,26 @@ async function run$f(argv, importMeta, {
|
|
|
9837
9982
|
},
|
|
9838
9983
|
org: {
|
|
9839
9984
|
type: 'string',
|
|
9985
|
+
default: '',
|
|
9840
9986
|
description: 'Force override the organization slug, overrides the default org from config'
|
|
9841
9987
|
},
|
|
9842
9988
|
perPage: {
|
|
9843
9989
|
type: 'number',
|
|
9844
|
-
shortFlag: 'pp',
|
|
9845
9990
|
default: 30,
|
|
9846
|
-
description: 'Number of results per page'
|
|
9991
|
+
description: 'Number of results per page',
|
|
9992
|
+
shortFlag: 'pp'
|
|
9847
9993
|
},
|
|
9848
9994
|
page: {
|
|
9849
9995
|
type: 'number',
|
|
9850
|
-
shortFlag: 'p',
|
|
9851
9996
|
default: 1,
|
|
9852
|
-
description: 'Page number'
|
|
9997
|
+
description: 'Page number',
|
|
9998
|
+
shortFlag: 'p'
|
|
9853
9999
|
},
|
|
9854
10000
|
sort: {
|
|
9855
10001
|
type: 'string',
|
|
9856
|
-
shortFlag: 's',
|
|
9857
10002
|
default: 'created_at',
|
|
9858
|
-
description: 'Sorting option'
|
|
10003
|
+
description: 'Sorting option',
|
|
10004
|
+
shortFlag: 's'
|
|
9859
10005
|
}
|
|
9860
10006
|
},
|
|
9861
10007
|
help: (command, config) => `
|
|
@@ -9863,7 +10009,7 @@ async function run$f(argv, importMeta, {
|
|
|
9863
10009
|
$ ${command} [options]
|
|
9864
10010
|
|
|
9865
10011
|
API Token Requirements
|
|
9866
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
10012
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$d}`)}
|
|
9867
10013
|
|
|
9868
10014
|
Options
|
|
9869
10015
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -9882,16 +10028,19 @@ async function run$f(argv, importMeta, {
|
|
|
9882
10028
|
const {
|
|
9883
10029
|
all,
|
|
9884
10030
|
direction = 'desc',
|
|
10031
|
+
dryRun,
|
|
10032
|
+
interactive,
|
|
9885
10033
|
json,
|
|
9886
10034
|
markdown,
|
|
9887
|
-
org: orgFlag
|
|
10035
|
+
org: orgFlag,
|
|
10036
|
+
page,
|
|
10037
|
+
perPage,
|
|
10038
|
+
sort
|
|
9888
10039
|
} = cli.flags;
|
|
9889
|
-
const dryRun = !!cli.flags['dryRun'];
|
|
9890
|
-
const interactive = !!cli.flags['interactive'];
|
|
9891
10040
|
const hasApiToken = utils.hasDefaultApiToken();
|
|
9892
10041
|
const {
|
|
9893
10042
|
0: orgSlug
|
|
9894
|
-
} = await utils.determineOrgSlug(
|
|
10043
|
+
} = await utils.determineOrgSlug(orgFlag, interactive, dryRun);
|
|
9895
10044
|
const outputKind = utils.getOutputKind(json, markdown);
|
|
9896
10045
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
9897
10046
|
nook: true,
|
|
@@ -9922,13 +10071,13 @@ async function run$f(argv, importMeta, {
|
|
|
9922
10071
|
return;
|
|
9923
10072
|
}
|
|
9924
10073
|
await handleListRepos({
|
|
9925
|
-
all
|
|
9926
|
-
direction
|
|
10074
|
+
all,
|
|
10075
|
+
direction,
|
|
9927
10076
|
orgSlug,
|
|
9928
10077
|
outputKind,
|
|
9929
|
-
page
|
|
9930
|
-
perPage
|
|
9931
|
-
sort
|
|
10078
|
+
page,
|
|
10079
|
+
perPage,
|
|
10080
|
+
sort
|
|
9932
10081
|
});
|
|
9933
10082
|
}
|
|
9934
10083
|
|
|
@@ -10001,21 +10150,21 @@ async function handleUpdateRepo({
|
|
|
10001
10150
|
await outputUpdateRepo(data, repoName, outputKind);
|
|
10002
10151
|
}
|
|
10003
10152
|
|
|
10004
|
-
const CMD_NAME$
|
|
10005
|
-
const description$
|
|
10006
|
-
const hidden$
|
|
10153
|
+
const CMD_NAME$c = 'update';
|
|
10154
|
+
const description$f = 'Update a repository in an organization';
|
|
10155
|
+
const hidden$c = false;
|
|
10007
10156
|
const cmdRepositoryUpdate = {
|
|
10008
|
-
description: description$
|
|
10009
|
-
hidden: hidden$
|
|
10010
|
-
run: run$
|
|
10157
|
+
description: description$f,
|
|
10158
|
+
hidden: hidden$c,
|
|
10159
|
+
run: run$f
|
|
10011
10160
|
};
|
|
10012
|
-
async function run$
|
|
10161
|
+
async function run$f(argv, importMeta, {
|
|
10013
10162
|
parentName
|
|
10014
10163
|
}) {
|
|
10015
10164
|
const config = {
|
|
10016
|
-
commandName: CMD_NAME$
|
|
10017
|
-
description: description$
|
|
10018
|
-
hidden: hidden$
|
|
10165
|
+
commandName: CMD_NAME$c,
|
|
10166
|
+
description: description$f,
|
|
10167
|
+
hidden: hidden$c,
|
|
10019
10168
|
flags: {
|
|
10020
10169
|
...flags.commonFlags,
|
|
10021
10170
|
...flags.outputFlags,
|
|
@@ -10058,7 +10207,7 @@ async function run$e(argv, importMeta, {
|
|
|
10058
10207
|
$ ${command} [options] <REPO>
|
|
10059
10208
|
|
|
10060
10209
|
API Token Requirements
|
|
10061
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
10210
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$c}`)}
|
|
10062
10211
|
|
|
10063
10212
|
Options
|
|
10064
10213
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -10187,21 +10336,21 @@ async function handleViewRepo(orgSlug, repoName, outputKind) {
|
|
|
10187
10336
|
await outputViewRepo(data, outputKind);
|
|
10188
10337
|
}
|
|
10189
10338
|
|
|
10190
|
-
const CMD_NAME$
|
|
10191
|
-
const description$
|
|
10192
|
-
const hidden$
|
|
10339
|
+
const CMD_NAME$b = 'view';
|
|
10340
|
+
const description$e = 'View repositories in an organization';
|
|
10341
|
+
const hidden$b = false;
|
|
10193
10342
|
const cmdRepositoryView = {
|
|
10194
|
-
description: description$
|
|
10195
|
-
hidden: hidden$
|
|
10196
|
-
run: run$
|
|
10343
|
+
description: description$e,
|
|
10344
|
+
hidden: hidden$b,
|
|
10345
|
+
run: run$e
|
|
10197
10346
|
};
|
|
10198
|
-
async function run$
|
|
10347
|
+
async function run$e(argv, importMeta, {
|
|
10199
10348
|
parentName
|
|
10200
10349
|
}) {
|
|
10201
10350
|
const config = {
|
|
10202
|
-
commandName: CMD_NAME$
|
|
10203
|
-
description: description$
|
|
10204
|
-
hidden: hidden$
|
|
10351
|
+
commandName: CMD_NAME$b,
|
|
10352
|
+
description: description$e,
|
|
10353
|
+
hidden: hidden$b,
|
|
10205
10354
|
flags: {
|
|
10206
10355
|
...flags.commonFlags,
|
|
10207
10356
|
...flags.outputFlags,
|
|
@@ -10220,7 +10369,7 @@ async function run$d(argv, importMeta, {
|
|
|
10220
10369
|
$ ${command} [options] <REPO>
|
|
10221
10370
|
|
|
10222
10371
|
API Token Requirements
|
|
10223
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
10372
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$b}`)}
|
|
10224
10373
|
|
|
10225
10374
|
Options
|
|
10226
10375
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -10285,9 +10434,9 @@ async function run$d(argv, importMeta, {
|
|
|
10285
10434
|
await handleViewRepo(orgSlug, String(repoName), outputKind);
|
|
10286
10435
|
}
|
|
10287
10436
|
|
|
10288
|
-
const description$
|
|
10437
|
+
const description$d = 'Manage registered repositories';
|
|
10289
10438
|
const cmdRepository = {
|
|
10290
|
-
description: description$
|
|
10439
|
+
description: description$d,
|
|
10291
10440
|
async run(argv, importMeta, {
|
|
10292
10441
|
parentName
|
|
10293
10442
|
}) {
|
|
@@ -10299,7 +10448,7 @@ const cmdRepository = {
|
|
|
10299
10448
|
update: cmdRepositoryUpdate
|
|
10300
10449
|
}, {
|
|
10301
10450
|
argv,
|
|
10302
|
-
description: description$
|
|
10451
|
+
description: description$d,
|
|
10303
10452
|
importMeta,
|
|
10304
10453
|
name: `${parentName} repository`
|
|
10305
10454
|
});
|
|
@@ -10357,9 +10506,9 @@ async function suggestTarget() {
|
|
|
10357
10506
|
return proceed ? ['.'] : [];
|
|
10358
10507
|
}
|
|
10359
10508
|
|
|
10360
|
-
const CMD_NAME$
|
|
10361
|
-
const description$
|
|
10362
|
-
const hidden$
|
|
10509
|
+
const CMD_NAME$a = 'create';
|
|
10510
|
+
const description$c = 'Create a new Socket scan and report';
|
|
10511
|
+
const hidden$a = false;
|
|
10363
10512
|
const generalFlags$1 = {
|
|
10364
10513
|
...flags.commonFlags,
|
|
10365
10514
|
...flags.outputFlags,
|
|
@@ -10455,17 +10604,17 @@ const generalFlags$1 = {
|
|
|
10455
10604
|
}
|
|
10456
10605
|
};
|
|
10457
10606
|
const cmdScanCreate = {
|
|
10458
|
-
description: description$
|
|
10459
|
-
hidden: hidden$
|
|
10460
|
-
run: run$
|
|
10607
|
+
description: description$c,
|
|
10608
|
+
hidden: hidden$a,
|
|
10609
|
+
run: run$d
|
|
10461
10610
|
};
|
|
10462
|
-
async function run$
|
|
10611
|
+
async function run$d(argv, importMeta, {
|
|
10463
10612
|
parentName
|
|
10464
10613
|
}) {
|
|
10465
10614
|
const config = {
|
|
10466
|
-
commandName: CMD_NAME$
|
|
10467
|
-
description: description$
|
|
10468
|
-
hidden: hidden$
|
|
10615
|
+
commandName: CMD_NAME$a,
|
|
10616
|
+
description: description$c,
|
|
10617
|
+
hidden: hidden$a,
|
|
10469
10618
|
flags: {
|
|
10470
10619
|
...generalFlags$1,
|
|
10471
10620
|
...reachabilityFlags
|
|
@@ -10476,7 +10625,7 @@ async function run$c(argv, importMeta, {
|
|
|
10476
10625
|
$ ${command} [options] [TARGET...]
|
|
10477
10626
|
|
|
10478
10627
|
API Token Requirements
|
|
10479
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
10628
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$a}`)}
|
|
10480
10629
|
|
|
10481
10630
|
Options
|
|
10482
10631
|
${utils.getFlagListOutput(generalFlags$1)}
|
|
@@ -10485,7 +10634,7 @@ async function run$c(argv, importMeta, {
|
|
|
10485
10634
|
${utils.getFlagListOutput(reachabilityFlags)}
|
|
10486
10635
|
|
|
10487
10636
|
Uploads the specified dependency manifest files for Go, Gradle, JavaScript,
|
|
10488
|
-
Kotlin, Python, and Scala. Files like "package.json" and "
|
|
10637
|
+
Kotlin, Python, and Scala. Files like "package.json" and "${constants.REQUIREMENTS_TXT}".
|
|
10489
10638
|
If any folder is specified, the ones found in there recursively are uploaded.
|
|
10490
10639
|
|
|
10491
10640
|
Details on TARGET:
|
|
@@ -10495,7 +10644,7 @@ async function run$c(argv, importMeta, {
|
|
|
10495
10644
|
- If a target is a file, only that file is checked
|
|
10496
10645
|
- If it is a dir, the dir is scanned for any supported manifest files
|
|
10497
10646
|
- Dirs MUST be within the current dir (cwd), you can use --cwd to change it
|
|
10498
|
-
- Supports globbing such as "**/package.json", "
|
|
10647
|
+
- Supports globbing such as "**/package.json", "**/${constants.REQUIREMENTS_TXT}", etc.
|
|
10499
10648
|
- Ignores any file specified in your project's ".gitignore"
|
|
10500
10649
|
- Also a sensible set of default ignores from the "ignore-by-default" module
|
|
10501
10650
|
|
|
@@ -10570,13 +10719,13 @@ async function run$c(argv, importMeta, {
|
|
|
10570
10719
|
} = await utils.determineOrgSlug(String(orgFlag || ''), interactive, dryRun);
|
|
10571
10720
|
const processCwd = process.cwd();
|
|
10572
10721
|
const cwd = cwdOverride && cwdOverride !== '.' && cwdOverride !== processCwd ? path.resolve(processCwd, cwdOverride) : processCwd;
|
|
10573
|
-
const sockJson = utils.
|
|
10722
|
+
const sockJson = await utils.readOrDefaultSocketJsonUp(cwd);
|
|
10574
10723
|
|
|
10575
10724
|
// Note: This needs meow booleanDefault=undefined.
|
|
10576
10725
|
if (typeof autoManifest !== 'boolean') {
|
|
10577
10726
|
if (sockJson.defaults?.scan?.create?.autoManifest !== undefined) {
|
|
10578
10727
|
autoManifest = sockJson.defaults.scan.create.autoManifest;
|
|
10579
|
-
logger.logger.info(
|
|
10728
|
+
logger.logger.info(`Using default --auto-manifest from ${constants.SOCKET_JSON}:`, autoManifest);
|
|
10580
10729
|
} else {
|
|
10581
10730
|
autoManifest = false;
|
|
10582
10731
|
}
|
|
@@ -10584,7 +10733,7 @@ async function run$c(argv, importMeta, {
|
|
|
10584
10733
|
if (!branchName) {
|
|
10585
10734
|
if (sockJson.defaults?.scan?.create?.branch) {
|
|
10586
10735
|
branchName = sockJson.defaults.scan.create.branch;
|
|
10587
|
-
logger.logger.info(
|
|
10736
|
+
logger.logger.info(`Using default --branch from ${constants.SOCKET_JSON}:`, branchName);
|
|
10588
10737
|
} else {
|
|
10589
10738
|
branchName = (await utils.gitBranch(cwd)) || (await utils.detectDefaultBranch(cwd));
|
|
10590
10739
|
}
|
|
@@ -10592,7 +10741,7 @@ async function run$c(argv, importMeta, {
|
|
|
10592
10741
|
if (!repoName) {
|
|
10593
10742
|
if (sockJson.defaults?.scan?.create?.repo) {
|
|
10594
10743
|
repoName = sockJson.defaults.scan.create.repo;
|
|
10595
|
-
logger.logger.info(
|
|
10744
|
+
logger.logger.info(`Using default --repo from ${constants.SOCKET_JSON}:`, repoName);
|
|
10596
10745
|
} else {
|
|
10597
10746
|
repoName = await utils.getRepoName(cwd);
|
|
10598
10747
|
}
|
|
@@ -10600,7 +10749,7 @@ async function run$c(argv, importMeta, {
|
|
|
10600
10749
|
if (typeof report !== 'boolean') {
|
|
10601
10750
|
if (sockJson.defaults?.scan?.create?.report !== undefined) {
|
|
10602
10751
|
report = sockJson.defaults.scan.create.report;
|
|
10603
|
-
logger.logger.info(
|
|
10752
|
+
logger.logger.info(`Using default --report from ${constants.SOCKET_JSON}:`, report);
|
|
10604
10753
|
} else {
|
|
10605
10754
|
report = false;
|
|
10606
10755
|
}
|
|
@@ -10657,7 +10806,7 @@ async function run$c(argv, importMeta, {
|
|
|
10657
10806
|
logger.logger.error(` socket scan create [other flags...] ${orgSlug} ${targets.join(' ')}`);
|
|
10658
10807
|
logger.logger.error('```');
|
|
10659
10808
|
logger.logger.error('');
|
|
10660
|
-
logger.logger.info(
|
|
10809
|
+
logger.logger.info(`You can also run \`socket scan setup\` to persist these flag defaults to a ${constants.SOCKET_JSON} file.`);
|
|
10661
10810
|
logger.logger.error('');
|
|
10662
10811
|
}
|
|
10663
10812
|
const reachExcludePaths = utils.cmdFlagValueToArray(cli.flags['reachExcludePaths']);
|
|
@@ -10779,21 +10928,21 @@ async function handleDeleteScan(orgSlug, scanId, outputKind) {
|
|
|
10779
10928
|
await outputDeleteScan(data, outputKind);
|
|
10780
10929
|
}
|
|
10781
10930
|
|
|
10782
|
-
const CMD_NAME$
|
|
10783
|
-
const description$
|
|
10784
|
-
const hidden$
|
|
10931
|
+
const CMD_NAME$9 = 'del';
|
|
10932
|
+
const description$b = 'Delete a scan';
|
|
10933
|
+
const hidden$9 = false;
|
|
10785
10934
|
const cmdScanDel = {
|
|
10786
|
-
description: description$
|
|
10787
|
-
hidden: hidden$
|
|
10788
|
-
run: run$
|
|
10935
|
+
description: description$b,
|
|
10936
|
+
hidden: hidden$9,
|
|
10937
|
+
run: run$c
|
|
10789
10938
|
};
|
|
10790
|
-
async function run$
|
|
10939
|
+
async function run$c(argv, importMeta, {
|
|
10791
10940
|
parentName
|
|
10792
10941
|
}) {
|
|
10793
10942
|
const config = {
|
|
10794
|
-
commandName: CMD_NAME$
|
|
10795
|
-
description: description$
|
|
10796
|
-
hidden: hidden$
|
|
10943
|
+
commandName: CMD_NAME$9,
|
|
10944
|
+
description: description$b,
|
|
10945
|
+
hidden: hidden$9,
|
|
10797
10946
|
flags: {
|
|
10798
10947
|
...flags.commonFlags,
|
|
10799
10948
|
...flags.outputFlags,
|
|
@@ -10812,7 +10961,7 @@ async function run$b(argv, importMeta, {
|
|
|
10812
10961
|
$ ${command} [options] <SCAN_ID>
|
|
10813
10962
|
|
|
10814
10963
|
API Token Requirements
|
|
10815
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
10964
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$9}`)}
|
|
10816
10965
|
|
|
10817
10966
|
Options
|
|
10818
10967
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -11056,21 +11205,21 @@ async function handleDiffScan({
|
|
|
11056
11205
|
});
|
|
11057
11206
|
}
|
|
11058
11207
|
|
|
11059
|
-
const CMD_NAME$
|
|
11060
|
-
const description$
|
|
11061
|
-
const hidden$
|
|
11208
|
+
const CMD_NAME$8 = 'diff';
|
|
11209
|
+
const description$a = 'See what changed between two Scans';
|
|
11210
|
+
const hidden$8 = false;
|
|
11062
11211
|
const cmdScanDiff = {
|
|
11063
|
-
description: description$
|
|
11064
|
-
hidden: hidden$
|
|
11065
|
-
run: run$
|
|
11212
|
+
description: description$a,
|
|
11213
|
+
hidden: hidden$8,
|
|
11214
|
+
run: run$b
|
|
11066
11215
|
};
|
|
11067
|
-
async function run$
|
|
11216
|
+
async function run$b(argv, importMeta, {
|
|
11068
11217
|
parentName
|
|
11069
11218
|
}) {
|
|
11070
11219
|
const config = {
|
|
11071
|
-
commandName: CMD_NAME$
|
|
11072
|
-
description: description$
|
|
11073
|
-
hidden: hidden$
|
|
11220
|
+
commandName: CMD_NAME$8,
|
|
11221
|
+
description: description$a,
|
|
11222
|
+
hidden: hidden$8,
|
|
11074
11223
|
flags: {
|
|
11075
11224
|
...flags.commonFlags,
|
|
11076
11225
|
...flags.outputFlags,
|
|
@@ -11100,7 +11249,7 @@ async function run$a(argv, importMeta, {
|
|
|
11100
11249
|
$ ${command} [options] <SCAN_ID1> <SCAN_ID2>
|
|
11101
11250
|
|
|
11102
11251
|
API Token Requirements
|
|
11103
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
11252
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$8}`)}
|
|
11104
11253
|
|
|
11105
11254
|
This command displays the package changes between two scans. The full output
|
|
11106
11255
|
can be pretty large depending on the size of your repo and time range. It is
|
|
@@ -11128,12 +11277,12 @@ async function run$a(argv, importMeta, {
|
|
|
11128
11277
|
const SOCKET_SBOM_URL_PREFIX_LENGTH = SOCKET_SBOM_URL_PREFIX.length;
|
|
11129
11278
|
const {
|
|
11130
11279
|
depth,
|
|
11280
|
+
dryRun,
|
|
11131
11281
|
file,
|
|
11132
11282
|
json,
|
|
11133
11283
|
markdown,
|
|
11134
11284
|
org: orgFlag
|
|
11135
11285
|
} = cli.flags;
|
|
11136
|
-
const dryRun = !!cli.flags['dryRun'];
|
|
11137
11286
|
const interactive = !!cli.flags['interactive'];
|
|
11138
11287
|
let [id1 = '', id2 = ''] = cli.input;
|
|
11139
11288
|
// Support dropping in full socket urls to an sbom.
|
|
@@ -11176,12 +11325,12 @@ async function run$a(argv, importMeta, {
|
|
|
11176
11325
|
return;
|
|
11177
11326
|
}
|
|
11178
11327
|
await handleDiffScan({
|
|
11179
|
-
id1
|
|
11180
|
-
id2
|
|
11181
|
-
depth
|
|
11328
|
+
id1,
|
|
11329
|
+
id2,
|
|
11330
|
+
depth,
|
|
11182
11331
|
orgSlug,
|
|
11183
11332
|
outputKind,
|
|
11184
|
-
file
|
|
11333
|
+
file
|
|
11185
11334
|
});
|
|
11186
11335
|
}
|
|
11187
11336
|
|
|
@@ -11844,22 +11993,22 @@ async function handleCreateGithubScan({
|
|
|
11844
11993
|
await outputScanGithub(ghScanCResult, outputKind);
|
|
11845
11994
|
}
|
|
11846
11995
|
|
|
11847
|
-
const CMD_NAME$
|
|
11996
|
+
const CMD_NAME$7 = 'github';
|
|
11848
11997
|
const DEFAULT_GITHUB_URL = 'https://api.github.com';
|
|
11849
|
-
const description$
|
|
11850
|
-
const hidden$
|
|
11998
|
+
const description$9 = 'Create a scan for given GitHub repo';
|
|
11999
|
+
const hidden$7 = true;
|
|
11851
12000
|
const cmdScanGithub = {
|
|
11852
|
-
description: description$
|
|
11853
|
-
hidden: hidden$
|
|
11854
|
-
run: run$
|
|
12001
|
+
description: description$9,
|
|
12002
|
+
hidden: hidden$7,
|
|
12003
|
+
run: run$a
|
|
11855
12004
|
};
|
|
11856
|
-
async function run$
|
|
12005
|
+
async function run$a(argv, importMeta, {
|
|
11857
12006
|
parentName
|
|
11858
12007
|
}) {
|
|
11859
12008
|
const config = {
|
|
11860
|
-
commandName: CMD_NAME$
|
|
11861
|
-
description: description$
|
|
11862
|
-
hidden: hidden$
|
|
12009
|
+
commandName: CMD_NAME$7,
|
|
12010
|
+
description: description$9,
|
|
12011
|
+
hidden: hidden$7,
|
|
11863
12012
|
flags: {
|
|
11864
12013
|
...flags.commonFlags,
|
|
11865
12014
|
...flags.outputFlags,
|
|
@@ -11903,7 +12052,7 @@ async function run$9(argv, importMeta, {
|
|
|
11903
12052
|
$ ${command} [options] [CWD=.]
|
|
11904
12053
|
|
|
11905
12054
|
API Token Requirements
|
|
11906
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12055
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$7}`)}
|
|
11907
12056
|
|
|
11908
12057
|
This is similar to the \`socket scan create\` command except it pulls the files
|
|
11909
12058
|
from GitHub. See the help for that command for more details.
|
|
@@ -12160,21 +12309,21 @@ async function handleListScans({
|
|
|
12160
12309
|
await outputListScans(data, outputKind);
|
|
12161
12310
|
}
|
|
12162
12311
|
|
|
12163
|
-
const CMD_NAME$
|
|
12164
|
-
const description$
|
|
12165
|
-
const hidden$
|
|
12312
|
+
const CMD_NAME$6 = 'list';
|
|
12313
|
+
const description$8 = 'List the scans for an organization';
|
|
12314
|
+
const hidden$6 = false;
|
|
12166
12315
|
const cmdScanList = {
|
|
12167
|
-
description: description$
|
|
12168
|
-
hidden: hidden$
|
|
12169
|
-
run: run$
|
|
12316
|
+
description: description$8,
|
|
12317
|
+
hidden: hidden$6,
|
|
12318
|
+
run: run$9
|
|
12170
12319
|
};
|
|
12171
|
-
async function run$
|
|
12320
|
+
async function run$9(argv, importMeta, {
|
|
12172
12321
|
parentName
|
|
12173
12322
|
}) {
|
|
12174
12323
|
const config = {
|
|
12175
|
-
commandName: CMD_NAME$
|
|
12176
|
-
description: description$
|
|
12177
|
-
hidden: hidden$
|
|
12324
|
+
commandName: CMD_NAME$6,
|
|
12325
|
+
description: description$8,
|
|
12326
|
+
hidden: hidden$6,
|
|
12178
12327
|
flags: {
|
|
12179
12328
|
...flags.commonFlags,
|
|
12180
12329
|
...flags.outputFlags,
|
|
@@ -12233,7 +12382,7 @@ async function run$8(argv, importMeta, {
|
|
|
12233
12382
|
$ ${command} [options] [REPO [BRANCH]]
|
|
12234
12383
|
|
|
12235
12384
|
API Token Requirements
|
|
12236
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12385
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$6}`)}
|
|
12237
12386
|
|
|
12238
12387
|
Optionally filter by REPO. If you specify a repo, you can also specify a
|
|
12239
12388
|
branch to filter by. (Note: If you don't specify a repo then you must use
|
|
@@ -12369,21 +12518,21 @@ async function handleOrgScanMetadata(orgSlug, scanId, outputKind) {
|
|
|
12369
12518
|
await outputScanMetadata(data, scanId, outputKind);
|
|
12370
12519
|
}
|
|
12371
12520
|
|
|
12372
|
-
const CMD_NAME$
|
|
12373
|
-
const description$
|
|
12374
|
-
const hidden$
|
|
12521
|
+
const CMD_NAME$5 = 'metadata';
|
|
12522
|
+
const description$7 = "Get a scan's metadata";
|
|
12523
|
+
const hidden$5 = false;
|
|
12375
12524
|
const cmdScanMetadata = {
|
|
12376
|
-
description: description$
|
|
12377
|
-
hidden: hidden$
|
|
12378
|
-
run: run$
|
|
12525
|
+
description: description$7,
|
|
12526
|
+
hidden: hidden$5,
|
|
12527
|
+
run: run$8
|
|
12379
12528
|
};
|
|
12380
|
-
async function run$
|
|
12529
|
+
async function run$8(argv, importMeta, {
|
|
12381
12530
|
parentName
|
|
12382
12531
|
}) {
|
|
12383
12532
|
const config = {
|
|
12384
|
-
commandName: CMD_NAME$
|
|
12385
|
-
description: description$
|
|
12386
|
-
hidden: hidden$
|
|
12533
|
+
commandName: CMD_NAME$5,
|
|
12534
|
+
description: description$7,
|
|
12535
|
+
hidden: hidden$5,
|
|
12387
12536
|
flags: {
|
|
12388
12537
|
...flags.commonFlags,
|
|
12389
12538
|
...flags.outputFlags,
|
|
@@ -12402,7 +12551,7 @@ async function run$7(argv, importMeta, {
|
|
|
12402
12551
|
$ ${command} [options] <SCAN_ID>
|
|
12403
12552
|
|
|
12404
12553
|
API Token Requirements
|
|
12405
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12554
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$5}`)}
|
|
12406
12555
|
|
|
12407
12556
|
Options
|
|
12408
12557
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -12536,9 +12685,9 @@ async function handleScanReach({
|
|
|
12536
12685
|
});
|
|
12537
12686
|
}
|
|
12538
12687
|
|
|
12539
|
-
const CMD_NAME$
|
|
12540
|
-
const description$
|
|
12541
|
-
const hidden$
|
|
12688
|
+
const CMD_NAME$4 = 'reach';
|
|
12689
|
+
const description$6 = 'Compute tier 1 reachability';
|
|
12690
|
+
const hidden$4 = true;
|
|
12542
12691
|
const generalFlags = {
|
|
12543
12692
|
...flags.commonFlags,
|
|
12544
12693
|
...flags.outputFlags,
|
|
@@ -12554,17 +12703,17 @@ const generalFlags = {
|
|
|
12554
12703
|
}
|
|
12555
12704
|
};
|
|
12556
12705
|
const cmdScanReach = {
|
|
12557
|
-
description: description$
|
|
12558
|
-
hidden: hidden$
|
|
12559
|
-
run: run$
|
|
12706
|
+
description: description$6,
|
|
12707
|
+
hidden: hidden$4,
|
|
12708
|
+
run: run$7
|
|
12560
12709
|
};
|
|
12561
|
-
async function run$
|
|
12710
|
+
async function run$7(argv, importMeta, {
|
|
12562
12711
|
parentName
|
|
12563
12712
|
}) {
|
|
12564
12713
|
const config = {
|
|
12565
|
-
commandName: CMD_NAME$
|
|
12566
|
-
description: description$
|
|
12567
|
-
hidden: hidden$
|
|
12714
|
+
commandName: CMD_NAME$4,
|
|
12715
|
+
description: description$6,
|
|
12716
|
+
hidden: hidden$4,
|
|
12568
12717
|
flags: {
|
|
12569
12718
|
...generalFlags,
|
|
12570
12719
|
...reachabilityFlags
|
|
@@ -12574,7 +12723,7 @@ async function run$6(argv, importMeta, {
|
|
|
12574
12723
|
$ ${command} [options] [CWD=.]
|
|
12575
12724
|
|
|
12576
12725
|
API Token Requirements
|
|
12577
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12726
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$4}`)}
|
|
12578
12727
|
|
|
12579
12728
|
Options
|
|
12580
12729
|
${utils.getFlagListOutput(generalFlags)}
|
|
@@ -12682,21 +12831,21 @@ async function run$6(argv, importMeta, {
|
|
|
12682
12831
|
});
|
|
12683
12832
|
}
|
|
12684
12833
|
|
|
12685
|
-
const CMD_NAME$
|
|
12686
|
-
const description$
|
|
12687
|
-
const hidden$
|
|
12834
|
+
const CMD_NAME$3 = 'report';
|
|
12835
|
+
const description$5 = 'Check whether a scan result passes the organizational policies (security, license)';
|
|
12836
|
+
const hidden$3 = false;
|
|
12688
12837
|
const cmdScanReport = {
|
|
12689
|
-
description: description$
|
|
12690
|
-
hidden: hidden$
|
|
12691
|
-
run: run$
|
|
12838
|
+
description: description$5,
|
|
12839
|
+
hidden: hidden$3,
|
|
12840
|
+
run: run$6
|
|
12692
12841
|
};
|
|
12693
|
-
async function run$
|
|
12842
|
+
async function run$6(argv, importMeta, {
|
|
12694
12843
|
parentName
|
|
12695
12844
|
}) {
|
|
12696
12845
|
const config = {
|
|
12697
|
-
commandName: CMD_NAME$
|
|
12698
|
-
description: description$
|
|
12699
|
-
hidden: hidden$
|
|
12846
|
+
commandName: CMD_NAME$3,
|
|
12847
|
+
description: description$5,
|
|
12848
|
+
hidden: hidden$3,
|
|
12700
12849
|
flags: {
|
|
12701
12850
|
...flags.commonFlags,
|
|
12702
12851
|
...flags.outputFlags,
|
|
@@ -12735,7 +12884,7 @@ async function run$5(argv, importMeta, {
|
|
|
12735
12884
|
$ ${command} [options] <SCAN_ID> [OUTPUT_PATH]
|
|
12736
12885
|
|
|
12737
12886
|
API Token Requirements
|
|
12738
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
12887
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$3}`)}
|
|
12739
12888
|
|
|
12740
12889
|
Options
|
|
12741
12890
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -12846,18 +12995,18 @@ async function outputScanConfigResult(result) {
|
|
|
12846
12995
|
}
|
|
12847
12996
|
|
|
12848
12997
|
async function setupScanConfig(cwd, defaultOnReadError = false) {
|
|
12849
|
-
const jsonPath = path.join(cwd,
|
|
12998
|
+
const jsonPath = path.join(cwd, constants.SOCKET_JSON);
|
|
12850
12999
|
if (fs$1.existsSync(jsonPath)) {
|
|
12851
|
-
logger.logger.info(`Found
|
|
13000
|
+
logger.logger.info(`Found ${constants.SOCKET_JSON} at ${jsonPath}`);
|
|
12852
13001
|
} else {
|
|
12853
|
-
logger.logger.info(`No
|
|
13002
|
+
logger.logger.info(`No ${constants.SOCKET_JSON} found at ${cwd}, will generate a new one`);
|
|
12854
13003
|
}
|
|
12855
13004
|
logger.logger.log('');
|
|
12856
13005
|
logger.logger.log('Note: This tool will set up flag and argument defaults for certain');
|
|
12857
13006
|
logger.logger.log(' CLI commands. You can still override them by explicitly');
|
|
12858
13007
|
logger.logger.log(' setting the flag. It is meant to be a convenience tool.');
|
|
12859
13008
|
logger.logger.log('');
|
|
12860
|
-
logger.logger.log(
|
|
13009
|
+
logger.logger.log(`This command will generate a \`${constants.SOCKET_JSON}\` file in the target cwd.`);
|
|
12861
13010
|
logger.logger.log('You can choose to add this file to your repo (handy for collab)');
|
|
12862
13011
|
logger.logger.log('or to add it to the ignored files, or neither. This file is only');
|
|
12863
13012
|
logger.logger.log('used in CLI workflows.');
|
|
@@ -12918,7 +13067,7 @@ async function setupScanConfig(cwd, defaultOnReadError = false) {
|
|
|
12918
13067
|
}
|
|
12919
13068
|
}
|
|
12920
13069
|
logger.logger.log('');
|
|
12921
|
-
logger.logger.log(
|
|
13070
|
+
logger.logger.log(`Setup complete. Writing ${constants.SOCKET_JSON}`);
|
|
12922
13071
|
logger.logger.log('');
|
|
12923
13072
|
if (await prompts.select({
|
|
12924
13073
|
message: `Do you want to write the new config to ${jsonPath} ?`,
|
|
@@ -13134,7 +13283,7 @@ const config$2 = {
|
|
|
13134
13283
|
...flags.commonFlags,
|
|
13135
13284
|
defaultOnReadError: {
|
|
13136
13285
|
type: 'boolean',
|
|
13137
|
-
description:
|
|
13286
|
+
description: `If reading the ${constants.SOCKET_JSON} fails, just use a default config? Warning: This might override the existing json file!`
|
|
13138
13287
|
}
|
|
13139
13288
|
},
|
|
13140
13289
|
help: (command, config) => `
|
|
@@ -13164,9 +13313,9 @@ const config$2 = {
|
|
|
13164
13313
|
const cmdScanSetup = {
|
|
13165
13314
|
description: config$2.description,
|
|
13166
13315
|
hidden: config$2.hidden,
|
|
13167
|
-
run: run$
|
|
13316
|
+
run: run$5
|
|
13168
13317
|
};
|
|
13169
|
-
async function run$
|
|
13318
|
+
async function run$5(argv, importMeta, {
|
|
13170
13319
|
parentName
|
|
13171
13320
|
}) {
|
|
13172
13321
|
const cli = utils.meowOrExit({
|
|
@@ -13210,7 +13359,7 @@ async function fetchScan(orgSlug, scanId) {
|
|
|
13210
13359
|
error: e,
|
|
13211
13360
|
line
|
|
13212
13361
|
});
|
|
13213
|
-
return
|
|
13362
|
+
return undefined;
|
|
13214
13363
|
}
|
|
13215
13364
|
});
|
|
13216
13365
|
if (ok) {
|
|
@@ -13322,21 +13471,21 @@ async function streamScan(orgSlug, scanId, options) {
|
|
|
13322
13471
|
});
|
|
13323
13472
|
}
|
|
13324
13473
|
|
|
13325
|
-
const CMD_NAME$
|
|
13326
|
-
const description$
|
|
13327
|
-
const hidden$
|
|
13474
|
+
const CMD_NAME$2 = 'view';
|
|
13475
|
+
const description$4 = 'View the raw results of a scan';
|
|
13476
|
+
const hidden$2 = false;
|
|
13328
13477
|
const cmdScanView = {
|
|
13329
|
-
description: description$
|
|
13330
|
-
hidden: hidden$
|
|
13331
|
-
run: run$
|
|
13478
|
+
description: description$4,
|
|
13479
|
+
hidden: hidden$2,
|
|
13480
|
+
run: run$4
|
|
13332
13481
|
};
|
|
13333
|
-
async function run$
|
|
13482
|
+
async function run$4(argv, importMeta, {
|
|
13334
13483
|
parentName
|
|
13335
13484
|
}) {
|
|
13336
13485
|
const config = {
|
|
13337
|
-
commandName: CMD_NAME$
|
|
13338
|
-
description: description$
|
|
13339
|
-
hidden: hidden$
|
|
13486
|
+
commandName: CMD_NAME$2,
|
|
13487
|
+
description: description$4,
|
|
13488
|
+
hidden: hidden$2,
|
|
13340
13489
|
flags: {
|
|
13341
13490
|
...flags.commonFlags,
|
|
13342
13491
|
...flags.outputFlags,
|
|
@@ -13360,7 +13509,7 @@ async function run$3(argv, importMeta, {
|
|
|
13360
13509
|
$ ${command} [options] <SCAN_ID> [OUTPUT_FILE]
|
|
13361
13510
|
|
|
13362
13511
|
API Token Requirements
|
|
13363
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$
|
|
13512
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$2}`)}
|
|
13364
13513
|
|
|
13365
13514
|
When no output path is given the contents is sent to stdout.
|
|
13366
13515
|
|
|
@@ -13433,9 +13582,9 @@ async function run$3(argv, importMeta, {
|
|
|
13433
13582
|
}
|
|
13434
13583
|
}
|
|
13435
13584
|
|
|
13436
|
-
const description$
|
|
13585
|
+
const description$3 = 'Manage Socket scans';
|
|
13437
13586
|
const cmdScan = {
|
|
13438
|
-
description: description$
|
|
13587
|
+
description: description$3,
|
|
13439
13588
|
async run(argv, importMeta, {
|
|
13440
13589
|
parentName
|
|
13441
13590
|
}) {
|
|
@@ -13464,7 +13613,7 @@ const cmdScan = {
|
|
|
13464
13613
|
}
|
|
13465
13614
|
},
|
|
13466
13615
|
argv,
|
|
13467
|
-
description: description$
|
|
13616
|
+
description: description$3,
|
|
13468
13617
|
importMeta,
|
|
13469
13618
|
name: `${parentName} scan`
|
|
13470
13619
|
});
|
|
@@ -13485,7 +13634,7 @@ async function fetchThreatFeed({
|
|
|
13485
13634
|
return await utils.queryApiSafeJson(`orgs/${orgSlug}/threat-feed?${queryParams}`, 'the Threat Feed data');
|
|
13486
13635
|
}
|
|
13487
13636
|
|
|
13488
|
-
const require$
|
|
13637
|
+
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
13638
|
async function outputThreatFeed(result, outputKind) {
|
|
13490
13639
|
if (!result.ok) {
|
|
13491
13640
|
process.exitCode = result.code ?? 1;
|
|
@@ -13499,14 +13648,14 @@ async function outputThreatFeed(result, outputKind) {
|
|
|
13499
13648
|
return;
|
|
13500
13649
|
}
|
|
13501
13650
|
if (!result.data?.results?.length) {
|
|
13502
|
-
logger.logger.warn('Did not receive any data to display
|
|
13651
|
+
logger.logger.warn('Did not receive any data to display.');
|
|
13503
13652
|
return;
|
|
13504
13653
|
}
|
|
13505
13654
|
const formattedOutput = formatResults(result.data.results);
|
|
13506
13655
|
const descriptions = result.data.results.map(d => d.description);
|
|
13507
13656
|
|
|
13508
13657
|
// Note: this temporarily takes over the terminal (just like `man` does).
|
|
13509
|
-
const ScreenWidget = /*@__PURE__*/require$
|
|
13658
|
+
const ScreenWidget = /*@__PURE__*/require$2('../external/blessed/lib/widgets/screen.js');
|
|
13510
13659
|
const screen = new ScreenWidget({
|
|
13511
13660
|
...constants.default.blessedOptions
|
|
13512
13661
|
});
|
|
@@ -13515,7 +13664,7 @@ async function outputThreatFeed(result, outputKind) {
|
|
|
13515
13664
|
// node process just to exit it. That's very bad UX.
|
|
13516
13665
|
// eslint-disable-next-line n/no-process-exit
|
|
13517
13666
|
screen.key(['escape', 'q', 'C-c'], () => process.exit(0));
|
|
13518
|
-
const TableWidget = /*@__PURE__*/require$
|
|
13667
|
+
const TableWidget = /*@__PURE__*/require$2('../external/blessed-contrib/lib/widget/table.js');
|
|
13519
13668
|
const detailsBoxHeight = 20; // bottom N rows for details box
|
|
13520
13669
|
const tipsBoxHeight = 1; // 1 row for tips box
|
|
13521
13670
|
|
|
@@ -13539,7 +13688,7 @@ async function outputThreatFeed(result, outputKind) {
|
|
|
13539
13688
|
columnSpacing: 1,
|
|
13540
13689
|
truncate: '_'
|
|
13541
13690
|
});
|
|
13542
|
-
const BoxWidget = /*@__PURE__*/require$
|
|
13691
|
+
const BoxWidget = /*@__PURE__*/require$2('../external/blessed/lib/widgets/box.js');
|
|
13543
13692
|
const tipsBox = new BoxWidget({
|
|
13544
13693
|
bottom: detailsBoxHeight,
|
|
13545
13694
|
// sits just above the details box
|
|
@@ -13646,23 +13795,23 @@ async function handleThreatFeed({
|
|
|
13646
13795
|
await outputThreatFeed(data, outputKind);
|
|
13647
13796
|
}
|
|
13648
13797
|
|
|
13649
|
-
const CMD_NAME = 'threat-feed';
|
|
13798
|
+
const CMD_NAME$1 = 'threat-feed';
|
|
13650
13799
|
const ECOSYSTEMS = new Set(['gem', 'golang', 'maven', constants.NPM, 'nuget', 'pypi']);
|
|
13651
13800
|
const TYPE_FILTERS = new Set(['anom', 'c', 'fp', 'joke', 'mal', 'secret', 'spy', 'tp', 'typo', 'u', 'vuln']);
|
|
13652
|
-
const description$
|
|
13653
|
-
const hidden = false;
|
|
13801
|
+
const description$2 = '[Beta] View the threat-feed';
|
|
13802
|
+
const hidden$1 = false;
|
|
13654
13803
|
const cmdThreatFeed = {
|
|
13655
|
-
description: description$
|
|
13656
|
-
hidden,
|
|
13657
|
-
run: run$
|
|
13804
|
+
description: description$2,
|
|
13805
|
+
hidden: hidden$1,
|
|
13806
|
+
run: run$3
|
|
13658
13807
|
};
|
|
13659
|
-
async function run$
|
|
13808
|
+
async function run$3(argv, importMeta, {
|
|
13660
13809
|
parentName
|
|
13661
13810
|
}) {
|
|
13662
13811
|
const config = {
|
|
13663
|
-
commandName: CMD_NAME,
|
|
13664
|
-
description: description$
|
|
13665
|
-
hidden,
|
|
13812
|
+
commandName: CMD_NAME$1,
|
|
13813
|
+
description: description$2,
|
|
13814
|
+
hidden: hidden$1,
|
|
13666
13815
|
flags: {
|
|
13667
13816
|
...flags.commonFlags,
|
|
13668
13817
|
...flags.outputFlags,
|
|
@@ -13717,7 +13866,7 @@ async function run$2(argv, importMeta, {
|
|
|
13717
13866
|
$ ${command} [options] [ECOSYSTEM] [TYPE_FILTER]
|
|
13718
13867
|
|
|
13719
13868
|
API Token Requirements
|
|
13720
|
-
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME}`)}
|
|
13869
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$1}`)}
|
|
13721
13870
|
- Special access
|
|
13722
13871
|
|
|
13723
13872
|
This feature requires a Threat Feed license. Please contact
|
|
@@ -13983,9 +14132,9 @@ const config$1 = {
|
|
|
13983
14132
|
const cmdUninstallCompletion = {
|
|
13984
14133
|
description: config$1.description,
|
|
13985
14134
|
hidden: config$1.hidden,
|
|
13986
|
-
run: run$
|
|
14135
|
+
run: run$2
|
|
13987
14136
|
};
|
|
13988
|
-
async function run$
|
|
14137
|
+
async function run$2(argv, importMeta, {
|
|
13989
14138
|
parentName
|
|
13990
14139
|
}) {
|
|
13991
14140
|
const cli = utils.meowOrExit({
|
|
@@ -14003,9 +14152,9 @@ async function run$1(argv, importMeta, {
|
|
|
14003
14152
|
await handleUninstallCompletion(String(targetName));
|
|
14004
14153
|
}
|
|
14005
14154
|
|
|
14006
|
-
const description = 'Uninstall Socket CLI tab completion';
|
|
14155
|
+
const description$1 = 'Uninstall Socket CLI tab completion';
|
|
14007
14156
|
const cmdUninstall = {
|
|
14008
|
-
description,
|
|
14157
|
+
description: description$1,
|
|
14009
14158
|
hidden: false,
|
|
14010
14159
|
async run(argv, importMeta, {
|
|
14011
14160
|
parentName
|
|
@@ -14014,7 +14163,7 @@ const cmdUninstall = {
|
|
|
14014
14163
|
completion: cmdUninstallCompletion
|
|
14015
14164
|
}, {
|
|
14016
14165
|
argv,
|
|
14017
|
-
description,
|
|
14166
|
+
description: description$1,
|
|
14018
14167
|
importMeta,
|
|
14019
14168
|
name: `${parentName} uninstall`
|
|
14020
14169
|
});
|
|
@@ -14179,9 +14328,9 @@ const config = {
|
|
|
14179
14328
|
const cmdWrapper = {
|
|
14180
14329
|
description: config.description,
|
|
14181
14330
|
hidden: config.hidden,
|
|
14182
|
-
run
|
|
14331
|
+
run: run$1
|
|
14183
14332
|
};
|
|
14184
|
-
async function run(argv, importMeta, {
|
|
14333
|
+
async function run$1(argv, importMeta, {
|
|
14185
14334
|
parentName
|
|
14186
14335
|
}) {
|
|
14187
14336
|
// I don't think meow would mess with this but ...
|
|
@@ -14254,6 +14403,71 @@ async function run(argv, importMeta, {
|
|
|
14254
14403
|
}
|
|
14255
14404
|
}
|
|
14256
14405
|
|
|
14406
|
+
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)));
|
|
14407
|
+
const CMD_NAME = constants.YARN;
|
|
14408
|
+
const description = 'Run yarn with the Socket wrapper';
|
|
14409
|
+
const hidden = true;
|
|
14410
|
+
const cmdYarn = {
|
|
14411
|
+
description,
|
|
14412
|
+
hidden,
|
|
14413
|
+
run
|
|
14414
|
+
};
|
|
14415
|
+
async function run(argv, importMeta, context) {
|
|
14416
|
+
const {
|
|
14417
|
+
parentName
|
|
14418
|
+
} = {
|
|
14419
|
+
__proto__: null,
|
|
14420
|
+
...context
|
|
14421
|
+
};
|
|
14422
|
+
const config = {
|
|
14423
|
+
commandName: CMD_NAME,
|
|
14424
|
+
description,
|
|
14425
|
+
hidden,
|
|
14426
|
+
flags: {
|
|
14427
|
+
...flags.commonFlags
|
|
14428
|
+
},
|
|
14429
|
+
help: command => `
|
|
14430
|
+
Usage
|
|
14431
|
+
$ ${command} ...
|
|
14432
|
+
|
|
14433
|
+
API Token Requirements
|
|
14434
|
+
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME}`)}
|
|
14435
|
+
|
|
14436
|
+
Note: Everything after "yarn" is passed to the yarn command.
|
|
14437
|
+
Only the \`--dry-run\` and \`--help\` flags are caught here.
|
|
14438
|
+
|
|
14439
|
+
Use \`socket wrapper on\` to alias this command as \`yarn\`.
|
|
14440
|
+
|
|
14441
|
+
Examples
|
|
14442
|
+
$ ${command}
|
|
14443
|
+
$ ${command} install
|
|
14444
|
+
$ ${command} add package-name
|
|
14445
|
+
$ ${command} dlx package-name
|
|
14446
|
+
`
|
|
14447
|
+
};
|
|
14448
|
+
const cli = utils.meowOrExit({
|
|
14449
|
+
argv,
|
|
14450
|
+
config,
|
|
14451
|
+
importMeta,
|
|
14452
|
+
parentName
|
|
14453
|
+
});
|
|
14454
|
+
const dryRun = !!cli.flags['dryRun'];
|
|
14455
|
+
if (dryRun) {
|
|
14456
|
+
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
14457
|
+
return;
|
|
14458
|
+
}
|
|
14459
|
+
const shadowBin = /*@__PURE__*/require$1(constants.default.shadowYarnBinPath);
|
|
14460
|
+
process.exitCode = 1;
|
|
14461
|
+
|
|
14462
|
+
// Filter Socket flags from argv.
|
|
14463
|
+
const filteredArgv = utils.filterFlags(argv, config.flags);
|
|
14464
|
+
const {
|
|
14465
|
+
spawnPromise
|
|
14466
|
+
} = await shadowBin(filteredArgv);
|
|
14467
|
+
await spawnPromise;
|
|
14468
|
+
process.exitCode = 0;
|
|
14469
|
+
}
|
|
14470
|
+
|
|
14257
14471
|
const rootCommands = {
|
|
14258
14472
|
analytics: cmdAnalytics,
|
|
14259
14473
|
'audit-log': cmdAuditLog,
|
|
@@ -14270,6 +14484,7 @@ const rootCommands = {
|
|
|
14270
14484
|
manifest: cmdManifest,
|
|
14271
14485
|
npm: cmdNpm,
|
|
14272
14486
|
npx: cmdNpx,
|
|
14487
|
+
pnpm: cmdPnpm,
|
|
14273
14488
|
oops: cmdOops,
|
|
14274
14489
|
optimize: cmdOptimize,
|
|
14275
14490
|
organization: cmdOrganization,
|
|
@@ -14282,7 +14497,8 @@ const rootCommands = {
|
|
|
14282
14497
|
security: cmdOrganizationPolicySecurity,
|
|
14283
14498
|
'threat-feed': cmdThreatFeed,
|
|
14284
14499
|
uninstall: cmdUninstall,
|
|
14285
|
-
wrapper: cmdWrapper
|
|
14500
|
+
wrapper: cmdWrapper,
|
|
14501
|
+
yarn: cmdYarn
|
|
14286
14502
|
};
|
|
14287
14503
|
const rootAliases = {
|
|
14288
14504
|
audit: {
|
|
@@ -14362,7 +14578,7 @@ const rootAliases = {
|
|
|
14362
14578
|
}
|
|
14363
14579
|
};
|
|
14364
14580
|
|
|
14365
|
-
const __filename$1 = require$$0.fileURLToPath(
|
|
14581
|
+
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
14582
|
void (async () => {
|
|
14367
14583
|
const registryUrl = vendor.registryUrl();
|
|
14368
14584
|
await vendor.updater({
|
|
@@ -14372,7 +14588,11 @@ void (async () => {
|
|
|
14372
14588
|
name: constants.default.SOCKET_CLI_BIN_NAME,
|
|
14373
14589
|
registryUrl,
|
|
14374
14590
|
ttl: 86_400_000 /* 24 hours in milliseconds */,
|
|
14375
|
-
version: constants.default.ENV.INLINED_SOCKET_CLI_VERSION
|
|
14591
|
+
version: constants.default.ENV.INLINED_SOCKET_CLI_VERSION,
|
|
14592
|
+
logCallback: (name, version, latest) => {
|
|
14593
|
+
logger.logger.log(`\n\nš¦ Update available for ${vendor.yoctocolorsCjsExports.cyan(name)}: ${vendor.yoctocolorsCjsExports.gray(version)} ā ${vendor.yoctocolorsCjsExports.green(latest)}`);
|
|
14594
|
+
logger.logger.log(`š ${vendor.terminalLinkExports('View changelog', `https://socket.dev/npm/package/${name}/files/${latest}/CHANGELOG.md`)}`);
|
|
14595
|
+
}
|
|
14376
14596
|
});
|
|
14377
14597
|
try {
|
|
14378
14598
|
await utils.meowWithSubcommands(rootCommands, {
|
|
@@ -14440,5 +14660,5 @@ void (async () => {
|
|
|
14440
14660
|
await utils.captureException(e);
|
|
14441
14661
|
}
|
|
14442
14662
|
})();
|
|
14443
|
-
//# debugId=
|
|
14663
|
+
//# debugId=5d651596-3967-43af-9860-99f4bc7ab867
|
|
14444
14664
|
//# sourceMappingURL=cli.js.map
|