socket 1.1.19 ā 1.1.21
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 +27 -9
- package/dist/cli.js +226 -160
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +28 -4
- package/dist/constants.js.map +1 -1
- package/dist/flags.js +21 -3
- package/dist/flags.js.map +1 -1
- package/dist/shadow-npm-bin2.js +2 -29
- package/dist/shadow-npm-bin2.js.map +1 -1
- package/dist/shadow-pnpm-bin2.js +7 -30
- package/dist/shadow-pnpm-bin2.js.map +1 -1
- package/dist/shadow-yarn-bin.js +9 -28
- package/dist/shadow-yarn-bin.js.map +1 -1
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/analytics/cmd-analytics.d.mts.map +1 -1
- package/dist/types/commands/analytics/output-analytics.d.mts.map +1 -1
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts.map +1 -1
- package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
- package/dist/types/commands/login/attempt-login.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest.d.mts.map +1 -1
- package/dist/types/commands/optimize/handle-optimize.d.mts.map +1 -1
- package/dist/types/commands/optimize/ls-by-agent.d.mts.map +1 -1
- package/dist/types/commands/organization/cmd-organization-policy.d.mts.map +1 -1
- package/dist/types/commands/organization/cmd-organization.d.mts.map +1 -1
- package/dist/types/commands/package/cmd-package.d.mts.map +1 -1
- package/dist/types/commands/patch/cmd-patch.d.mts.map +1 -1
- package/dist/types/commands/patch/handle-patch.d.mts.map +1 -1
- package/dist/types/commands/raw-npm/run-raw-npm.d.mts.map +1 -1
- package/dist/types/commands/raw-npx/run-raw-npx.d.mts.map +1 -1
- package/dist/types/commands/repository/cmd-repository-create.d.mts.map +1 -1
- package/dist/types/commands/repository/cmd-repository-del.d.mts.map +1 -1
- package/dist/types/commands/repository/cmd-repository-update.d.mts.map +1 -1
- package/dist/types/commands/repository/cmd-repository-view.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-create.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.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/output-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/output-scan-view.d.mts.map +1 -1
- package/dist/types/commands/scan/perform-reachability-analysis.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +1 -1
- package/dist/types/constants.d.mts +6 -1
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/types/flags.d.mts.map +1 -1
- package/dist/types/shadow/npm-base.d.mts.map +1 -1
- package/dist/types/shadow/pnpm/bin.d.mts.map +1 -1
- package/dist/types/shadow/yarn/bin.d.mts.map +1 -1
- package/dist/types/test/json-output-validation.d.mts +37 -0
- package/dist/types/test/json-output-validation.d.mts.map +1 -0
- package/dist/types/test/mocks/socket-auth.d.mts +88 -0
- package/dist/types/test/mocks/socket-auth.d.mts.map +1 -0
- package/dist/types/utils/agent.d.mts.map +1 -1
- package/dist/types/utils/config.d.mts +1 -1
- package/dist/types/utils/determine-org-slug.d.mts.map +1 -1
- package/dist/types/utils/dlx-binary.d.mts +58 -0
- package/dist/types/utils/dlx-binary.d.mts.map +1 -0
- package/dist/types/utils/dlx-detection.d.mts +29 -0
- package/dist/types/utils/dlx-detection.d.mts.map +1 -0
- package/dist/types/utils/meow-with-subcommands.d.mts +33 -12
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
- package/dist/types/utils/package-environment.d.mts.map +1 -1
- package/dist/types/utils/shadow-links.d.mts +5 -0
- package/dist/types/utils/shadow-links.d.mts.map +1 -0
- package/dist/types/utils/terminal-link.d.mts +52 -0
- package/dist/types/utils/terminal-link.d.mts.map +1 -0
- package/dist/types/utils/yarn-version.d.mts.map +1 -1
- package/dist/utils.js +537 -118
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +372 -372
- package/package.json +1 -1
- package/dist/types/shadow/npm/link.d.mts +0 -2
- package/dist/types/shadow/npm/link.d.mts.map +0 -1
- package/dist/types/shadow/pnpm/link.d.mts +0 -2
- package/dist/types/shadow/pnpm/link.d.mts.map +0 -1
- package/dist/types/shadow/yarn/link.d.mts +0 -2
- package/dist/types/shadow/yarn/link.d.mts.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -95,7 +95,7 @@ async function outputAnalytics(result, {
|
|
|
95
95
|
try {
|
|
96
96
|
await fs.writeFile(filepath, serialized, 'utf8');
|
|
97
97
|
utils.debugFileOp('write', filepath);
|
|
98
|
-
logger.logger.success(`Data successfully written to ${filepath}`);
|
|
98
|
+
logger.logger.success(`Data successfully written to ${utils.fileLink(filepath)}`);
|
|
99
99
|
} catch (e) {
|
|
100
100
|
utils.debugFileOp('write', filepath, e);
|
|
101
101
|
process.exitCode = 1;
|
|
@@ -119,7 +119,7 @@ async function outputAnalytics(result, {
|
|
|
119
119
|
try {
|
|
120
120
|
await fs.writeFile(filepath, serialized, 'utf8');
|
|
121
121
|
utils.debugFileOp('write', filepath);
|
|
122
|
-
logger.logger.success(`Data successfully written to ${filepath}`);
|
|
122
|
+
logger.logger.success(`Data successfully written to ${utils.fileLink(filepath)}`);
|
|
123
123
|
} catch (e) {
|
|
124
124
|
utils.debugFileOp('write', filepath, e);
|
|
125
125
|
logger.logger.error(e);
|
|
@@ -376,8 +376,8 @@ async function run$S(argv, importMeta, {
|
|
|
376
376
|
const cli = utils.meowOrExit({
|
|
377
377
|
argv,
|
|
378
378
|
config,
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
parentName,
|
|
380
|
+
importMeta
|
|
381
381
|
});
|
|
382
382
|
|
|
383
383
|
// Supported inputs:
|
|
@@ -418,7 +418,7 @@ async function run$S(argv, importMeta, {
|
|
|
418
418
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
419
419
|
nook: true,
|
|
420
420
|
test: noLegacy,
|
|
421
|
-
message: `Legacy flags are no longer supported. See ${
|
|
421
|
+
message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
|
|
422
422
|
fail: `received legacy flags`
|
|
423
423
|
}, {
|
|
424
424
|
nook: true,
|
|
@@ -793,7 +793,7 @@ async function run$R(argv, importMeta, {
|
|
|
793
793
|
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$x}`)}
|
|
794
794
|
|
|
795
795
|
This feature requires an Enterprise Plan. To learn more about getting access
|
|
796
|
-
to this feature and many more, please visit ${constants.default.SOCKET_WEBSITE_URL}/pricing
|
|
796
|
+
to this feature and many more, please visit the ${utils.webLink(`${constants.default.SOCKET_WEBSITE_URL}/pricing`, 'Socket pricing page')}.
|
|
797
797
|
|
|
798
798
|
The type FILTER arg is an enum. Defaults to any. It should be one of these:
|
|
799
799
|
associateLabel, cancelInvitation, changeMemberRole, changePlanSubscriptionSeats,
|
|
@@ -818,8 +818,8 @@ async function run$R(argv, importMeta, {
|
|
|
818
818
|
const cli = utils.meowOrExit({
|
|
819
819
|
argv,
|
|
820
820
|
config,
|
|
821
|
-
|
|
822
|
-
|
|
821
|
+
parentName,
|
|
822
|
+
importMeta
|
|
823
823
|
});
|
|
824
824
|
const {
|
|
825
825
|
interactive,
|
|
@@ -841,7 +841,7 @@ async function run$R(argv, importMeta, {
|
|
|
841
841
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
842
842
|
nook: true,
|
|
843
843
|
test: noLegacy,
|
|
844
|
-
message: `Legacy flags are no longer supported. See ${
|
|
844
|
+
message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
|
|
845
845
|
fail: `received legacy flags`
|
|
846
846
|
}, {
|
|
847
847
|
nook: true,
|
|
@@ -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 ${
|
|
1577
|
+
cause: `Please ${utils.socketDevLink('upgrade your plan', '/pricing')}. This feature is only available for organizations with an enterprise plan.`
|
|
1578
1578
|
};
|
|
1579
1579
|
}
|
|
1580
1580
|
const wasSpinning = !!spinner?.isSpinning;
|
|
@@ -2214,7 +2214,7 @@ async function handleCreateNewScan({
|
|
|
2214
2214
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
2215
2215
|
nook: true,
|
|
2216
2216
|
test: packagePaths.length > 0,
|
|
2217
|
-
fail: `found no eligible files to scan. See supported manifest files at ${
|
|
2217
|
+
fail: `found no eligible files to scan. See supported manifest files at ${utils.socketDocsLink('/docs/manifest-file-detection-in-socket', 'docs.socket.dev')}`,
|
|
2218
2218
|
message: 'TARGET (file/dir) must contain matching / supported file types for a scan'
|
|
2219
2219
|
});
|
|
2220
2220
|
if (!wasValidInput) {
|
|
@@ -2422,8 +2422,8 @@ async function run$Q(argv, importMeta, {
|
|
|
2422
2422
|
const cli = utils.meowOrExit({
|
|
2423
2423
|
argv,
|
|
2424
2424
|
config: config$k,
|
|
2425
|
-
|
|
2426
|
-
|
|
2425
|
+
parentName,
|
|
2426
|
+
importMeta
|
|
2427
2427
|
});
|
|
2428
2428
|
const dryRun = !!cli.flags['dryRun'];
|
|
2429
2429
|
if (dryRun) {
|
|
@@ -2596,7 +2596,7 @@ async function outputConfigAuto(key, result, outputKind) {
|
|
|
2596
2596
|
}
|
|
2597
2597
|
logger.logger.log(`- ${key}: ${result.data}`);
|
|
2598
2598
|
logger.logger.log('');
|
|
2599
|
-
if (utils.
|
|
2599
|
+
if (utils.isConfigFromFlag()) {
|
|
2600
2600
|
logger.logger.log('(Unable to persist this value because the config is in read-only mode, meaning it was overridden through env or flag.)');
|
|
2601
2601
|
} else if (key === 'defaultOrg') {
|
|
2602
2602
|
const proceed = await prompts.select({
|
|
@@ -2744,7 +2744,7 @@ async function outputConfigGet(key, result, outputKind) {
|
|
|
2744
2744
|
logger.logger.fail(utils.failMsgWithBadge(result.message, result.cause));
|
|
2745
2745
|
return;
|
|
2746
2746
|
}
|
|
2747
|
-
const readOnly = utils.
|
|
2747
|
+
const readOnly = utils.isConfigFromFlag();
|
|
2748
2748
|
if (outputKind === 'markdown') {
|
|
2749
2749
|
logger.logger.log(`# Config Value`);
|
|
2750
2750
|
logger.logger.log('');
|
|
@@ -2847,7 +2847,7 @@ async function outputConfigList({
|
|
|
2847
2847
|
full,
|
|
2848
2848
|
outputKind
|
|
2849
2849
|
}) {
|
|
2850
|
-
const readOnly = utils.
|
|
2850
|
+
const readOnly = utils.isConfigFromFlag();
|
|
2851
2851
|
const supportedConfigKeys = utils.getSupportedConfigKeys();
|
|
2852
2852
|
if (outputKind === 'json') {
|
|
2853
2853
|
let failed = false;
|
|
@@ -3235,16 +3235,18 @@ const cmdConfig = {
|
|
|
3235
3235
|
parentName
|
|
3236
3236
|
}) {
|
|
3237
3237
|
await utils.meowWithSubcommands({
|
|
3238
|
-
auto: cmdConfigAuto,
|
|
3239
|
-
get: cmdConfigGet,
|
|
3240
|
-
list: cmdConfigList,
|
|
3241
|
-
set: cmdConfigSet,
|
|
3242
|
-
unset: cmdConfigUnset
|
|
3243
|
-
}, {
|
|
3244
3238
|
argv,
|
|
3245
|
-
|
|
3239
|
+
name: `${parentName} config`,
|
|
3246
3240
|
importMeta,
|
|
3247
|
-
|
|
3241
|
+
subcommands: {
|
|
3242
|
+
auto: cmdConfigAuto,
|
|
3243
|
+
get: cmdConfigGet,
|
|
3244
|
+
list: cmdConfigList,
|
|
3245
|
+
set: cmdConfigSet,
|
|
3246
|
+
unset: cmdConfigUnset
|
|
3247
|
+
}
|
|
3248
|
+
}, {
|
|
3249
|
+
description: description$A
|
|
3248
3250
|
});
|
|
3249
3251
|
}
|
|
3250
3252
|
};
|
|
@@ -4088,11 +4090,12 @@ async function run$K(argv, importMeta, {
|
|
|
4088
4090
|
`
|
|
4089
4091
|
};
|
|
4090
4092
|
const cli = utils.meowOrExit({
|
|
4091
|
-
allowUnknownFlags: false,
|
|
4092
4093
|
argv,
|
|
4093
4094
|
config,
|
|
4094
|
-
|
|
4095
|
-
|
|
4095
|
+
parentName,
|
|
4096
|
+
importMeta
|
|
4097
|
+
}, {
|
|
4098
|
+
allowUnknownFlags: false
|
|
4096
4099
|
});
|
|
4097
4100
|
const {
|
|
4098
4101
|
autopilot,
|
|
@@ -4323,8 +4326,8 @@ async function run$J(argv, importMeta, {
|
|
|
4323
4326
|
const cli = utils.meowOrExit({
|
|
4324
4327
|
argv,
|
|
4325
4328
|
config: config$h,
|
|
4326
|
-
|
|
4327
|
-
|
|
4329
|
+
parentName,
|
|
4330
|
+
importMeta
|
|
4328
4331
|
});
|
|
4329
4332
|
const dryRun = !!cli.flags['dryRun'];
|
|
4330
4333
|
if (dryRun) {
|
|
@@ -4343,18 +4346,20 @@ const cmdInstall = {
|
|
|
4343
4346
|
parentName
|
|
4344
4347
|
}) {
|
|
4345
4348
|
await utils.meowWithSubcommands({
|
|
4346
|
-
completion: cmdInstallCompletion
|
|
4347
|
-
}, {
|
|
4348
4349
|
argv,
|
|
4349
|
-
|
|
4350
|
+
name: `${parentName} install`,
|
|
4350
4351
|
importMeta,
|
|
4351
|
-
|
|
4352
|
+
subcommands: {
|
|
4353
|
+
completion: cmdInstallCompletion
|
|
4354
|
+
}
|
|
4355
|
+
}, {
|
|
4356
|
+
description: description$y
|
|
4352
4357
|
});
|
|
4353
4358
|
}
|
|
4354
4359
|
};
|
|
4355
4360
|
|
|
4356
4361
|
async function outputCmdJson(cwd) {
|
|
4357
|
-
logger.logger.info('Target cwd:', constants.default.ENV.VITEST ?
|
|
4362
|
+
logger.logger.info('Target cwd:', constants.default.ENV.VITEST ? constants.REDACTED : utils.tildify(cwd));
|
|
4358
4363
|
const sockJsonPath = path.join(cwd, constants.SOCKET_JSON);
|
|
4359
4364
|
const tildeSockJsonPath = constants.default.ENV.VITEST ? '<redacted>' : utils.tildify(sockJsonPath);
|
|
4360
4365
|
if (!fs$1.existsSync(sockJsonPath)) {
|
|
@@ -4406,8 +4411,8 @@ async function run$I(argv, importMeta, {
|
|
|
4406
4411
|
const cli = utils.meowOrExit({
|
|
4407
4412
|
argv,
|
|
4408
4413
|
config: config$g,
|
|
4409
|
-
|
|
4410
|
-
|
|
4414
|
+
parentName,
|
|
4415
|
+
importMeta
|
|
4411
4416
|
});
|
|
4412
4417
|
let [cwd = '.'] = cli.input;
|
|
4413
4418
|
// Note: path.resolve vs .join:
|
|
@@ -4427,7 +4432,7 @@ async function attemptLogin(apiBaseUrl, apiProxy) {
|
|
|
4427
4432
|
apiBaseUrl ??= utils.getConfigValueOrUndef(constants.CONFIG_KEY_API_BASE_URL) ?? undefined;
|
|
4428
4433
|
apiProxy ??= utils.getConfigValueOrUndef(constants.CONFIG_KEY_API_PROXY) ?? undefined;
|
|
4429
4434
|
const apiTokenInput = await prompts.password({
|
|
4430
|
-
message: `Enter your ${
|
|
4435
|
+
message: `Enter your ${utils.socketDocsLink('/docs/api-keys', 'Socket.dev API token')} (leave blank to use a limited public token)`
|
|
4431
4436
|
});
|
|
4432
4437
|
if (apiTokenInput === undefined) {
|
|
4433
4438
|
logger.logger.fail('Canceled by user');
|
|
@@ -4544,7 +4549,7 @@ async function attemptLogin(apiBaseUrl, apiProxy) {
|
|
|
4544
4549
|
try {
|
|
4545
4550
|
applyLogin(apiToken, enforcedOrgs, apiBaseUrl, apiProxy);
|
|
4546
4551
|
logger.logger.success(`API credentials ${previousPersistedToken === apiToken ? 'refreshed' : previousPersistedToken ? 'updated' : 'set'}`);
|
|
4547
|
-
if (utils.
|
|
4552
|
+
if (utils.isConfigFromFlag()) {
|
|
4548
4553
|
logger.logger.log('');
|
|
4549
4554
|
logger.logger.warn('Note: config is in read-only mode, at least one key was overridden through flag/env, so the login was not persisted!');
|
|
4550
4555
|
}
|
|
@@ -4602,8 +4607,8 @@ async function run$H(argv, importMeta, {
|
|
|
4602
4607
|
const cli = utils.meowOrExit({
|
|
4603
4608
|
argv,
|
|
4604
4609
|
config,
|
|
4605
|
-
|
|
4606
|
-
|
|
4610
|
+
parentName,
|
|
4611
|
+
importMeta
|
|
4607
4612
|
});
|
|
4608
4613
|
const dryRun = !!cli.flags['dryRun'];
|
|
4609
4614
|
if (dryRun) {
|
|
@@ -4631,7 +4636,7 @@ function attemptLogout() {
|
|
|
4631
4636
|
try {
|
|
4632
4637
|
applyLogout();
|
|
4633
4638
|
logger.logger.success('Successfully logged out');
|
|
4634
|
-
if (utils.
|
|
4639
|
+
if (utils.isConfigFromFlag()) {
|
|
4635
4640
|
logger.logger.log('');
|
|
4636
4641
|
logger.logger.warn('Note: config is in read-only mode, at least one key was overridden through flag/env, so the logout was not persisted!');
|
|
4637
4642
|
}
|
|
@@ -4685,7 +4690,7 @@ const {
|
|
|
4685
4690
|
YARN_LOCK
|
|
4686
4691
|
} = constants.default;
|
|
4687
4692
|
const nodejsPlatformTypes = new Set(['javascript', 'js', 'nodejs', constants.NPM, constants.PNPM, 'ts', 'tsx', 'typescript']);
|
|
4688
|
-
function
|
|
4693
|
+
function argvObjectToArray(argvObj) {
|
|
4689
4694
|
if (argvObj['help']) {
|
|
4690
4695
|
return [constants.FLAG_HELP];
|
|
4691
4696
|
}
|
|
@@ -4733,7 +4738,7 @@ async function runCdxgen(argvObj) {
|
|
|
4733
4738
|
stdio: 'inherit'
|
|
4734
4739
|
};
|
|
4735
4740
|
|
|
4736
|
-
// Detect package manager based on lockfiles
|
|
4741
|
+
// Detect package manager based on lockfiles.
|
|
4737
4742
|
const pnpmLockPath = await utils.findUp(PNPM_LOCK_YAML, {
|
|
4738
4743
|
onlyFiles: true
|
|
4739
4744
|
});
|
|
@@ -4745,7 +4750,7 @@ async function runCdxgen(argvObj) {
|
|
|
4745
4750
|
});
|
|
4746
4751
|
const agent = pnpmLockPath ? constants.PNPM : yarnLockPath && utils.isYarnBerry() ? constants.YARN : constants.NPM;
|
|
4747
4752
|
let cleanupPackageLock = false;
|
|
4748
|
-
if (argvMutable['type'] !== constants.YARN && nodejsPlatformTypes.has(argvMutable['type'])
|
|
4753
|
+
if (yarnLockPath && argvMutable['type'] !== constants.YARN && nodejsPlatformTypes.has(argvMutable['type'])) {
|
|
4749
4754
|
if (npmLockPath) {
|
|
4750
4755
|
argvMutable['type'] = constants.NPM;
|
|
4751
4756
|
} else {
|
|
@@ -4763,8 +4768,8 @@ async function runCdxgen(argvObj) {
|
|
|
4763
4768
|
}
|
|
4764
4769
|
}
|
|
4765
4770
|
|
|
4766
|
-
// Use appropriate package manager for cdxgen
|
|
4767
|
-
const shadowResult = await utils.spawnCdxgenDlx(
|
|
4771
|
+
// Use appropriate package manager for cdxgen.
|
|
4772
|
+
const shadowResult = await utils.spawnCdxgenDlx(argvObjectToArray(argvMutable), {
|
|
4768
4773
|
...shadowOpts,
|
|
4769
4774
|
agent
|
|
4770
4775
|
});
|
|
@@ -6303,15 +6308,19 @@ async function run$y(argv, importMeta, {
|
|
|
6303
6308
|
parentName
|
|
6304
6309
|
}) {
|
|
6305
6310
|
await utils.meowWithSubcommands({
|
|
6306
|
-
auto: cmdManifestAuto,
|
|
6307
|
-
cdxgen: cmdManifestCdxgen,
|
|
6308
|
-
conda: cmdManifestConda,
|
|
6309
|
-
gradle: cmdManifestGradle,
|
|
6310
|
-
kotlin: cmdManifestKotlin,
|
|
6311
|
-
scala: cmdManifestScala,
|
|
6312
|
-
setup: cmdManifestSetup
|
|
6313
|
-
}, {
|
|
6314
6311
|
argv,
|
|
6312
|
+
name: `${parentName} ${config$7.commandName}`,
|
|
6313
|
+
importMeta,
|
|
6314
|
+
subcommands: {
|
|
6315
|
+
auto: cmdManifestAuto,
|
|
6316
|
+
cdxgen: cmdManifestCdxgen,
|
|
6317
|
+
conda: cmdManifestConda,
|
|
6318
|
+
gradle: cmdManifestGradle,
|
|
6319
|
+
kotlin: cmdManifestKotlin,
|
|
6320
|
+
scala: cmdManifestScala,
|
|
6321
|
+
setup: cmdManifestSetup
|
|
6322
|
+
}
|
|
6323
|
+
}, {
|
|
6315
6324
|
aliases: {
|
|
6316
6325
|
yolo: {
|
|
6317
6326
|
description: config$7.description,
|
|
@@ -6320,9 +6329,7 @@ async function run$y(argv, importMeta, {
|
|
|
6320
6329
|
}
|
|
6321
6330
|
},
|
|
6322
6331
|
description: config$7.description,
|
|
6323
|
-
|
|
6324
|
-
flags: config$7.flags,
|
|
6325
|
-
name: `${parentName} ${config$7.commandName}`
|
|
6332
|
+
flags: config$7.flags
|
|
6326
6333
|
});
|
|
6327
6334
|
}
|
|
6328
6335
|
|
|
@@ -6443,8 +6450,8 @@ async function run$w(argv, importMeta, {
|
|
|
6443
6450
|
const cli = utils.meowOrExit({
|
|
6444
6451
|
argv,
|
|
6445
6452
|
config,
|
|
6446
|
-
|
|
6447
|
-
|
|
6453
|
+
parentName,
|
|
6454
|
+
importMeta
|
|
6448
6455
|
});
|
|
6449
6456
|
const dryRun = !!cli.flags['dryRun'];
|
|
6450
6457
|
if (dryRun) {
|
|
@@ -6502,8 +6509,8 @@ async function run$v(argv, importMeta, {
|
|
|
6502
6509
|
const cli = utils.meowOrExit({
|
|
6503
6510
|
argv,
|
|
6504
6511
|
config: config$6,
|
|
6505
|
-
|
|
6506
|
-
|
|
6512
|
+
parentName,
|
|
6513
|
+
importMeta
|
|
6507
6514
|
});
|
|
6508
6515
|
const {
|
|
6509
6516
|
json,
|
|
@@ -6785,6 +6792,9 @@ async function npmQuery(npmExecPath, cwd) {
|
|
|
6785
6792
|
try {
|
|
6786
6793
|
stdout = (await spawn.spawn(npmExecPath, ['query', ':not(.dev)'], {
|
|
6787
6794
|
cwd,
|
|
6795
|
+
// On Windows, npm is often a .cmd file that requires shell execution.
|
|
6796
|
+
// The spawn function from @socketsecurity/registry will handle this properly
|
|
6797
|
+
// when shell is true.
|
|
6788
6798
|
shell: constants.default.WIN32
|
|
6789
6799
|
})).stdout;
|
|
6790
6800
|
} catch {}
|
|
@@ -6802,6 +6812,9 @@ async function lsBun(pkgEnvDetails, options) {
|
|
|
6802
6812
|
// https://github.com/oven-sh/bun/issues/8283
|
|
6803
6813
|
return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['pm', 'ls', '--all'], {
|
|
6804
6814
|
cwd,
|
|
6815
|
+
// On Windows, bun is often a .cmd file that requires shell execution.
|
|
6816
|
+
// The spawn function from @socketsecurity/registry will handle this properly
|
|
6817
|
+
// when shell is true.
|
|
6805
6818
|
shell: constants.default.WIN32
|
|
6806
6819
|
})).stdout;
|
|
6807
6820
|
} catch {}
|
|
@@ -6837,6 +6850,9 @@ async function lsPnpm(pkgEnvDetails, options) {
|
|
|
6837
6850
|
// https://en.wiktionary.org/wiki/parsable
|
|
6838
6851
|
['ls', '--parseable', constants.FLAG_PROD, '--depth', 'Infinity'], {
|
|
6839
6852
|
cwd,
|
|
6853
|
+
// On Windows, pnpm is often a .cmd file that requires shell execution.
|
|
6854
|
+
// The spawn function from @socketsecurity/registry will handle this properly
|
|
6855
|
+
// when shell is true.
|
|
6840
6856
|
shell: constants.default.WIN32
|
|
6841
6857
|
})).stdout;
|
|
6842
6858
|
} catch {}
|
|
@@ -6854,6 +6870,9 @@ async function lsVlt(pkgEnvDetails, options) {
|
|
|
6854
6870
|
// See https://docs.vlt.sh/cli/commands/list#options.
|
|
6855
6871
|
stdout = (await spawn.spawn(pkgEnvDetails.agentExecPath, ['ls', '--view', 'human', ':not(.dev)'], {
|
|
6856
6872
|
cwd,
|
|
6873
|
+
// On Windows, pnpm is often a .cmd file that requires shell execution.
|
|
6874
|
+
// The spawn function from @socketsecurity/registry will handle this properly
|
|
6875
|
+
// when shell is true.
|
|
6857
6876
|
shell: constants.default.WIN32
|
|
6858
6877
|
})).stdout;
|
|
6859
6878
|
} catch {}
|
|
@@ -6871,6 +6890,9 @@ async function lsYarnBerry(pkgEnvDetails, options) {
|
|
|
6871
6890
|
// https://github.com/yarnpkg/berry/issues/5117
|
|
6872
6891
|
return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['info', '--recursive', '--name-only'], {
|
|
6873
6892
|
cwd,
|
|
6893
|
+
// On Windows, yarn is often a .cmd file that requires shell execution.
|
|
6894
|
+
// The spawn function from @socketsecurity/registry will handle this properly
|
|
6895
|
+
// when shell is true.
|
|
6874
6896
|
shell: constants.default.WIN32
|
|
6875
6897
|
})).stdout;
|
|
6876
6898
|
} catch {}
|
|
@@ -6890,6 +6912,9 @@ async function lsYarnClassic(pkgEnvDetails, options) {
|
|
|
6890
6912
|
// environment is production
|
|
6891
6913
|
return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['list', constants.FLAG_PROD], {
|
|
6892
6914
|
cwd,
|
|
6915
|
+
// On Windows, yarn is often a .cmd file that requires shell execution.
|
|
6916
|
+
// The spawn function from @socketsecurity/registry will handle this properly
|
|
6917
|
+
// when shell is true.
|
|
6893
6918
|
shell: constants.default.WIN32
|
|
6894
6919
|
})).stdout;
|
|
6895
6920
|
} catch {}
|
|
@@ -7387,6 +7412,7 @@ async function handleOptimize({
|
|
|
7387
7412
|
prod
|
|
7388
7413
|
});
|
|
7389
7414
|
if (!pkgEnvCResult.ok) {
|
|
7415
|
+
process.exitCode = pkgEnvCResult.code ?? 1;
|
|
7390
7416
|
require$$9.debugFn('warn', 'Package environment validation failed');
|
|
7391
7417
|
require$$9.debugDir('inspect', {
|
|
7392
7418
|
pkgEnvCResult
|
|
@@ -7396,6 +7422,7 @@ async function handleOptimize({
|
|
|
7396
7422
|
}
|
|
7397
7423
|
const pkgEnvDetails = pkgEnvCResult.data;
|
|
7398
7424
|
if (!pkgEnvDetails) {
|
|
7425
|
+
process.exitCode = 1;
|
|
7399
7426
|
require$$9.debugFn('warn', 'No package environment details found');
|
|
7400
7427
|
await outputOptimizeResult({
|
|
7401
7428
|
ok: false,
|
|
@@ -7413,6 +7440,7 @@ async function handleOptimize({
|
|
|
7413
7440
|
agentVersion
|
|
7414
7441
|
} = pkgEnvDetails;
|
|
7415
7442
|
if (agent === VLT) {
|
|
7443
|
+
process.exitCode = 1;
|
|
7416
7444
|
require$$9.debugFn('warn', `${agent} does not support overrides`);
|
|
7417
7445
|
await outputOptimizeResult({
|
|
7418
7446
|
ok: false,
|
|
@@ -7427,6 +7455,9 @@ async function handleOptimize({
|
|
|
7427
7455
|
pin,
|
|
7428
7456
|
prod
|
|
7429
7457
|
});
|
|
7458
|
+
if (!optimizationResult.ok) {
|
|
7459
|
+
process.exitCode = optimizationResult.code ?? 1;
|
|
7460
|
+
}
|
|
7430
7461
|
require$$9.debugFn('notice', `Optimization ${optimizationResult.ok ? 'succeeded' : 'failed'}`);
|
|
7431
7462
|
require$$9.debugDir('inspect', {
|
|
7432
7463
|
optimizationResult
|
|
@@ -7667,8 +7698,8 @@ async function run$t(argv, importMeta, {
|
|
|
7667
7698
|
const cli = utils.meowOrExit({
|
|
7668
7699
|
argv,
|
|
7669
7700
|
config,
|
|
7670
|
-
|
|
7671
|
-
|
|
7701
|
+
parentName,
|
|
7702
|
+
importMeta
|
|
7672
7703
|
});
|
|
7673
7704
|
const {
|
|
7674
7705
|
json,
|
|
@@ -7803,8 +7834,8 @@ async function run$s(argv, importMeta, {
|
|
|
7803
7834
|
const cli = utils.meowOrExit({
|
|
7804
7835
|
argv,
|
|
7805
7836
|
config,
|
|
7806
|
-
|
|
7807
|
-
|
|
7837
|
+
parentName,
|
|
7838
|
+
importMeta
|
|
7808
7839
|
});
|
|
7809
7840
|
const {
|
|
7810
7841
|
json,
|
|
@@ -7939,8 +7970,8 @@ async function run$r(argv, importMeta, {
|
|
|
7939
7970
|
const cli = utils.meowOrExit({
|
|
7940
7971
|
argv,
|
|
7941
7972
|
config,
|
|
7942
|
-
|
|
7943
|
-
|
|
7973
|
+
parentName,
|
|
7974
|
+
importMeta
|
|
7944
7975
|
});
|
|
7945
7976
|
const {
|
|
7946
7977
|
json,
|
|
@@ -8072,8 +8103,8 @@ async function run$q(argv, importMeta, {
|
|
|
8072
8103
|
const cli = utils.meowOrExit({
|
|
8073
8104
|
argv,
|
|
8074
8105
|
config,
|
|
8075
|
-
|
|
8076
|
-
|
|
8106
|
+
parentName,
|
|
8107
|
+
importMeta
|
|
8077
8108
|
});
|
|
8078
8109
|
const {
|
|
8079
8110
|
json,
|
|
@@ -8115,15 +8146,16 @@ const cmdOrganizationPolicy = {
|
|
|
8115
8146
|
parentName
|
|
8116
8147
|
}) {
|
|
8117
8148
|
await utils.meowWithSubcommands({
|
|
8118
|
-
security: cmdOrganizationPolicySecurity,
|
|
8119
|
-
license: cmdOrganizationPolicyLicense
|
|
8120
|
-
}, {
|
|
8121
8149
|
argv,
|
|
8122
|
-
|
|
8123
|
-
defaultSub: 'list',
|
|
8124
|
-
// Backwards compat
|
|
8150
|
+
name: `${parentName} policy`,
|
|
8125
8151
|
importMeta,
|
|
8126
|
-
|
|
8152
|
+
subcommands: {
|
|
8153
|
+
security: cmdOrganizationPolicySecurity,
|
|
8154
|
+
license: cmdOrganizationPolicyLicense
|
|
8155
|
+
}
|
|
8156
|
+
}, {
|
|
8157
|
+
description: description$p,
|
|
8158
|
+
defaultSub: 'list' // Backwards compat
|
|
8127
8159
|
});
|
|
8128
8160
|
}
|
|
8129
8161
|
};
|
|
@@ -8204,8 +8236,8 @@ async function run$p(argv, importMeta, {
|
|
|
8204
8236
|
const cli = utils.meowOrExit({
|
|
8205
8237
|
argv,
|
|
8206
8238
|
config: config$5,
|
|
8207
|
-
|
|
8208
|
-
|
|
8239
|
+
parentName,
|
|
8240
|
+
importMeta
|
|
8209
8241
|
});
|
|
8210
8242
|
const dryRun = !!cli.flags['dryRun'];
|
|
8211
8243
|
const json = Boolean(cli.flags['json']);
|
|
@@ -8241,10 +8273,15 @@ const cmdOrganization = {
|
|
|
8241
8273
|
parentName
|
|
8242
8274
|
}) {
|
|
8243
8275
|
await utils.meowWithSubcommands({
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8276
|
+
argv,
|
|
8277
|
+
name: `${parentName} organization`,
|
|
8278
|
+
importMeta,
|
|
8279
|
+
subcommands: {
|
|
8280
|
+
dependencies: cmdOrganizationDependencies,
|
|
8281
|
+
list: cmdOrganizationList,
|
|
8282
|
+
quota: cmdOrganizationQuota,
|
|
8283
|
+
policy: cmdOrganizationPolicy
|
|
8284
|
+
}
|
|
8248
8285
|
}, {
|
|
8249
8286
|
aliases: {
|
|
8250
8287
|
deps: {
|
|
@@ -8263,10 +8300,7 @@ const cmdOrganization = {
|
|
|
8263
8300
|
argv: ['policy', 'security']
|
|
8264
8301
|
}
|
|
8265
8302
|
},
|
|
8266
|
-
|
|
8267
|
-
description: description$o,
|
|
8268
|
-
importMeta,
|
|
8269
|
-
name: `${parentName} organization`
|
|
8303
|
+
description: description$o
|
|
8270
8304
|
});
|
|
8271
8305
|
}
|
|
8272
8306
|
};
|
|
@@ -9002,8 +9036,13 @@ const cmdPackage = {
|
|
|
9002
9036
|
parentName
|
|
9003
9037
|
}) {
|
|
9004
9038
|
await utils.meowWithSubcommands({
|
|
9005
|
-
|
|
9006
|
-
|
|
9039
|
+
argv,
|
|
9040
|
+
name: `${parentName} package`,
|
|
9041
|
+
importMeta,
|
|
9042
|
+
subcommands: {
|
|
9043
|
+
score: cmdPackageScore,
|
|
9044
|
+
shallow: cmdPackageShallow
|
|
9045
|
+
}
|
|
9007
9046
|
}, {
|
|
9008
9047
|
aliases: {
|
|
9009
9048
|
deep: {
|
|
@@ -9012,10 +9051,7 @@ const cmdPackage = {
|
|
|
9012
9051
|
argv: ['score']
|
|
9013
9052
|
}
|
|
9014
9053
|
},
|
|
9015
|
-
|
|
9016
|
-
description: description$l,
|
|
9017
|
-
importMeta,
|
|
9018
|
-
name: `${parentName} package`
|
|
9054
|
+
description: description$l
|
|
9019
9055
|
});
|
|
9020
9056
|
}
|
|
9021
9057
|
};
|
|
@@ -9281,7 +9317,22 @@ async function processFilePatch(pkgPath, fileName, fileInfo, socketDir, options)
|
|
|
9281
9317
|
let result = true;
|
|
9282
9318
|
try {
|
|
9283
9319
|
await fs$1.promises.copyFile(blobPath, filepath);
|
|
9284
|
-
|
|
9320
|
+
|
|
9321
|
+
// Verify the hash after copying to ensure file integrity.
|
|
9322
|
+
const verifyHashResult = await computeSHA256(filepath);
|
|
9323
|
+
if (!verifyHashResult.ok) {
|
|
9324
|
+
logger.logger.error(`Failed to verify hash after patch: ${verifyHashResult.cause || verifyHashResult.message}`);
|
|
9325
|
+
result = false;
|
|
9326
|
+
} else if (verifyHashResult.data !== fileInfo.afterHash) {
|
|
9327
|
+
logger.logger.error(`Hash verification failed after patch`);
|
|
9328
|
+
logger.logger.group();
|
|
9329
|
+
logger.logger.log(`Expected: ${fileInfo.afterHash}`);
|
|
9330
|
+
logger.logger.log(`Got: ${verifyHashResult.data}`);
|
|
9331
|
+
logger.logger.groupEnd();
|
|
9332
|
+
result = false;
|
|
9333
|
+
} else {
|
|
9334
|
+
logger.logger.success(`Patch applied successfully`);
|
|
9335
|
+
}
|
|
9285
9336
|
} catch (e) {
|
|
9286
9337
|
logger.logger.error('Error applying patch');
|
|
9287
9338
|
require$$9.debugDir('error', e);
|
|
@@ -9424,11 +9475,12 @@ async function run$m(argv, importMeta, {
|
|
|
9424
9475
|
`
|
|
9425
9476
|
};
|
|
9426
9477
|
const cli = utils.meowOrExit({
|
|
9427
|
-
allowUnknownFlags: false,
|
|
9428
9478
|
argv,
|
|
9429
9479
|
config,
|
|
9430
|
-
|
|
9431
|
-
|
|
9480
|
+
parentName,
|
|
9481
|
+
importMeta
|
|
9482
|
+
}, {
|
|
9483
|
+
allowUnknownFlags: false
|
|
9432
9484
|
});
|
|
9433
9485
|
const {
|
|
9434
9486
|
dryRun,
|
|
@@ -9517,8 +9569,8 @@ async function run$l(argv, importMeta, context) {
|
|
|
9517
9569
|
const cli = utils.meowOrExit({
|
|
9518
9570
|
argv,
|
|
9519
9571
|
config,
|
|
9520
|
-
|
|
9521
|
-
|
|
9572
|
+
parentName,
|
|
9573
|
+
importMeta
|
|
9522
9574
|
});
|
|
9523
9575
|
const dryRun = !!cli.flags['dryRun'];
|
|
9524
9576
|
if (dryRun) {
|
|
@@ -9542,6 +9594,9 @@ async function run$l(argv, importMeta, context) {
|
|
|
9542
9594
|
async function runRawNpm(argv) {
|
|
9543
9595
|
process.exitCode = 1;
|
|
9544
9596
|
const spawnPromise = spawn.spawn(utils.getNpmBinPath(), argv, {
|
|
9597
|
+
// On Windows, npm is often a .cmd file that requires shell execution.
|
|
9598
|
+
// The spawn function from @socketsecurity/registry will handle this properly
|
|
9599
|
+
// when shell is true.
|
|
9545
9600
|
shell: constants.default.WIN32,
|
|
9546
9601
|
stdio: 'inherit'
|
|
9547
9602
|
});
|
|
@@ -9591,8 +9646,8 @@ async function run$k(argv, importMeta, {
|
|
|
9591
9646
|
const cli = utils.meowOrExit({
|
|
9592
9647
|
argv,
|
|
9593
9648
|
config: config$4,
|
|
9594
|
-
|
|
9595
|
-
|
|
9649
|
+
parentName,
|
|
9650
|
+
importMeta
|
|
9596
9651
|
});
|
|
9597
9652
|
const dryRun = !!cli.flags['dryRun'];
|
|
9598
9653
|
if (dryRun) {
|
|
@@ -9605,6 +9660,9 @@ async function run$k(argv, importMeta, {
|
|
|
9605
9660
|
async function runRawNpx(argv) {
|
|
9606
9661
|
process.exitCode = 1;
|
|
9607
9662
|
const spawnPromise = spawn.spawn(utils.getNpxBinPath(), argv, {
|
|
9663
|
+
// On Windows, npx is often a .cmd file that requires shell execution.
|
|
9664
|
+
// The spawn function from @socketsecurity/registry will handle this properly
|
|
9665
|
+
// when shell is true.
|
|
9608
9666
|
shell: constants.default.WIN32,
|
|
9609
9667
|
stdio: 'inherit'
|
|
9610
9668
|
});
|
|
@@ -9654,8 +9712,8 @@ async function run$j(argv, importMeta, {
|
|
|
9654
9712
|
const cli = utils.meowOrExit({
|
|
9655
9713
|
argv,
|
|
9656
9714
|
config: config$3,
|
|
9657
|
-
|
|
9658
|
-
|
|
9715
|
+
parentName,
|
|
9716
|
+
importMeta
|
|
9659
9717
|
});
|
|
9660
9718
|
const dryRun = !!cli.flags['dryRun'];
|
|
9661
9719
|
if (dryRun) {
|
|
@@ -9815,8 +9873,8 @@ async function run$i(argv, importMeta, {
|
|
|
9815
9873
|
const cli = utils.meowOrExit({
|
|
9816
9874
|
argv,
|
|
9817
9875
|
config,
|
|
9818
|
-
|
|
9819
|
-
|
|
9876
|
+
parentName,
|
|
9877
|
+
importMeta
|
|
9820
9878
|
});
|
|
9821
9879
|
const {
|
|
9822
9880
|
json,
|
|
@@ -9840,7 +9898,7 @@ async function run$i(argv, importMeta, {
|
|
|
9840
9898
|
}, {
|
|
9841
9899
|
nook: true,
|
|
9842
9900
|
test: noLegacy,
|
|
9843
|
-
message: `Legacy flags are no longer supported. See ${
|
|
9901
|
+
message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
|
|
9844
9902
|
fail: `received legacy flags`
|
|
9845
9903
|
}, {
|
|
9846
9904
|
test: !!repoName,
|
|
@@ -9951,8 +10009,8 @@ async function run$h(argv, importMeta, {
|
|
|
9951
10009
|
const cli = utils.meowOrExit({
|
|
9952
10010
|
argv,
|
|
9953
10011
|
config,
|
|
9954
|
-
|
|
9955
|
-
|
|
10012
|
+
parentName,
|
|
10013
|
+
importMeta
|
|
9956
10014
|
});
|
|
9957
10015
|
const {
|
|
9958
10016
|
json,
|
|
@@ -9971,7 +10029,7 @@ async function run$h(argv, importMeta, {
|
|
|
9971
10029
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
9972
10030
|
nook: true,
|
|
9973
10031
|
test: noLegacy,
|
|
9974
|
-
message: `Legacy flags are no longer supported. See ${
|
|
10032
|
+
message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
|
|
9975
10033
|
fail: `received legacy flags`
|
|
9976
10034
|
}, {
|
|
9977
10035
|
nook: true,
|
|
@@ -10244,8 +10302,8 @@ async function run$g(argv, importMeta, {
|
|
|
10244
10302
|
const cli = utils.meowOrExit({
|
|
10245
10303
|
argv,
|
|
10246
10304
|
config,
|
|
10247
|
-
|
|
10248
|
-
|
|
10305
|
+
parentName,
|
|
10306
|
+
importMeta
|
|
10249
10307
|
});
|
|
10250
10308
|
const {
|
|
10251
10309
|
all,
|
|
@@ -10442,8 +10500,8 @@ async function run$f(argv, importMeta, {
|
|
|
10442
10500
|
const cli = utils.meowOrExit({
|
|
10443
10501
|
argv,
|
|
10444
10502
|
config,
|
|
10445
|
-
|
|
10446
|
-
|
|
10503
|
+
parentName,
|
|
10504
|
+
importMeta
|
|
10447
10505
|
});
|
|
10448
10506
|
const {
|
|
10449
10507
|
json,
|
|
@@ -10462,7 +10520,7 @@ async function run$f(argv, importMeta, {
|
|
|
10462
10520
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
10463
10521
|
nook: true,
|
|
10464
10522
|
test: noLegacy,
|
|
10465
|
-
message: `Legacy flags are no longer supported. See ${
|
|
10523
|
+
message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
|
|
10466
10524
|
fail: `received legacy flags`
|
|
10467
10525
|
}, {
|
|
10468
10526
|
nook: true,
|
|
@@ -10604,8 +10662,8 @@ async function run$e(argv, importMeta, {
|
|
|
10604
10662
|
const cli = utils.meowOrExit({
|
|
10605
10663
|
argv,
|
|
10606
10664
|
config,
|
|
10607
|
-
|
|
10608
|
-
|
|
10665
|
+
parentName,
|
|
10666
|
+
importMeta
|
|
10609
10667
|
});
|
|
10610
10668
|
const {
|
|
10611
10669
|
json,
|
|
@@ -10624,7 +10682,7 @@ async function run$e(argv, importMeta, {
|
|
|
10624
10682
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
10625
10683
|
nook: true,
|
|
10626
10684
|
test: noLegacy,
|
|
10627
|
-
message: `Legacy flags are no longer supported. See ${
|
|
10685
|
+
message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
|
|
10628
10686
|
fail: `received legacy flags`
|
|
10629
10687
|
}, {
|
|
10630
10688
|
nook: true,
|
|
@@ -10663,16 +10721,18 @@ const cmdRepository = {
|
|
|
10663
10721
|
parentName
|
|
10664
10722
|
}) {
|
|
10665
10723
|
await utils.meowWithSubcommands({
|
|
10666
|
-
create: cmdRepositoryCreate,
|
|
10667
|
-
view: cmdRepositoryView,
|
|
10668
|
-
list: cmdRepositoryList,
|
|
10669
|
-
del: cmdRepositoryDel,
|
|
10670
|
-
update: cmdRepositoryUpdate
|
|
10671
|
-
}, {
|
|
10672
10724
|
argv,
|
|
10673
|
-
|
|
10725
|
+
name: `${parentName} repository`,
|
|
10674
10726
|
importMeta,
|
|
10675
|
-
|
|
10727
|
+
subcommands: {
|
|
10728
|
+
create: cmdRepositoryCreate,
|
|
10729
|
+
view: cmdRepositoryView,
|
|
10730
|
+
list: cmdRepositoryList,
|
|
10731
|
+
del: cmdRepositoryDel,
|
|
10732
|
+
update: cmdRepositoryUpdate
|
|
10733
|
+
}
|
|
10734
|
+
}, {
|
|
10735
|
+
description: description$d
|
|
10676
10736
|
});
|
|
10677
10737
|
}
|
|
10678
10738
|
};
|
|
@@ -10876,7 +10936,7 @@ async function run$d(argv, importMeta, {
|
|
|
10876
10936
|
Note: for a first run you probably want to set --default-branch to indicate
|
|
10877
10937
|
the default branch name, like "main" or "master".
|
|
10878
10938
|
|
|
10879
|
-
The
|
|
10939
|
+
The ${utils.socketDashboardLink('/org/YOURORG/alerts', '"alerts page"')} will show
|
|
10880
10940
|
the results from the last scan designated as the "pending head" on the branch
|
|
10881
10941
|
configured on Socket to be the "default branch". When creating a scan the
|
|
10882
10942
|
--set-as-alerts-page flag will default to true to update this. You can prevent
|
|
@@ -10894,8 +10954,8 @@ async function run$d(argv, importMeta, {
|
|
|
10894
10954
|
const cli = utils.meowOrExit({
|
|
10895
10955
|
argv,
|
|
10896
10956
|
config,
|
|
10897
|
-
|
|
10898
|
-
|
|
10957
|
+
parentName,
|
|
10958
|
+
importMeta
|
|
10899
10959
|
});
|
|
10900
10960
|
const {
|
|
10901
10961
|
commitHash,
|
|
@@ -11299,7 +11359,7 @@ async function handleJson(data, file, dashboardMessage) {
|
|
|
11299
11359
|
logger.logger.fail(`Writing to \`${file}\` failed...`);
|
|
11300
11360
|
logger.logger.error(err);
|
|
11301
11361
|
} else {
|
|
11302
|
-
logger.logger.success(`Data successfully written to \`${file}\``);
|
|
11362
|
+
logger.logger.success(`Data successfully written to \`${utils.fileLink(file)}\``);
|
|
11303
11363
|
}
|
|
11304
11364
|
logger.logger.error(dashboardMessage);
|
|
11305
11365
|
});
|
|
@@ -12641,7 +12701,7 @@ async function run$9(argv, importMeta, {
|
|
|
12641
12701
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
12642
12702
|
nook: true,
|
|
12643
12703
|
test: noLegacy,
|
|
12644
|
-
message: `Legacy flags are no longer supported. See ${
|
|
12704
|
+
message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
|
|
12645
12705
|
fail: `received legacy flags`
|
|
12646
12706
|
}, {
|
|
12647
12707
|
nook: true,
|
|
@@ -13541,8 +13601,8 @@ async function run$5(argv, importMeta, {
|
|
|
13541
13601
|
const cli = utils.meowOrExit({
|
|
13542
13602
|
argv,
|
|
13543
13603
|
config: config$2,
|
|
13544
|
-
|
|
13545
|
-
|
|
13604
|
+
parentName,
|
|
13605
|
+
importMeta
|
|
13546
13606
|
});
|
|
13547
13607
|
const dryRun = !!cli.flags['dryRun'];
|
|
13548
13608
|
if (dryRun) {
|
|
@@ -13613,7 +13673,7 @@ async function outputScanView(result, orgSlug, scanId, filePath, outputKind) {
|
|
|
13613
13673
|
logger.logger.info('Writing json results to', filePath);
|
|
13614
13674
|
try {
|
|
13615
13675
|
await fs.writeFile(filePath, json, 'utf8');
|
|
13616
|
-
logger.logger.info(`Data successfully written to ${filePath}`);
|
|
13676
|
+
logger.logger.info(`Data successfully written to ${utils.fileLink(filePath)}`);
|
|
13617
13677
|
} catch (e) {
|
|
13618
13678
|
process.exitCode = 1;
|
|
13619
13679
|
logger.logger.fail('There was an error trying to write the markdown to disk');
|
|
@@ -13654,7 +13714,7 @@ View this report at: ${constants.default.SOCKET_WEBSITE_URL}/dashboard/org/${org
|
|
|
13654
13714
|
if (filePath && filePath !== '-') {
|
|
13655
13715
|
try {
|
|
13656
13716
|
await fs.writeFile(filePath, report, 'utf8');
|
|
13657
|
-
logger.logger.log(`Data successfully written to ${filePath}`);
|
|
13717
|
+
logger.logger.log(`Data successfully written to ${utils.fileLink(filePath)}`);
|
|
13658
13718
|
} catch (e) {
|
|
13659
13719
|
process.exitCode = 1;
|
|
13660
13720
|
logger.logger.fail('There was an error trying to write the markdown to disk');
|
|
@@ -13809,16 +13869,21 @@ const cmdScan = {
|
|
|
13809
13869
|
parentName
|
|
13810
13870
|
}) {
|
|
13811
13871
|
await utils.meowWithSubcommands({
|
|
13812
|
-
|
|
13813
|
-
|
|
13814
|
-
|
|
13815
|
-
|
|
13816
|
-
|
|
13817
|
-
|
|
13818
|
-
|
|
13819
|
-
|
|
13820
|
-
|
|
13821
|
-
|
|
13872
|
+
argv,
|
|
13873
|
+
name: `${parentName} scan`,
|
|
13874
|
+
importMeta,
|
|
13875
|
+
subcommands: {
|
|
13876
|
+
create: cmdScanCreate,
|
|
13877
|
+
del: cmdScanDel,
|
|
13878
|
+
diff: cmdScanDiff,
|
|
13879
|
+
github: cmdScanGithub,
|
|
13880
|
+
list: cmdScanList,
|
|
13881
|
+
metadata: cmdScanMetadata,
|
|
13882
|
+
reach: cmdScanReach,
|
|
13883
|
+
report: cmdScanReport,
|
|
13884
|
+
setup: cmdScanSetup,
|
|
13885
|
+
view: cmdScanView
|
|
13886
|
+
}
|
|
13822
13887
|
}, {
|
|
13823
13888
|
aliases: {
|
|
13824
13889
|
meta: {
|
|
@@ -13832,10 +13897,7 @@ const cmdScan = {
|
|
|
13832
13897
|
argv: ['reach']
|
|
13833
13898
|
}
|
|
13834
13899
|
},
|
|
13835
|
-
|
|
13836
|
-
description: description$3,
|
|
13837
|
-
importMeta,
|
|
13838
|
-
name: `${parentName} scan`
|
|
13900
|
+
description: description$3
|
|
13839
13901
|
});
|
|
13840
13902
|
}
|
|
13841
13903
|
};
|
|
@@ -14090,7 +14152,7 @@ async function run$3(argv, importMeta, {
|
|
|
14090
14152
|
- Special access
|
|
14091
14153
|
|
|
14092
14154
|
This feature requires a Threat Feed license. Please contact
|
|
14093
|
-
sales@socket.dev if you are interested in purchasing this access.
|
|
14155
|
+
${utils.mailtoLink('sales@socket.dev')} if you are interested in purchasing this access.
|
|
14094
14156
|
|
|
14095
14157
|
Options
|
|
14096
14158
|
${utils.getFlagListOutput(config.flags)}
|
|
@@ -14360,8 +14422,8 @@ async function run$2(argv, importMeta, {
|
|
|
14360
14422
|
const cli = utils.meowOrExit({
|
|
14361
14423
|
argv,
|
|
14362
14424
|
config: config$1,
|
|
14363
|
-
|
|
14364
|
-
|
|
14425
|
+
parentName,
|
|
14426
|
+
importMeta
|
|
14365
14427
|
});
|
|
14366
14428
|
const dryRun = !!cli.flags['dryRun'];
|
|
14367
14429
|
if (dryRun) {
|
|
@@ -14380,12 +14442,14 @@ const cmdUninstall = {
|
|
|
14380
14442
|
parentName
|
|
14381
14443
|
}) {
|
|
14382
14444
|
await utils.meowWithSubcommands({
|
|
14383
|
-
completion: cmdUninstallCompletion
|
|
14384
|
-
}, {
|
|
14385
14445
|
argv,
|
|
14386
|
-
|
|
14446
|
+
name: `${parentName} uninstall`,
|
|
14387
14447
|
importMeta,
|
|
14388
|
-
|
|
14448
|
+
subcommands: {
|
|
14449
|
+
completion: cmdUninstallCompletion
|
|
14450
|
+
}
|
|
14451
|
+
}, {
|
|
14452
|
+
description: description$1
|
|
14389
14453
|
});
|
|
14390
14454
|
}
|
|
14391
14455
|
};
|
|
@@ -14811,17 +14875,19 @@ void (async () => {
|
|
|
14811
14875
|
version: constants.default.ENV.INLINED_SOCKET_CLI_VERSION,
|
|
14812
14876
|
logCallback: (name, version, latest) => {
|
|
14813
14877
|
logger.logger.log(`\n\nš¦ Update available for ${vendor.yoctocolorsCjsExports.cyan(name)}: ${vendor.yoctocolorsCjsExports.gray(version)} ā ${vendor.yoctocolorsCjsExports.green(latest)}`);
|
|
14814
|
-
logger.logger.log(`š ${
|
|
14878
|
+
logger.logger.log(`š ${utils.socketPackageLink('npm', name, `files/${latest}/CHANGELOG.md`, 'View changelog')}`);
|
|
14815
14879
|
}
|
|
14816
14880
|
});
|
|
14817
14881
|
try {
|
|
14818
|
-
await utils.meowWithSubcommands(
|
|
14819
|
-
aliases: rootAliases,
|
|
14820
|
-
argv: process.argv.slice(2),
|
|
14882
|
+
await utils.meowWithSubcommands({
|
|
14821
14883
|
name: constants.default.SOCKET_CLI_BIN_NAME,
|
|
14884
|
+
argv: process.argv.slice(2),
|
|
14822
14885
|
importMeta: {
|
|
14823
14886
|
url: `${require$$0.pathToFileURL(__filename$1)}`
|
|
14824
|
-
}
|
|
14887
|
+
},
|
|
14888
|
+
subcommands: rootCommands
|
|
14889
|
+
}, {
|
|
14890
|
+
aliases: rootAliases
|
|
14825
14891
|
});
|
|
14826
14892
|
} catch (e) {
|
|
14827
14893
|
process.exitCode = 1;
|
|
@@ -14878,5 +14944,5 @@ void (async () => {
|
|
|
14878
14944
|
await utils.captureException(e);
|
|
14879
14945
|
}
|
|
14880
14946
|
})();
|
|
14881
|
-
//# debugId=
|
|
14947
|
+
//# debugId=506030ac-6b44-42d9-8af7-b61f2468318b
|
|
14882
14948
|
//# sourceMappingURL=cli.js.map
|