socket 1.0.74 → 1.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/cli.js CHANGED
@@ -18,10 +18,12 @@ spawn(
18
18
  // Lazily access constants.execPath.
19
19
  constants.execPath,
20
20
  [
21
- // Lazily access constants.nodeHardenFlags.
22
- ...constants.nodeHardenFlags,
23
21
  // Lazily access constants.nodeNoWarningsFlags.
24
22
  ...constants.nodeNoWarningsFlags,
23
+ // Lazily access constants.nodeHardenFlags.
24
+ ...constants.nodeHardenFlags,
25
+ // Lazily access constants.nodeMemoryFlags.
26
+ ...constants.nodeMemoryFlags,
25
27
  // Lazily access constants.ENV.INLINED_SOCKET_CLI_SENTRY_BUILD.
26
28
  ...(constants.ENV.INLINED_SOCKET_CLI_SENTRY_BUILD
27
29
  ? [
package/dist/cli.js CHANGED
@@ -9,6 +9,7 @@ var utils = require('./utils.js');
9
9
  var fs = require('node:fs/promises');
10
10
  var require$$5 = require('node:module');
11
11
  var constants = require('./constants.js');
12
+ var flags = require('./flags.js');
12
13
  var words = require('../external/@socketsecurity/registry/lib/words');
13
14
  var prompts = require('../external/@socketsecurity/registry/lib/prompts');
14
15
  var fs$1 = require('node:fs');
@@ -67,7 +68,7 @@ async function fetchRepoAnalyticsData(repo, time, options) {
67
68
 
68
69
  // Note: Widgets does not seem to actually work as code :'(
69
70
 
70
- 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)));
71
+ const require$5 = require$$5.createRequire(require('node:url').pathToFileURL(__filename).href);
71
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'];
72
73
 
73
74
  // Note: This maps `new Date(date).getMonth()` to English three letters
@@ -324,8 +325,8 @@ const config$M = {
324
325
  description: `Look up analytics data`,
325
326
  hidden: false,
326
327
  flags: {
327
- ...utils.commonFlags,
328
- ...utils.outputFlags,
328
+ ...flags.commonFlags,
329
+ ...flags.outputFlags,
329
330
  file: {
330
331
  type: 'string',
331
332
  description: 'Path to store result, only valid with --json/--markdown'
@@ -499,7 +500,7 @@ async function fetchAuditLog(config, options) {
499
500
  });
500
501
  }
501
502
 
502
- 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)));
503
+ const require$4 = require$$5.createRequire(require('node:url').pathToFileURL(__filename).href);
503
504
  const {
504
505
  REDACTED
505
506
  } = constants;
@@ -761,8 +762,8 @@ const config$L = {
761
762
  description: 'Look up the audit log for an organization',
762
763
  hidden: false,
763
764
  flags: {
764
- ...utils.commonFlags,
765
- ...utils.outputFlags,
765
+ ...flags.commonFlags,
766
+ ...flags.outputFlags,
766
767
  interactive: {
767
768
  type: 'boolean',
768
769
  default: true,
@@ -2041,7 +2042,7 @@ async function handleCreateNewScan({
2041
2042
  if (!wasValidInput) {
2042
2043
  return;
2043
2044
  }
2044
- debug.debugFn('notice', `found: ${packagePaths.length} local ${words.pluralize('file', packagePaths.length)}`);
2045
+ logger.logger.success(`Found ${packagePaths.length} local ${words.pluralize('file', packagePaths.length)}`);
2045
2046
  debug.debugDir('inspect', {
2046
2047
  packagePaths
2047
2048
  });
@@ -2136,7 +2137,7 @@ const config$K = {
2136
2137
  description: 'Create a new scan and report whether it passes your security policy',
2137
2138
  hidden: true,
2138
2139
  flags: {
2139
- ...utils.commonFlags,
2140
+ ...flags.commonFlags,
2140
2141
  autoManifest: {
2141
2142
  type: 'boolean',
2142
2143
  default: false,
@@ -2435,8 +2436,8 @@ async function run$M(argv, importMeta, {
2435
2436
  description: description$a,
2436
2437
  hidden: hidden$2,
2437
2438
  flags: {
2438
- ...utils.commonFlags,
2439
- ...utils.outputFlags
2439
+ ...flags.commonFlags,
2440
+ ...flags.outputFlags
2440
2441
  },
2441
2442
  help: (command, config) => `
2442
2443
  Usage
@@ -2537,8 +2538,8 @@ const config$J = {
2537
2538
  description: 'Get the value of a local CLI config item',
2538
2539
  hidden: false,
2539
2540
  flags: {
2540
- ...utils.commonFlags,
2541
- ...utils.outputFlags
2541
+ ...flags.commonFlags,
2542
+ ...flags.outputFlags
2542
2543
  },
2543
2544
  help: (command, config) => `
2544
2545
  Usage
@@ -2679,8 +2680,8 @@ const config$I = {
2679
2680
  description: 'Show all local CLI config items and their values',
2680
2681
  hidden: false,
2681
2682
  flags: {
2682
- ...utils.commonFlags,
2683
- ...utils.outputFlags,
2683
+ ...flags.commonFlags,
2684
+ ...flags.outputFlags,
2684
2685
  full: {
2685
2686
  type: 'boolean',
2686
2687
  default: false,
@@ -2795,8 +2796,8 @@ async function run$J(argv, importMeta, {
2795
2796
  description: description$9,
2796
2797
  hidden: hidden$1,
2797
2798
  flags: {
2798
- ...utils.commonFlags,
2799
- ...utils.outputFlags
2799
+ ...flags.commonFlags,
2800
+ ...flags.outputFlags
2800
2801
  },
2801
2802
  help: (command, config) => `
2802
2803
  Usage
@@ -2923,8 +2924,8 @@ async function run$I(argv, importMeta, {
2923
2924
  description: description$8,
2924
2925
  hidden,
2925
2926
  flags: {
2926
- ...utils.commonFlags,
2927
- ...utils.outputFlags
2927
+ ...flags.commonFlags,
2928
+ ...flags.outputFlags
2928
2929
  },
2929
2930
  help: (command, config) => `
2930
2931
  Usage
@@ -4704,7 +4705,7 @@ const config$H = {
4704
4705
  description: 'Update dependencies with "fixable" Socket alerts',
4705
4706
  hidden: false,
4706
4707
  flags: {
4707
- ...utils.commonFlags,
4708
+ ...flags.commonFlags,
4708
4709
  autoMerge: {
4709
4710
  type: 'boolean',
4710
4711
  default: false,
@@ -4799,6 +4800,7 @@ async function run$H(argv, importMeta, {
4799
4800
  parentName
4800
4801
  }) {
4801
4802
  const cli = utils.meowOrExit({
4803
+ allowUnknownFlags: false,
4802
4804
  argv,
4803
4805
  config: config$H,
4804
4806
  importMeta,
@@ -4970,7 +4972,7 @@ async function setupTabCompletion(targetName) {
4970
4972
  };
4971
4973
  }
4972
4974
  function getTabCompletionScriptRaw() {
4973
- 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))));
4975
+ const sourceDir = path.dirname(require$$0.fileURLToPath(require('node:url').pathToFileURL(__filename).href));
4974
4976
  const sourcePath = path.join(sourceDir, 'socket-completion.bash');
4975
4977
  if (!fs$1.existsSync(sourcePath)) {
4976
4978
  return {
@@ -5014,7 +5016,7 @@ const config$G = {
5014
5016
  description: 'Install bash completion for Socket CLI',
5015
5017
  hidden: false,
5016
5018
  flags: {
5017
- ...utils.commonFlags
5019
+ ...flags.commonFlags
5018
5020
  },
5019
5021
  help: (command, config) => `
5020
5022
  Usage
@@ -5114,7 +5116,7 @@ const config$F = {
5114
5116
  description: 'Display the `socket.json` that would be applied for target folder',
5115
5117
  hidden: true,
5116
5118
  flags: {
5117
- ...utils.commonFlags
5119
+ ...flags.commonFlags
5118
5120
  },
5119
5121
  help: command => `
5120
5122
  Usage
@@ -5294,7 +5296,7 @@ const config$E = {
5294
5296
  description: 'Socket API login',
5295
5297
  hidden: false,
5296
5298
  flags: {
5297
- ...utils.commonFlags,
5299
+ ...flags.commonFlags,
5298
5300
  apiBaseUrl: {
5299
5301
  type: 'string',
5300
5302
  description: 'API server to connect to for login'
@@ -5375,7 +5377,7 @@ const config$D = {
5375
5377
  description: 'Socket API logout',
5376
5378
  hidden: false,
5377
5379
  flags: {
5378
- ...utils.commonFlags
5380
+ ...flags.commonFlags
5379
5381
  },
5380
5382
  help: (command, _config) => `
5381
5383
  Usage
@@ -5757,7 +5759,7 @@ const config$B = {
5757
5759
  description: 'Auto-detect build and attempt to generate manifest file',
5758
5760
  hidden: false,
5759
5761
  flags: {
5760
- ...utils.commonFlags,
5762
+ ...flags.commonFlags,
5761
5763
  verbose: {
5762
5764
  type: 'boolean',
5763
5765
  default: false,
@@ -5852,8 +5854,8 @@ const config$A = {
5852
5854
  description: '[beta] Convert a Conda environment.yml file to a python requirements.txt',
5853
5855
  hidden: false,
5854
5856
  flags: {
5855
- ...utils.commonFlags,
5856
- ...utils.outputFlags,
5857
+ ...flags.commonFlags,
5858
+ ...flags.outputFlags,
5857
5859
  file: {
5858
5860
  type: 'string',
5859
5861
  description: 'Input file name (by default for Conda this is "environment.yml"), relative to cwd'
@@ -6010,7 +6012,7 @@ const config$z = {
6010
6012
  description: '[beta] Use Gradle to generate a manifest file (`pom.xml`) for a Gradle/Java/Kotlin/etc project',
6011
6013
  hidden: false,
6012
6014
  flags: {
6013
- ...utils.commonFlags,
6015
+ ...flags.commonFlags,
6014
6016
  bin: {
6015
6017
  type: 'string',
6016
6018
  description: 'Location of gradlew binary to use, default: CWD/gradlew'
@@ -6167,7 +6169,7 @@ const config$y = {
6167
6169
  description: '[beta] Use Gradle to generate a manifest file (`pom.xml`) for a Kotlin project',
6168
6170
  hidden: false,
6169
6171
  flags: {
6170
- ...utils.commonFlags,
6172
+ ...flags.commonFlags,
6171
6173
  bin: {
6172
6174
  type: 'string',
6173
6175
  description: 'Location of gradlew binary to use, default: CWD/gradlew'
@@ -6318,7 +6320,7 @@ const config$x = {
6318
6320
  description: "[beta] Generate a manifest file (`pom.xml`) from Scala's `build.sbt` file",
6319
6321
  hidden: false,
6320
6322
  flags: {
6321
- ...utils.commonFlags,
6323
+ ...flags.commonFlags,
6322
6324
  bin: {
6323
6325
  type: 'string',
6324
6326
  description: 'Location of sbt binary to use'
@@ -6903,7 +6905,7 @@ const config$w = {
6903
6905
  description: 'Start interactive configurator to customize default flag values for `socket manifest` in this dir',
6904
6906
  hidden: false,
6905
6907
  flags: {
6906
- ...utils.commonFlags,
6908
+ ...flags.commonFlags,
6907
6909
  defaultOnReadError: {
6908
6910
  type: 'boolean',
6909
6911
  description: 'If reading the socket.json fails, just use a default config? Warning: This might override the existing json file!'
@@ -6973,7 +6975,7 @@ const config$v = {
6973
6975
  description: 'Generate a dependency manifest for given file or dir',
6974
6976
  hidden: false,
6975
6977
  flags: {
6976
- ...utils.commonFlags
6978
+ ...flags.commonFlags
6977
6979
  }};
6978
6980
  const cmdManifest = {
6979
6981
  description: config$v.description,
@@ -7007,7 +7009,7 @@ async function run$v(argv, importMeta, {
7007
7009
  });
7008
7010
  }
7009
7011
 
7010
- 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)));
7012
+ const require$3 = require$$5.createRequire(require('node:url').pathToFileURL(__filename).href);
7011
7013
  const {
7012
7014
  DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$u
7013
7015
  } = constants;
@@ -7016,7 +7018,7 @@ const config$u = {
7016
7018
  description: `npm wrapper functionality`,
7017
7019
  hidden: false,
7018
7020
  flags: {
7019
- ...utils.commonFlags
7021
+ ...flags.commonFlags
7020
7022
  },
7021
7023
  help: (command, _config) => `
7022
7024
  Usage
@@ -7060,7 +7062,7 @@ async function run$u(argv, importMeta, {
7060
7062
  await shadowBin('npm', argv);
7061
7063
  }
7062
7064
 
7063
- 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)));
7065
+ const require$2 = require$$5.createRequire(require('node:url').pathToFileURL(__filename).href);
7064
7066
  const {
7065
7067
  DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$t
7066
7068
  } = constants;
@@ -7069,7 +7071,7 @@ const config$t = {
7069
7071
  description: `npx wrapper functionality`,
7070
7072
  hidden: false,
7071
7073
  flags: {
7072
- ...utils.commonFlags
7074
+ ...flags.commonFlags
7073
7075
  },
7074
7076
  help: (command, _config) => `
7075
7077
  Usage
@@ -7121,8 +7123,8 @@ const config$s = {
7121
7123
  description: 'Trigger an intentional error (for development)',
7122
7124
  hidden: true,
7123
7125
  flags: {
7124
- ...utils.commonFlags,
7125
- ...utils.outputFlags,
7126
+ ...flags.commonFlags,
7127
+ ...flags.outputFlags,
7126
7128
  throw: {
7127
7129
  type: 'boolean',
7128
7130
  default: false,
@@ -7988,7 +7990,7 @@ const config$r = {
7988
7990
  description: 'Optimize dependencies with @socketregistry overrides',
7989
7991
  hidden: false,
7990
7992
  flags: {
7991
- ...utils.commonFlags,
7993
+ ...flags.commonFlags,
7992
7994
  pin: {
7993
7995
  type: 'boolean',
7994
7996
  default: false,
@@ -8162,7 +8164,7 @@ const config$q = {
8162
8164
  description: 'Search for any dependency that is being used in your organization',
8163
8165
  hidden: false,
8164
8166
  flags: {
8165
- ...utils.commonFlags,
8167
+ ...flags.commonFlags,
8166
8168
  limit: {
8167
8169
  type: 'number',
8168
8170
  default: 50,
@@ -8173,7 +8175,7 @@ const config$q = {
8173
8175
  default: 0,
8174
8176
  description: 'Page number'
8175
8177
  },
8176
- ...utils.outputFlags
8178
+ ...flags.outputFlags
8177
8179
  },
8178
8180
  help: (command, config) => `
8179
8181
  Usage
@@ -8298,8 +8300,8 @@ const config$p = {
8298
8300
  description: 'Retrieve the license policy of an organization',
8299
8301
  hidden: false,
8300
8302
  flags: {
8301
- ...utils.commonFlags,
8302
- ...utils.outputFlags,
8303
+ ...flags.commonFlags,
8304
+ ...flags.outputFlags,
8303
8305
  interactive: {
8304
8306
  type: 'boolean',
8305
8307
  default: true,
@@ -8437,8 +8439,8 @@ const config$o = {
8437
8439
  description: 'Retrieve the security policy of an organization',
8438
8440
  hidden: true,
8439
8441
  flags: {
8440
- ...utils.commonFlags,
8441
- ...utils.outputFlags,
8442
+ ...flags.commonFlags,
8443
+ ...flags.outputFlags,
8442
8444
  interactive: {
8443
8445
  type: 'boolean',
8444
8446
  default: true,
@@ -8578,8 +8580,8 @@ const config$n = {
8578
8580
  description: 'List organizations associated with the API key used',
8579
8581
  hidden: false,
8580
8582
  flags: {
8581
- ...utils.commonFlags,
8582
- ...utils.outputFlags
8583
+ ...flags.commonFlags,
8584
+ ...flags.outputFlags
8583
8585
  },
8584
8586
  help: (command, _config) => `
8585
8587
  Usage
@@ -8718,8 +8720,8 @@ const config$m = {
8718
8720
  description: 'List organizations associated with the API key used',
8719
8721
  hidden: true,
8720
8722
  flags: {
8721
- ...utils.commonFlags,
8722
- ...utils.outputFlags
8723
+ ...flags.commonFlags,
8724
+ ...flags.outputFlags
8723
8725
  },
8724
8726
  help: (command, _config) => `
8725
8727
  Usage
@@ -9040,8 +9042,8 @@ const config$l = {
9040
9042
  description: 'Look up score for one package which reflects all of its transitive dependencies as well',
9041
9043
  hidden: false,
9042
9044
  flags: {
9043
- ...utils.commonFlags,
9044
- ...utils.outputFlags
9045
+ ...flags.commonFlags,
9046
+ ...flags.outputFlags
9045
9047
  },
9046
9048
  help: (command, config) => `
9047
9049
  Usage
@@ -9399,8 +9401,8 @@ const config$k = {
9399
9401
  description: 'Look up info regarding one or more packages but not their transitives',
9400
9402
  hidden: false,
9401
9403
  flags: {
9402
- ...utils.commonFlags,
9403
- ...utils.outputFlags
9404
+ ...flags.commonFlags,
9405
+ ...flags.outputFlags
9404
9406
  },
9405
9407
  help: (command, config) => `
9406
9408
  Usage
@@ -9552,7 +9554,7 @@ const config$j = {
9552
9554
  description: `Temporarily disable the Socket ${NPM} wrapper`,
9553
9555
  hidden: false,
9554
9556
  flags: {
9555
- ...utils.commonFlags
9557
+ ...flags.commonFlags
9556
9558
  },
9557
9559
  help: command => `
9558
9560
  Usage
@@ -9617,7 +9619,7 @@ const config$i = {
9617
9619
  description: `Temporarily disable the Socket ${NPX} wrapper`,
9618
9620
  hidden: false,
9619
9621
  flags: {
9620
- ...utils.commonFlags
9622
+ ...flags.commonFlags
9621
9623
  },
9622
9624
  help: command => `
9623
9625
  Usage
@@ -9731,8 +9733,8 @@ const config$h = {
9731
9733
  description: 'Create a repository in an organization',
9732
9734
  hidden: false,
9733
9735
  flags: {
9734
- ...utils.commonFlags,
9735
- ...utils.outputFlags,
9736
+ ...flags.commonFlags,
9737
+ ...flags.outputFlags,
9736
9738
  defaultBranch: {
9737
9739
  type: 'string',
9738
9740
  default: 'main',
@@ -9893,8 +9895,8 @@ const config$g = {
9893
9895
  description: 'Delete a repository in an organization',
9894
9896
  hidden: false,
9895
9897
  flags: {
9896
- ...utils.commonFlags,
9897
- ...utils.outputFlags,
9898
+ ...flags.commonFlags,
9899
+ ...flags.outputFlags,
9898
9900
  interactive: {
9899
9901
  type: 'boolean',
9900
9902
  default: true,
@@ -10163,8 +10165,8 @@ const config$f = {
10163
10165
  description: 'List repositories in an organization',
10164
10166
  hidden: false,
10165
10167
  flags: {
10166
- ...utils.commonFlags,
10167
- ...utils.outputFlags,
10168
+ ...flags.commonFlags,
10169
+ ...flags.outputFlags,
10168
10170
  all: {
10169
10171
  type: 'boolean',
10170
10172
  default: false,
@@ -10365,8 +10367,8 @@ const config$e = {
10365
10367
  description: 'Update a repository in an organization',
10366
10368
  hidden: false,
10367
10369
  flags: {
10368
- ...utils.commonFlags,
10369
- ...utils.outputFlags,
10370
+ ...flags.commonFlags,
10371
+ ...flags.outputFlags,
10370
10372
  defaultBranch: {
10371
10373
  type: 'string',
10372
10374
  shortFlag: 'b',
@@ -10554,8 +10556,8 @@ const config$d = {
10554
10556
  description: 'View repositories in an organization',
10555
10557
  hidden: false,
10556
10558
  flags: {
10557
- ...utils.commonFlags,
10558
- ...utils.outputFlags,
10559
+ ...flags.commonFlags,
10560
+ ...flags.outputFlags,
10559
10561
  interactive: {
10560
10562
  type: 'boolean',
10561
10563
  default: true,
@@ -10697,8 +10699,8 @@ const config$c = {
10697
10699
  description: 'Create a scan',
10698
10700
  hidden: false,
10699
10701
  flags: {
10700
- ...utils.commonFlags,
10701
- ...utils.outputFlags,
10702
+ ...flags.commonFlags,
10703
+ ...flags.outputFlags,
10702
10704
  autoManifest: {
10703
10705
  type: 'boolean',
10704
10706
  description: 'Run `socket manifest auto` before collecting manifest files? This would be necessary for languages like Scala, Gradle, and Kotlin, See `socket manifest auto --help`.'
@@ -11060,8 +11062,8 @@ const config$b = {
11060
11062
  description: 'Delete a scan',
11061
11063
  hidden: false,
11062
11064
  flags: {
11063
- ...utils.commonFlags,
11064
- ...utils.outputFlags,
11065
+ ...flags.commonFlags,
11066
+ ...flags.outputFlags,
11065
11067
  interactive: {
11066
11068
  type: 'boolean',
11067
11069
  default: true,
@@ -11341,8 +11343,8 @@ const config$a = {
11341
11343
  description: 'See what changed between two Scans',
11342
11344
  hidden: false,
11343
11345
  flags: {
11344
- ...utils.commonFlags,
11345
- ...utils.outputFlags,
11346
+ ...flags.commonFlags,
11347
+ ...flags.outputFlags,
11346
11348
  depth: {
11347
11349
  type: 'number',
11348
11350
  default: 2,
@@ -12121,8 +12123,8 @@ const config$9 = {
12121
12123
  hidden: true,
12122
12124
  // wip
12123
12125
  flags: {
12124
- ...utils.commonFlags,
12125
- ...utils.outputFlags,
12126
+ ...flags.commonFlags,
12127
+ ...flags.outputFlags,
12126
12128
  all: {
12127
12129
  type: 'boolean',
12128
12130
  description: 'Apply for all known repos reported by the Socket API. Supersedes `repos`.'
@@ -12437,8 +12439,8 @@ const config$8 = {
12437
12439
  description: 'List the scans for an organization',
12438
12440
  hidden: false,
12439
12441
  flags: {
12440
- ...utils.commonFlags,
12441
- ...utils.outputFlags,
12442
+ ...flags.commonFlags,
12443
+ ...flags.outputFlags,
12442
12444
  branch: {
12443
12445
  type: 'string',
12444
12446
  description: 'Filter to show only scans with this branch name'
@@ -12647,8 +12649,8 @@ const config$7 = {
12647
12649
  description: "Get a scan's metadata",
12648
12650
  hidden: false,
12649
12651
  flags: {
12650
- ...utils.commonFlags,
12651
- ...utils.outputFlags,
12652
+ ...flags.commonFlags,
12653
+ ...flags.outputFlags,
12652
12654
  interactive: {
12653
12655
  type: 'boolean',
12654
12656
  default: true,
@@ -12779,8 +12781,8 @@ const config$6 = {
12779
12781
  description: 'Compute tier 1 reachability',
12780
12782
  hidden: true,
12781
12783
  flags: {
12782
- ...utils.commonFlags,
12783
- ...utils.outputFlags
12784
+ ...flags.commonFlags,
12785
+ ...flags.outputFlags
12784
12786
  },
12785
12787
  help: (command, config) => `
12786
12788
  Usage
@@ -12844,8 +12846,8 @@ const config$5 = {
12844
12846
  description: 'Check whether a scan result passes the organizational policies (security, license)',
12845
12847
  hidden: false,
12846
12848
  flags: {
12847
- ...utils.commonFlags,
12848
- ...utils.outputFlags,
12849
+ ...flags.commonFlags,
12850
+ ...flags.outputFlags,
12849
12851
  fold: {
12850
12852
  type: 'string',
12851
12853
  default: 'none',
@@ -13298,7 +13300,7 @@ const config$4 = {
13298
13300
  description: 'Start interactive configurator to customize default flag values for `socket scan` in this dir',
13299
13301
  hidden: false,
13300
13302
  flags: {
13301
- ...utils.commonFlags,
13303
+ ...flags.commonFlags,
13302
13304
  defaultOnReadError: {
13303
13305
  type: 'boolean',
13304
13306
  description: 'If reading the socket.json fails, just use a default config? Warning: This might override the existing json file!'
@@ -13498,8 +13500,8 @@ const config$3 = {
13498
13500
  description: 'View the raw results of a scan',
13499
13501
  hidden: false,
13500
13502
  flags: {
13501
- ...utils.commonFlags,
13502
- ...utils.outputFlags,
13503
+ ...flags.commonFlags,
13504
+ ...flags.outputFlags,
13503
13505
  stream: {
13504
13506
  type: 'boolean',
13505
13507
  default: false,
@@ -13657,7 +13659,7 @@ async function fetchThreatFeed({
13657
13659
  return await utils.queryApiSafeJson(`orgs/${orgSlug}/threat-feed?${queryParams}`, 'the Threat Feed data');
13658
13660
  }
13659
13661
 
13660
- 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)));
13662
+ const require$1 = require$$5.createRequire(require('node:url').pathToFileURL(__filename).href);
13661
13663
  async function outputThreatFeed(result, outputKind) {
13662
13664
  if (!result.ok) {
13663
13665
  process.exitCode = result.code ?? 1;
@@ -13829,8 +13831,8 @@ const config$2 = {
13829
13831
  description: '[beta] View the threat feed',
13830
13832
  hidden: false,
13831
13833
  flags: {
13832
- ...utils.commonFlags,
13833
- ...utils.outputFlags,
13834
+ ...flags.commonFlags,
13835
+ ...flags.outputFlags,
13834
13836
  direction: {
13835
13837
  type: 'string',
13836
13838
  default: 'desc',
@@ -14136,7 +14138,7 @@ const config$1 = {
14136
14138
  description: 'Uninstall bash completion for Socket CLI',
14137
14139
  hidden: false,
14138
14140
  flags: {
14139
- ...utils.commonFlags
14141
+ ...flags.commonFlags
14140
14142
  },
14141
14143
  help: (command, config) => `
14142
14144
  Usage
@@ -14341,7 +14343,7 @@ const config = {
14341
14343
  description: 'Enable or disable the Socket npm/npx wrapper',
14342
14344
  hidden: false,
14343
14345
  flags: {
14344
- ...utils.commonFlags
14346
+ ...flags.commonFlags
14345
14347
  },
14346
14348
  help: (command, config) => `
14347
14349
  Usage
@@ -14439,7 +14441,7 @@ async function run(argv, importMeta, {
14439
14441
  }
14440
14442
  }
14441
14443
 
14442
- 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)));
14444
+ const __filename$1 = require$$0.fileURLToPath(require('node:url').pathToFileURL(__filename).href);
14443
14445
  void (async () => {
14444
14446
  const registryUrl = vendor.registryUrl();
14445
14447
  await vendor.updater({
@@ -14585,20 +14587,6 @@ void (async () => {
14585
14587
  debug.debugDir('inspect', {
14586
14588
  error: e
14587
14589
  });
14588
-
14589
- // Try to parse the flags, find out if --json or --markdown is set.
14590
- let isJson = false;
14591
- try {
14592
- const cli = vendor.meow(``, {
14593
- argv: process.argv.slice(2),
14594
- autoHelp: false,
14595
- flags: {},
14596
- importMeta: {
14597
- url: `${require$$0.pathToFileURL(__filename$1)}`
14598
- }
14599
- });
14600
- isJson = !!cli.flags['json'];
14601
- } catch {}
14602
14590
  let errorBody;
14603
14591
  let errorTitle;
14604
14592
  let errorMessage = '';
@@ -14616,6 +14604,20 @@ void (async () => {
14616
14604
  } else {
14617
14605
  errorTitle = 'Unexpected error with no details';
14618
14606
  }
14607
+
14608
+ // Try to parse the flags, find out if --json is set.
14609
+ const isJson = (() => {
14610
+ const cli = vendor.meow(``, {
14611
+ argv: process.argv.slice(2),
14612
+ autoHelp: false,
14613
+ autoVersion: false,
14614
+ flags: {},
14615
+ importMeta: {
14616
+ url: `${require$$0.pathToFileURL(__filename$1)}`
14617
+ }
14618
+ });
14619
+ return !!cli.flags['json'];
14620
+ })();
14619
14621
  if (isJson) {
14620
14622
  logger.logger.log(utils.serializeResultJson({
14621
14623
  ok: false,
@@ -14634,5 +14636,5 @@ void (async () => {
14634
14636
  await utils.captureException(e);
14635
14637
  }
14636
14638
  })();
14637
- //# debugId=ba4215ca-3cc8-45b8-8900-a36e38e6cc4a
14639
+ //# debugId=17c5b5ba-1b60-498d-8e4a-b6943d431dd2
14638
14640
  //# sourceMappingURL=cli.js.map