@socketsecurity/cli-with-sentry 0.15.37 → 0.15.39

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/dist/cli.js CHANGED
@@ -303,9 +303,9 @@ async function handleAnalytics({
303
303
  }
304
304
 
305
305
  const {
306
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$M
306
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$N
307
307
  } = constants;
308
- const config$R = {
308
+ const config$S = {
309
309
  commandName: 'analytics',
310
310
  description: `Look up analytics data`,
311
311
  hidden: false,
@@ -367,16 +367,16 @@ const config$R = {
367
367
  .replace(/\n(?: *\n)+/g, '\n\n')
368
368
  };
369
369
  const cmdAnalytics = {
370
- description: config$R.description,
371
- hidden: config$R.hidden,
372
- run: run$R
370
+ description: config$S.description,
371
+ hidden: config$S.hidden,
372
+ run: run$S
373
373
  };
374
- async function run$R(argv, importMeta, {
374
+ async function run$S(argv, importMeta, {
375
375
  parentName
376
376
  }) {
377
377
  const cli = utils.meowOrExit({
378
378
  argv,
379
- config: config$R,
379
+ config: config$S,
380
380
  importMeta,
381
381
  parentName
382
382
  });
@@ -480,7 +480,7 @@ async function run$R(argv, importMeta, {
480
480
  return;
481
481
  }
482
482
  if (cli.flags['dryRun']) {
483
- logger.logger.log(DRY_RUN_BAILING_NOW$M);
483
+ logger.logger.log(DRY_RUN_BAILING_NOW$N);
484
484
  return;
485
485
  }
486
486
  return await handleAnalytics({
@@ -660,10 +660,10 @@ async function handleAuditLog({
660
660
  }
661
661
 
662
662
  const {
663
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$L,
663
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$M,
664
664
  SOCKET_WEBSITE_URL: SOCKET_WEBSITE_URL$3
665
665
  } = constants;
666
- const config$Q = {
666
+ const config$R = {
667
667
  commandName: 'audit-log',
668
668
  description: 'Look up the audit log for an organization',
669
669
  hidden: false,
@@ -717,16 +717,16 @@ const config$Q = {
717
717
  `
718
718
  };
719
719
  const cmdAuditLog = {
720
- description: config$Q.description,
721
- hidden: config$Q.hidden,
722
- run: run$Q
720
+ description: config$R.description,
721
+ hidden: config$R.hidden,
722
+ run: run$R
723
723
  };
724
- async function run$Q(argv, importMeta, {
724
+ async function run$R(argv, importMeta, {
725
725
  parentName
726
726
  }) {
727
727
  const cli = utils.meowOrExit({
728
728
  argv,
729
- config: config$Q,
729
+ config: config$R,
730
730
  importMeta,
731
731
  parentName
732
732
  });
@@ -767,7 +767,7 @@ async function run$Q(argv, importMeta, {
767
767
  return;
768
768
  }
769
769
  if (cli.flags['dryRun']) {
770
- logger.logger.log(DRY_RUN_BAILING_NOW$L);
770
+ logger.logger.log(DRY_RUN_BAILING_NOW$M);
771
771
  return;
772
772
  }
773
773
  await handleAuditLog({
@@ -857,7 +857,7 @@ async function runCdxgen(yargvWithYes) {
857
857
  }
858
858
 
859
859
  const {
860
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$K
860
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$L
861
861
  } = constants;
862
862
 
863
863
  // TODO: Convert yargs to meow.
@@ -1059,7 +1059,7 @@ const yargsConfig = {
1059
1059
  'usages-slices-file' // hidden
1060
1060
  ]
1061
1061
  };
1062
- const config$P = {
1062
+ const config$Q = {
1063
1063
  commandName: 'cdxgen',
1064
1064
  description: 'Create an SBOM with CycloneDX generator (cdxgen)',
1065
1065
  hidden: false,
@@ -1069,17 +1069,17 @@ const config$P = {
1069
1069
  help: () => ''
1070
1070
  };
1071
1071
  const cmdManifestCdxgen = {
1072
- description: config$P.description,
1073
- hidden: config$P.hidden,
1074
- run: run$P
1072
+ description: config$Q.description,
1073
+ hidden: config$Q.hidden,
1074
+ run: run$Q
1075
1075
  };
1076
- async function run$P(argv, importMeta, {
1076
+ async function run$Q(argv, importMeta, {
1077
1077
  parentName
1078
1078
  }) {
1079
1079
  const cli = utils.meowOrExit({
1080
1080
  // Don't let meow take over --help.
1081
1081
  argv: argv.filter(a => !utils.isHelpFlag(a)),
1082
- config: config$P,
1082
+ config: config$Q,
1083
1083
  importMeta,
1084
1084
  parentName
1085
1085
  });
@@ -1101,7 +1101,7 @@ async function run$P(argv, importMeta, {
1101
1101
  return;
1102
1102
  }
1103
1103
  if (cli.flags['dryRun']) {
1104
- logger.logger.log(DRY_RUN_BAILING_NOW$K);
1104
+ logger.logger.log(DRY_RUN_BAILING_NOW$L);
1105
1105
  return;
1106
1106
  }
1107
1107
 
@@ -1130,15 +1130,15 @@ async function handleCdxgen(argv, importMeta, {
1130
1130
  });
1131
1131
  }
1132
1132
 
1133
- const config$O = {
1133
+ const config$P = {
1134
1134
  description: 'Create an SBOM with CycloneDX generator (cdxgen)',
1135
1135
  hidden: true};
1136
1136
  const cmdCdxgen = {
1137
- description: config$O.description,
1138
- hidden: config$O.hidden,
1139
- run: run$O
1137
+ description: config$P.description,
1138
+ hidden: config$P.hidden,
1139
+ run: run$P
1140
1140
  };
1141
- async function run$O(argv, importMeta, {
1141
+ async function run$P(argv, importMeta, {
1142
1142
  parentName
1143
1143
  }) {
1144
1144
  logger.logger.warn('Warning: The `socket cdxgen` command moved to `socket manifest cdxgen` and will be removed as a toplevel command in the next major bump.');
@@ -2371,9 +2371,9 @@ async function handleCI(autoManifest) {
2371
2371
  }
2372
2372
 
2373
2373
  const {
2374
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$J
2374
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$K
2375
2375
  } = constants;
2376
- const config$N = {
2376
+ const config$O = {
2377
2377
  commandName: 'ci',
2378
2378
  description: 'Create a new scan and report whether it passes your security policy',
2379
2379
  hidden: true,
@@ -2391,7 +2391,7 @@ const config$N = {
2391
2391
  $ ${parentName}
2392
2392
 
2393
2393
  Options
2394
- ${utils.getFlagListOutput(config$N.flags, 6)}
2394
+ ${utils.getFlagListOutput(config$O.flags, 6)}
2395
2395
 
2396
2396
  This command is intended to use in CI runs to allow automated systems to
2397
2397
  accept or reject a current build. When the scan does not pass your security
@@ -2406,21 +2406,21 @@ const config$N = {
2406
2406
  `
2407
2407
  };
2408
2408
  const cmdCI = {
2409
- description: config$N.description,
2410
- hidden: config$N.hidden,
2411
- run: run$N
2409
+ description: config$O.description,
2410
+ hidden: config$O.hidden,
2411
+ run: run$O
2412
2412
  };
2413
- async function run$N(argv, importMeta, {
2413
+ async function run$O(argv, importMeta, {
2414
2414
  parentName
2415
2415
  }) {
2416
2416
  const cli = utils.meowOrExit({
2417
2417
  argv,
2418
- config: config$N,
2418
+ config: config$O,
2419
2419
  importMeta,
2420
2420
  parentName
2421
2421
  });
2422
2422
  if (cli.flags['dryRun']) {
2423
- logger.logger.log(DRY_RUN_BAILING_NOW$J);
2423
+ logger.logger.log(DRY_RUN_BAILING_NOW$K);
2424
2424
  return;
2425
2425
  }
2426
2426
  await handleCI(Boolean(cli.flags['autoManifest']));
@@ -2664,9 +2664,9 @@ async function handleConfigAuto({
2664
2664
  }
2665
2665
 
2666
2666
  const {
2667
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$I
2667
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$J
2668
2668
  } = constants;
2669
- const config$M = {
2669
+ const config$N = {
2670
2670
  commandName: 'auto',
2671
2671
  description: 'Automatically discover and set the correct value config item',
2672
2672
  hidden: false,
@@ -2695,16 +2695,16 @@ ${Array.from(utils.supportedConfigKeys.entries()).map(([key, desc]) => ` - $
2695
2695
  `
2696
2696
  };
2697
2697
  const cmdConfigAuto = {
2698
- description: config$M.description,
2699
- hidden: config$M.hidden,
2700
- run: run$M
2698
+ description: config$N.description,
2699
+ hidden: config$N.hidden,
2700
+ run: run$N
2701
2701
  };
2702
- async function run$M(argv, importMeta, {
2702
+ async function run$N(argv, importMeta, {
2703
2703
  parentName
2704
2704
  }) {
2705
2705
  const cli = utils.meowOrExit({
2706
2706
  argv,
2707
- config: config$M,
2707
+ config: config$N,
2708
2708
  importMeta,
2709
2709
  parentName
2710
2710
  });
@@ -2730,7 +2730,7 @@ async function run$M(argv, importMeta, {
2730
2730
  return;
2731
2731
  }
2732
2732
  if (cli.flags['dryRun']) {
2733
- logger.logger.log(DRY_RUN_BAILING_NOW$I);
2733
+ logger.logger.log(DRY_RUN_BAILING_NOW$J);
2734
2734
  return;
2735
2735
  }
2736
2736
  await handleConfigAuto({
@@ -2778,9 +2778,9 @@ async function handleConfigGet({
2778
2778
  }
2779
2779
 
2780
2780
  const {
2781
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$H
2781
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$I
2782
2782
  } = constants;
2783
- const config$L = {
2783
+ const config$M = {
2784
2784
  commandName: 'get',
2785
2785
  description: 'Get the value of a local CLI config item',
2786
2786
  hidden: false,
@@ -2804,16 +2804,16 @@ ${Array.from(utils.supportedConfigKeys.entries()).map(([key, desc]) => ` - $
2804
2804
  `
2805
2805
  };
2806
2806
  const cmdConfigGet = {
2807
- description: config$L.description,
2808
- hidden: config$L.hidden,
2809
- run: run$L
2807
+ description: config$M.description,
2808
+ hidden: config$M.hidden,
2809
+ run: run$M
2810
2810
  };
2811
- async function run$L(argv, importMeta, {
2811
+ async function run$M(argv, importMeta, {
2812
2812
  parentName
2813
2813
  }) {
2814
2814
  const cli = utils.meowOrExit({
2815
2815
  argv,
2816
- config: config$L,
2816
+ config: config$M,
2817
2817
  importMeta,
2818
2818
  parentName
2819
2819
  });
@@ -2839,7 +2839,7 @@ async function run$L(argv, importMeta, {
2839
2839
  return;
2840
2840
  }
2841
2841
  if (cli.flags['dryRun']) {
2842
- logger.logger.log(DRY_RUN_BAILING_NOW$H);
2842
+ logger.logger.log(DRY_RUN_BAILING_NOW$I);
2843
2843
  return;
2844
2844
  }
2845
2845
  await handleConfigGet({
@@ -2916,9 +2916,9 @@ async function outputConfigList({
2916
2916
  }
2917
2917
 
2918
2918
  const {
2919
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$G
2919
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$H
2920
2920
  } = constants;
2921
- const config$K = {
2921
+ const config$L = {
2922
2922
  commandName: 'list',
2923
2923
  description: 'Show all local CLI config items and their values',
2924
2924
  hidden: false,
@@ -2947,16 +2947,16 @@ ${Array.from(utils.supportedConfigKeys.entries()).map(([key, desc]) => ` - $
2947
2947
  `
2948
2948
  };
2949
2949
  const cmdConfigList = {
2950
- description: config$K.description,
2951
- hidden: config$K.hidden,
2952
- run: run$K
2950
+ description: config$L.description,
2951
+ hidden: config$L.hidden,
2952
+ run: run$L
2953
2953
  };
2954
- async function run$K(argv, importMeta, {
2954
+ async function run$L(argv, importMeta, {
2955
2955
  parentName
2956
2956
  }) {
2957
2957
  const cli = utils.meowOrExit({
2958
2958
  argv,
2959
- config: config$K,
2959
+ config: config$L,
2960
2960
  importMeta,
2961
2961
  parentName
2962
2962
  });
@@ -2977,7 +2977,7 @@ async function run$K(argv, importMeta, {
2977
2977
  return;
2978
2978
  }
2979
2979
  if (cli.flags['dryRun']) {
2980
- logger.logger.log(DRY_RUN_BAILING_NOW$G);
2980
+ logger.logger.log(DRY_RUN_BAILING_NOW$H);
2981
2981
  return;
2982
2982
  }
2983
2983
  await outputConfigList({
@@ -3026,9 +3026,9 @@ async function handleConfigSet({
3026
3026
  }
3027
3027
 
3028
3028
  const {
3029
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$F
3029
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$G
3030
3030
  } = constants;
3031
- const config$J = {
3031
+ const config$K = {
3032
3032
  commandName: 'set',
3033
3033
  description: 'Update the value of a local CLI config item',
3034
3034
  hidden: false,
@@ -3057,16 +3057,16 @@ ${Array.from(utils.supportedConfigKeys.entries()).map(([key, desc]) => ` - $
3057
3057
  `
3058
3058
  };
3059
3059
  const cmdConfigSet = {
3060
- description: config$J.description,
3061
- hidden: config$J.hidden,
3062
- run: run$J
3060
+ description: config$K.description,
3061
+ hidden: config$K.hidden,
3062
+ run: run$K
3063
3063
  };
3064
- async function run$J(argv, importMeta, {
3064
+ async function run$K(argv, importMeta, {
3065
3065
  parentName
3066
3066
  }) {
3067
3067
  const cli = utils.meowOrExit({
3068
3068
  argv,
3069
- config: config$J,
3069
+ config: config$K,
3070
3070
  importMeta,
3071
3071
  parentName
3072
3072
  });
@@ -3099,7 +3099,7 @@ async function run$J(argv, importMeta, {
3099
3099
  return;
3100
3100
  }
3101
3101
  if (cli.flags['dryRun']) {
3102
- logger.logger.log(DRY_RUN_BAILING_NOW$F);
3102
+ logger.logger.log(DRY_RUN_BAILING_NOW$G);
3103
3103
  return;
3104
3104
  }
3105
3105
  await handleConfigSet({
@@ -3148,9 +3148,9 @@ async function handleConfigUnset({
3148
3148
  }
3149
3149
 
3150
3150
  const {
3151
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$E
3151
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$F
3152
3152
  } = constants;
3153
- const config$I = {
3153
+ const config$J = {
3154
3154
  commandName: 'unset',
3155
3155
  description: 'Clear the value of a local CLI config item',
3156
3156
  hidden: false,
@@ -3174,16 +3174,16 @@ ${Array.from(utils.supportedConfigKeys.entries()).map(([key, desc]) => ` - $
3174
3174
  `
3175
3175
  };
3176
3176
  const cmdConfigUnset = {
3177
- description: config$I.description,
3178
- hidden: config$I.hidden,
3179
- run: run$I
3177
+ description: config$J.description,
3178
+ hidden: config$J.hidden,
3179
+ run: run$J
3180
3180
  };
3181
- async function run$I(argv, importMeta, {
3181
+ async function run$J(argv, importMeta, {
3182
3182
  parentName
3183
3183
  }) {
3184
3184
  const cli = utils.meowOrExit({
3185
3185
  argv,
3186
- config: config$I,
3186
+ config: config$J,
3187
3187
  importMeta,
3188
3188
  parentName
3189
3189
  });
@@ -3209,7 +3209,7 @@ async function run$I(argv, importMeta, {
3209
3209
  return;
3210
3210
  }
3211
3211
  if (cli.flags['dryRun']) {
3212
- logger.logger.log(DRY_RUN_BAILING_NOW$E);
3212
+ logger.logger.log(DRY_RUN_BAILING_NOW$F);
3213
3213
  return;
3214
3214
  }
3215
3215
  await handleConfigUnset({
@@ -3318,9 +3318,9 @@ async function handleDependencies({
3318
3318
  }
3319
3319
 
3320
3320
  const {
3321
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$D
3321
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$E
3322
3322
  } = constants;
3323
- const config$H = {
3323
+ const config$I = {
3324
3324
  commandName: 'dependencies',
3325
3325
  description: 'Search for any dependency that is being used in your organization',
3326
3326
  hidden: false,
@@ -3356,16 +3356,16 @@ const config$H = {
3356
3356
  `
3357
3357
  };
3358
3358
  const cmdScanCreate$1 = {
3359
- description: config$H.description,
3360
- hidden: config$H.hidden,
3361
- run: run$H
3359
+ description: config$I.description,
3360
+ hidden: config$I.hidden,
3361
+ run: run$I
3362
3362
  };
3363
- async function run$H(argv, importMeta, {
3363
+ async function run$I(argv, importMeta, {
3364
3364
  parentName
3365
3365
  }) {
3366
3366
  const cli = utils.meowOrExit({
3367
3367
  argv,
3368
- config: config$H,
3368
+ config: config$I,
3369
3369
  importMeta,
3370
3370
  parentName
3371
3371
  });
@@ -3394,7 +3394,7 @@ async function run$H(argv, importMeta, {
3394
3394
  return;
3395
3395
  }
3396
3396
  if (cli.flags['dryRun']) {
3397
- logger.logger.log(DRY_RUN_BAILING_NOW$D);
3397
+ logger.logger.log(DRY_RUN_BAILING_NOW$E);
3398
3398
  return;
3399
3399
  }
3400
3400
  await handleDependencies({
@@ -3491,9 +3491,9 @@ async function handleDiffScan$1({
3491
3491
  }
3492
3492
 
3493
3493
  const {
3494
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$C
3494
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$D
3495
3495
  } = constants;
3496
- const config$G = {
3496
+ const config$H = {
3497
3497
  commandName: 'get',
3498
3498
  description: 'Get a diff scan for an organization',
3499
3499
  hidden: false,
@@ -3552,16 +3552,16 @@ const config$G = {
3552
3552
  `
3553
3553
  };
3554
3554
  const cmdDiffScanGet = {
3555
- description: config$G.description,
3556
- hidden: config$G.hidden,
3557
- run: run$G
3555
+ description: config$H.description,
3556
+ hidden: config$H.hidden,
3557
+ run: run$H
3558
3558
  };
3559
- async function run$G(argv, importMeta, {
3559
+ async function run$H(argv, importMeta, {
3560
3560
  parentName
3561
3561
  }) {
3562
3562
  const cli = utils.meowOrExit({
3563
3563
  argv,
3564
- config: config$G,
3564
+ config: config$H,
3565
3565
  importMeta,
3566
3566
  parentName
3567
3567
  });
@@ -3606,7 +3606,7 @@ async function run$G(argv, importMeta, {
3606
3606
  }
3607
3607
  logger.logger.fail('Warning: this command is deprecated in favor of `socket scan diff` and will be removed in the next major bump.');
3608
3608
  if (cli.flags['dryRun']) {
3609
- logger.logger.log(DRY_RUN_BAILING_NOW$C);
3609
+ logger.logger.log(DRY_RUN_BAILING_NOW$D);
3610
3610
  return;
3611
3611
  }
3612
3612
  await handleDiffScan$1({
@@ -4746,7 +4746,7 @@ async function pnpmFix(pkgEnvDetails, {
4746
4746
  author: gitUser
4747
4747
  }) : [];
4748
4748
  if (openPrs.length) {
4749
- debug.debugFn(`found: ${openPrs.length} open PRs`);
4749
+ debug.debugFn(`found: ${openPrs.length} open PRs\n`, openPrs);
4750
4750
  }
4751
4751
  let count = isCi ? openPrs.length : 0;
4752
4752
  let actualTree;
@@ -5329,7 +5329,7 @@ async function handleFix({
5329
5329
  const {
5330
5330
  DRY_RUN_NOT_SAVING
5331
5331
  } = constants;
5332
- const config$F = {
5332
+ const config$G = {
5333
5333
  commandName: 'fix',
5334
5334
  description: 'Update dependencies with "fixable" Socket alerts',
5335
5335
  hidden: false,
@@ -5397,16 +5397,16 @@ const config$F = {
5397
5397
  `
5398
5398
  };
5399
5399
  const cmdFix = {
5400
- description: config$F.description,
5401
- hidden: config$F.hidden,
5402
- run: run$F
5400
+ description: config$G.description,
5401
+ hidden: config$G.hidden,
5402
+ run: run$G
5403
5403
  };
5404
- async function run$F(argv, importMeta, {
5404
+ async function run$G(argv, importMeta, {
5405
5405
  parentName
5406
5406
  }) {
5407
5407
  const cli = utils.meowOrExit({
5408
5408
  argv,
5409
- config: config$F,
5409
+ config: config$G,
5410
5410
  importMeta,
5411
5411
  parentName
5412
5412
  });
@@ -5608,9 +5608,9 @@ async function handlePackageInfo({
5608
5608
  }
5609
5609
 
5610
5610
  const {
5611
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$B
5611
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$C
5612
5612
  } = constants;
5613
- const config$E = {
5613
+ const config$F = {
5614
5614
  commandName: 'info',
5615
5615
  description: 'Look up info regarding a package',
5616
5616
  hidden: true,
@@ -5635,16 +5635,16 @@ const config$E = {
5635
5635
  `
5636
5636
  };
5637
5637
  const cmdInfo = {
5638
- description: config$E.description,
5639
- hidden: config$E.hidden,
5640
- run: run$E
5638
+ description: config$F.description,
5639
+ hidden: config$F.hidden,
5640
+ run: run$F
5641
5641
  };
5642
- async function run$E(argv, importMeta, {
5642
+ async function run$F(argv, importMeta, {
5643
5643
  parentName
5644
5644
  }) {
5645
5645
  const cli = utils.meowOrExit({
5646
5646
  argv,
5647
- config: config$E,
5647
+ config: config$F,
5648
5648
  importMeta,
5649
5649
  parentName
5650
5650
  });
@@ -5681,11 +5681,11 @@ async function run$E(argv, importMeta, {
5681
5681
  const pkgName = versionSeparator < 1 ? rawPkgName : rawPkgName.slice(0, versionSeparator);
5682
5682
  const pkgVersion = versionSeparator < 1 ? 'latest' : rawPkgName.slice(versionSeparator + 1);
5683
5683
  if (cli.flags['dryRun']) {
5684
- logger.logger.log(DRY_RUN_BAILING_NOW$B);
5684
+ logger.logger.log(DRY_RUN_BAILING_NOW$C);
5685
5685
  return;
5686
5686
  }
5687
5687
  await handlePackageInfo({
5688
- commandName: `${parentName} ${config$E.commandName}`,
5688
+ commandName: `${parentName} ${config$F.commandName}`,
5689
5689
  includeAllIssues: Boolean(all),
5690
5690
  outputKind,
5691
5691
  pkgName,
@@ -5813,9 +5813,9 @@ async function handleInstallCompletion(targetName) {
5813
5813
  }
5814
5814
 
5815
5815
  const {
5816
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$A
5816
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$B
5817
5817
  } = constants;
5818
- const config$D = {
5818
+ const config$E = {
5819
5819
  commandName: 'completion',
5820
5820
  description: 'Install bash completion for Socket CLI',
5821
5821
  hidden: true,
@@ -5853,22 +5853,22 @@ const config$D = {
5853
5853
  `
5854
5854
  };
5855
5855
  const cmdInstallCompletion = {
5856
- description: config$D.description,
5857
- hidden: config$D.hidden,
5858
- run: run$D
5856
+ description: config$E.description,
5857
+ hidden: config$E.hidden,
5858
+ run: run$E
5859
5859
  };
5860
- async function run$D(argv, importMeta, {
5860
+ async function run$E(argv, importMeta, {
5861
5861
  parentName
5862
5862
  }) {
5863
5863
  const cli = utils.meowOrExit({
5864
5864
  argv,
5865
- config: config$D,
5865
+ config: config$E,
5866
5866
  importMeta,
5867
5867
  parentName
5868
5868
  });
5869
5869
  const targetName = cli.input[0] || 'socket';
5870
5870
  if (cli.flags['dryRun']) {
5871
- logger.logger.log(DRY_RUN_BAILING_NOW$A);
5871
+ logger.logger.log(DRY_RUN_BAILING_NOW$B);
5872
5872
  return;
5873
5873
  }
5874
5874
  await handleInstallCompletion(String(targetName));
@@ -5986,9 +5986,9 @@ async function attemptLogin(apiBaseUrl, apiProxy) {
5986
5986
  }
5987
5987
 
5988
5988
  const {
5989
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$z
5989
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$A
5990
5990
  } = constants;
5991
- const config$C = {
5991
+ const config$D = {
5992
5992
  commandName: 'login',
5993
5993
  description: 'Socket API login',
5994
5994
  hidden: false,
@@ -6021,23 +6021,23 @@ const config$C = {
6021
6021
  `
6022
6022
  };
6023
6023
  const cmdLogin = {
6024
- description: config$C.description,
6025
- hidden: config$C.hidden,
6026
- run: run$C
6024
+ description: config$D.description,
6025
+ hidden: config$D.hidden,
6026
+ run: run$D
6027
6027
  };
6028
- async function run$C(argv, importMeta, {
6028
+ async function run$D(argv, importMeta, {
6029
6029
  parentName
6030
6030
  }) {
6031
6031
  const cli = utils.meowOrExit({
6032
6032
  argv,
6033
- config: config$C,
6033
+ config: config$D,
6034
6034
  importMeta,
6035
6035
  parentName
6036
6036
  });
6037
6037
  const apiBaseUrl = cli.flags['apiBaseUrl'];
6038
6038
  const apiProxy = cli.flags['apiProxy'];
6039
6039
  if (cli.flags['dryRun']) {
6040
- logger.logger.log(DRY_RUN_BAILING_NOW$z);
6040
+ logger.logger.log(DRY_RUN_BAILING_NOW$A);
6041
6041
  return;
6042
6042
  }
6043
6043
  if (!vendor.isInteractiveExports()) {
@@ -6067,9 +6067,9 @@ function attemptLogout() {
6067
6067
  }
6068
6068
 
6069
6069
  const {
6070
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$y
6070
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$z
6071
6071
  } = constants;
6072
- const config$B = {
6072
+ const config$C = {
6073
6073
  commandName: 'logout',
6074
6074
  description: 'Socket API logout',
6075
6075
  hidden: false,
@@ -6084,30 +6084,30 @@ const config$B = {
6084
6084
  `
6085
6085
  };
6086
6086
  const cmdLogout = {
6087
- description: config$B.description,
6088
- hidden: config$B.hidden,
6089
- run: run$B
6087
+ description: config$C.description,
6088
+ hidden: config$C.hidden,
6089
+ run: run$C
6090
6090
  };
6091
- async function run$B(argv, importMeta, {
6091
+ async function run$C(argv, importMeta, {
6092
6092
  parentName
6093
6093
  }) {
6094
6094
  const cli = utils.meowOrExit({
6095
6095
  argv,
6096
- config: config$B,
6096
+ config: config$C,
6097
6097
  importMeta,
6098
6098
  parentName
6099
6099
  });
6100
6100
  if (cli.flags['dryRun']) {
6101
- logger.logger.log(DRY_RUN_BAILING_NOW$y);
6101
+ logger.logger.log(DRY_RUN_BAILING_NOW$z);
6102
6102
  return;
6103
6103
  }
6104
6104
  attemptLogout();
6105
6105
  }
6106
6106
 
6107
6107
  const {
6108
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$x
6108
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$y
6109
6109
  } = constants;
6110
- const config$A = {
6110
+ const config$B = {
6111
6111
  commandName: 'auto',
6112
6112
  description: 'Auto-detect build and attempt to generate manifest file',
6113
6113
  hidden: false,
@@ -6140,16 +6140,16 @@ const config$A = {
6140
6140
  `
6141
6141
  };
6142
6142
  const cmdManifestAuto = {
6143
- description: config$A.description,
6144
- hidden: config$A.hidden,
6145
- run: run$A
6143
+ description: config$B.description,
6144
+ hidden: config$B.hidden,
6145
+ run: run$B
6146
6146
  };
6147
- async function run$A(argv, importMeta, {
6147
+ async function run$B(argv, importMeta, {
6148
6148
  parentName
6149
6149
  }) {
6150
6150
  const cli = utils.meowOrExit({
6151
6151
  argv,
6152
- config: config$A,
6152
+ config: config$B,
6153
6153
  importMeta,
6154
6154
  parentName
6155
6155
  });
@@ -6165,7 +6165,7 @@ async function run$A(argv, importMeta, {
6165
6165
  // If given path is absolute then cwd should not affect it.
6166
6166
  cwd = path.resolve(process.cwd(), cwd);
6167
6167
  if (verbose) {
6168
- logger.logger.group('- ', parentName, config$A.commandName, ':');
6168
+ logger.logger.group('- ', parentName, config$B.commandName, ':');
6169
6169
  logger.logger.group('- flags:', cli.flags);
6170
6170
  logger.logger.groupEnd();
6171
6171
  logger.logger.log('- input:', cli.input);
@@ -6176,7 +6176,7 @@ async function run$A(argv, importMeta, {
6176
6176
  const detected = await detectManifestActions(socketJson, cwd);
6177
6177
  debug.debugLog('[DEBUG]', detected);
6178
6178
  if (cli.flags['dryRun']) {
6179
- logger.logger.log(DRY_RUN_BAILING_NOW$x);
6179
+ logger.logger.log(DRY_RUN_BAILING_NOW$y);
6180
6180
  return;
6181
6181
  }
6182
6182
  if (!detected.count) {
@@ -6198,9 +6198,9 @@ async function run$A(argv, importMeta, {
6198
6198
  }
6199
6199
 
6200
6200
  const {
6201
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$w
6201
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$x
6202
6202
  } = constants;
6203
- const config$z = {
6203
+ const config$A = {
6204
6204
  commandName: 'conda',
6205
6205
  description: '[beta] Convert a Conda environment.yml file to a python requirements.txt',
6206
6206
  hidden: false,
@@ -6251,16 +6251,16 @@ const config$z = {
6251
6251
  `
6252
6252
  };
6253
6253
  const cmdManifestConda = {
6254
- description: config$z.description,
6255
- hidden: config$z.hidden,
6256
- run: run$z
6254
+ description: config$A.description,
6255
+ hidden: config$A.hidden,
6256
+ run: run$A
6257
6257
  };
6258
- async function run$z(argv, importMeta, {
6258
+ async function run$A(argv, importMeta, {
6259
6259
  parentName
6260
6260
  }) {
6261
6261
  const cli = utils.meowOrExit({
6262
6262
  argv,
6263
- config: config$z,
6263
+ config: config$A,
6264
6264
  importMeta,
6265
6265
  parentName
6266
6266
  });
@@ -6318,7 +6318,7 @@ async function run$z(argv, importMeta, {
6318
6318
  verbose = false;
6319
6319
  }
6320
6320
  if (verbose) {
6321
- logger.logger.group('- ', parentName, config$z.commandName, ':');
6321
+ logger.logger.group('- ', parentName, config$A.commandName, ':');
6322
6322
  logger.logger.group('- flags:', cli.flags);
6323
6323
  logger.logger.groupEnd();
6324
6324
  logger.logger.log('- target:', cwd);
@@ -6343,7 +6343,7 @@ async function run$z(argv, importMeta, {
6343
6343
  }
6344
6344
  logger.logger.warn('Warning: This will approximate your Conda dependencies using PyPI. We do not yet officially support Conda. Use at your own risk.');
6345
6345
  if (cli.flags['dryRun']) {
6346
- logger.logger.log(DRY_RUN_BAILING_NOW$w);
6346
+ logger.logger.log(DRY_RUN_BAILING_NOW$x);
6347
6347
  return;
6348
6348
  }
6349
6349
  await handleManifestConda({
@@ -6356,9 +6356,9 @@ async function run$z(argv, importMeta, {
6356
6356
  }
6357
6357
 
6358
6358
  const {
6359
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$v
6359
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$w
6360
6360
  } = constants;
6361
- const config$y = {
6361
+ const config$z = {
6362
6362
  commandName: 'gradle',
6363
6363
  description: '[beta] Use Gradle to generate a manifest file (`pom.xml`) for a Gradle/Java/Kotlin/etc project',
6364
6364
  hidden: false,
@@ -6411,16 +6411,16 @@ const config$y = {
6411
6411
  `
6412
6412
  };
6413
6413
  const cmdManifestGradle = {
6414
- description: config$y.description,
6415
- hidden: config$y.hidden,
6416
- run: run$y
6414
+ description: config$z.description,
6415
+ hidden: config$z.hidden,
6416
+ run: run$z
6417
6417
  };
6418
- async function run$y(argv, importMeta, {
6418
+ async function run$z(argv, importMeta, {
6419
6419
  parentName
6420
6420
  }) {
6421
6421
  const cli = utils.meowOrExit({
6422
6422
  argv,
6423
- config: config$y,
6423
+ config: config$z,
6424
6424
  importMeta,
6425
6425
  parentName
6426
6426
  });
@@ -6467,7 +6467,7 @@ async function run$y(argv, importMeta, {
6467
6467
  }
6468
6468
  }
6469
6469
  if (verbose) {
6470
- logger.logger.group('- ', parentName, config$y.commandName, ':');
6470
+ logger.logger.group('- ', parentName, config$z.commandName, ':');
6471
6471
  logger.logger.group('- flags:', cli.flags);
6472
6472
  logger.logger.groupEnd();
6473
6473
  logger.logger.log('- input:', cli.input);
@@ -6495,7 +6495,7 @@ async function run$y(argv, importMeta, {
6495
6495
  logger.logger.groupEnd();
6496
6496
  }
6497
6497
  if (cli.flags['dryRun']) {
6498
- logger.logger.log(DRY_RUN_BAILING_NOW$v);
6498
+ logger.logger.log(DRY_RUN_BAILING_NOW$w);
6499
6499
  return;
6500
6500
  }
6501
6501
  await convertGradleToMaven({
@@ -6507,7 +6507,7 @@ async function run$y(argv, importMeta, {
6507
6507
  }
6508
6508
 
6509
6509
  const {
6510
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$u
6510
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$v
6511
6511
  } = constants;
6512
6512
 
6513
6513
  // TODO: we may want to dedupe some pieces for all gradle languages. I think it
@@ -6515,7 +6515,7 @@ const {
6515
6515
  // sense for the help panels to note the requested language, rather than
6516
6516
  // `socket manifest kotlin` to print help screens with `gradle` as the
6517
6517
  // command. Room for improvement.
6518
- const config$x = {
6518
+ const config$y = {
6519
6519
  commandName: 'kotlin',
6520
6520
  description: '[beta] Use Gradle to generate a manifest file (`pom.xml`) for a Kotlin project',
6521
6521
  hidden: false,
@@ -6568,16 +6568,16 @@ const config$x = {
6568
6568
  `
6569
6569
  };
6570
6570
  const cmdManifestKotlin = {
6571
- description: config$x.description,
6572
- hidden: config$x.hidden,
6573
- run: run$x
6571
+ description: config$y.description,
6572
+ hidden: config$y.hidden,
6573
+ run: run$y
6574
6574
  };
6575
- async function run$x(argv, importMeta, {
6575
+ async function run$y(argv, importMeta, {
6576
6576
  parentName
6577
6577
  }) {
6578
6578
  const cli = utils.meowOrExit({
6579
6579
  argv,
6580
- config: config$x,
6580
+ config: config$y,
6581
6581
  importMeta,
6582
6582
  parentName
6583
6583
  });
@@ -6624,7 +6624,7 @@ async function run$x(argv, importMeta, {
6624
6624
  }
6625
6625
  }
6626
6626
  if (verbose) {
6627
- logger.logger.group('- ', parentName, config$x.commandName, ':');
6627
+ logger.logger.group('- ', parentName, config$y.commandName, ':');
6628
6628
  logger.logger.group('- flags:', cli.flags);
6629
6629
  logger.logger.groupEnd();
6630
6630
  logger.logger.log('- input:', cli.input);
@@ -6652,7 +6652,7 @@ async function run$x(argv, importMeta, {
6652
6652
  logger.logger.groupEnd();
6653
6653
  }
6654
6654
  if (cli.flags['dryRun']) {
6655
- logger.logger.log(DRY_RUN_BAILING_NOW$u);
6655
+ logger.logger.log(DRY_RUN_BAILING_NOW$v);
6656
6656
  return;
6657
6657
  }
6658
6658
  await convertGradleToMaven({
@@ -6664,9 +6664,9 @@ async function run$x(argv, importMeta, {
6664
6664
  }
6665
6665
 
6666
6666
  const {
6667
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$t
6667
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$u
6668
6668
  } = constants;
6669
- const config$w = {
6669
+ const config$x = {
6670
6670
  commandName: 'scala',
6671
6671
  description: "[beta] Generate a manifest file (`pom.xml`) from Scala's `build.sbt` file",
6672
6672
  hidden: false,
@@ -6732,16 +6732,16 @@ const config$w = {
6732
6732
  `
6733
6733
  };
6734
6734
  const cmdManifestScala = {
6735
- description: config$w.description,
6736
- hidden: config$w.hidden,
6737
- run: run$w
6735
+ description: config$x.description,
6736
+ hidden: config$x.hidden,
6737
+ run: run$x
6738
6738
  };
6739
- async function run$w(argv, importMeta, {
6739
+ async function run$x(argv, importMeta, {
6740
6740
  parentName
6741
6741
  }) {
6742
6742
  const cli = utils.meowOrExit({
6743
6743
  argv,
6744
- config: config$w,
6744
+ config: config$x,
6745
6745
  importMeta,
6746
6746
  parentName
6747
6747
  });
@@ -6802,7 +6802,7 @@ async function run$w(argv, importMeta, {
6802
6802
  verbose = false;
6803
6803
  }
6804
6804
  if (verbose) {
6805
- logger.logger.group('- ', parentName, config$w.commandName, ':');
6805
+ logger.logger.group('- ', parentName, config$x.commandName, ':');
6806
6806
  logger.logger.group('- flags:', cli.flags);
6807
6807
  logger.logger.groupEnd();
6808
6808
  logger.logger.log('- input:', cli.input);
@@ -6831,7 +6831,7 @@ async function run$w(argv, importMeta, {
6831
6831
  logger.logger.groupEnd();
6832
6832
  }
6833
6833
  if (cli.flags['dryRun']) {
6834
- logger.logger.log(DRY_RUN_BAILING_NOW$t);
6834
+ logger.logger.log(DRY_RUN_BAILING_NOW$u);
6835
6835
  return;
6836
6836
  }
6837
6837
  await convertSbtToMaven({
@@ -6969,7 +6969,7 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
6969
6969
  }
6970
6970
  default:
6971
6971
  {
6972
- result = canceledByUser();
6972
+ result = canceledByUser$1();
6973
6973
  }
6974
6974
  }
6975
6975
  if (!result.ok || result.data.canceled) {
@@ -6992,12 +6992,12 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
6992
6992
  })) {
6993
6993
  return await utils.writeSocketJson(cwd, socketJson);
6994
6994
  }
6995
- return canceledByUser();
6995
+ return canceledByUser$1();
6996
6996
  }
6997
6997
  async function setupConda(config) {
6998
6998
  const on = await askForEnabled(!config.disabled);
6999
6999
  if (on === undefined) {
7000
- return canceledByUser();
7000
+ return canceledByUser$1();
7001
7001
  } else if (on) {
7002
7002
  delete config.disabled;
7003
7003
  } else {
@@ -7005,7 +7005,7 @@ async function setupConda(config) {
7005
7005
  }
7006
7006
  const inf = await askForInputFile(config.infile || 'environment.yml');
7007
7007
  if (inf === undefined) {
7008
- return canceledByUser();
7008
+ return canceledByUser$1();
7009
7009
  } else if (inf.trim() === '-') {
7010
7010
  config.stdin = true;
7011
7011
  } else {
@@ -7018,7 +7018,7 @@ async function setupConda(config) {
7018
7018
  }
7019
7019
  const stdout = await askForStdout(config.stdout);
7020
7020
  if (stdout === undefined) {
7021
- return canceledByUser();
7021
+ return canceledByUser$1();
7022
7022
  } else if (stdout === 'yes') {
7023
7023
  config.stdout = true;
7024
7024
  } else if (stdout === 'no') {
@@ -7029,7 +7029,7 @@ async function setupConda(config) {
7029
7029
  if (!config.stdout) {
7030
7030
  const out = await askForOutputFile(config.outfile || 'requirements.txt');
7031
7031
  if (out === undefined) {
7032
- return canceledByUser();
7032
+ return canceledByUser$1();
7033
7033
  } else if (out === '-') {
7034
7034
  config.stdout = true;
7035
7035
  } else {
@@ -7043,18 +7043,18 @@ async function setupConda(config) {
7043
7043
  }
7044
7044
  const verbose = await askForVerboseFlag(config.verbose);
7045
7045
  if (verbose === undefined) {
7046
- return canceledByUser();
7046
+ return canceledByUser$1();
7047
7047
  } else if (verbose === 'yes' || verbose === 'no') {
7048
7048
  config.verbose = verbose === 'yes';
7049
7049
  } else {
7050
7050
  delete config.verbose;
7051
7051
  }
7052
- return notCanceled();
7052
+ return notCanceled$1();
7053
7053
  }
7054
7054
  async function setupGradle(config) {
7055
7055
  const bin = await askForBin(config.bin || './gradlew');
7056
7056
  if (bin === undefined) {
7057
- return canceledByUser();
7057
+ return canceledByUser$1();
7058
7058
  } else if (bin.trim()) {
7059
7059
  config.bin = bin.trim();
7060
7060
  } else {
@@ -7067,7 +7067,7 @@ async function setupGradle(config) {
7067
7067
  // validate: async string => bool
7068
7068
  });
7069
7069
  if (opts === undefined) {
7070
- return canceledByUser();
7070
+ return canceledByUser$1();
7071
7071
  } else if (opts.trim()) {
7072
7072
  config.gradleOpts = opts.trim();
7073
7073
  } else {
@@ -7075,18 +7075,18 @@ async function setupGradle(config) {
7075
7075
  }
7076
7076
  const verbose = await askForVerboseFlag(config.verbose);
7077
7077
  if (verbose === undefined) {
7078
- return canceledByUser();
7078
+ return canceledByUser$1();
7079
7079
  } else if (verbose === 'yes' || verbose === 'no') {
7080
7080
  config.verbose = verbose === 'yes';
7081
7081
  } else {
7082
7082
  delete config.verbose;
7083
7083
  }
7084
- return notCanceled();
7084
+ return notCanceled$1();
7085
7085
  }
7086
7086
  async function setupSbt(config) {
7087
7087
  const bin = await askForBin(config.bin || 'sbt');
7088
7088
  if (bin === undefined) {
7089
- return canceledByUser();
7089
+ return canceledByUser$1();
7090
7090
  } else if (bin.trim()) {
7091
7091
  config.bin = bin.trim();
7092
7092
  } else {
@@ -7099,7 +7099,7 @@ async function setupSbt(config) {
7099
7099
  // validate: async string => bool
7100
7100
  });
7101
7101
  if (opts === undefined) {
7102
- return canceledByUser();
7102
+ return canceledByUser$1();
7103
7103
  } else if (opts.trim()) {
7104
7104
  config.sbtOpts = opts.trim();
7105
7105
  } else {
@@ -7107,7 +7107,7 @@ async function setupSbt(config) {
7107
7107
  }
7108
7108
  const stdout = await askForStdout(config.stdout);
7109
7109
  if (stdout === undefined) {
7110
- return canceledByUser();
7110
+ return canceledByUser$1();
7111
7111
  } else if (stdout === 'yes') {
7112
7112
  config.stdout = true;
7113
7113
  } else if (stdout === 'no') {
@@ -7118,7 +7118,7 @@ async function setupSbt(config) {
7118
7118
  if (config.stdout !== true) {
7119
7119
  const out = await askForOutputFile(config.outfile || 'sbt.pom.xml');
7120
7120
  if (out === undefined) {
7121
- return canceledByUser();
7121
+ return canceledByUser$1();
7122
7122
  } else if (out === '-') {
7123
7123
  config.stdout = true;
7124
7124
  } else {
@@ -7132,13 +7132,13 @@ async function setupSbt(config) {
7132
7132
  }
7133
7133
  const verbose = await askForVerboseFlag(config.verbose);
7134
7134
  if (verbose === undefined) {
7135
- return canceledByUser();
7135
+ return canceledByUser$1();
7136
7136
  } else if (verbose === 'yes' || verbose === 'no') {
7137
7137
  config.verbose = verbose === 'yes';
7138
7138
  } else {
7139
7139
  delete config.verbose;
7140
7140
  }
7141
- return notCanceled();
7141
+ return notCanceled$1();
7142
7142
  }
7143
7143
  async function askForStdout(defaultValue) {
7144
7144
  return await prompts.select({
@@ -7146,12 +7146,10 @@ async function askForStdout(defaultValue) {
7146
7146
  choices: [{
7147
7147
  name: 'no',
7148
7148
  value: 'no',
7149
- selected: defaultValue === false,
7150
7149
  description: 'Write output to a file, not stdout'
7151
7150
  }, {
7152
7151
  name: 'yes',
7153
7152
  value: 'yes',
7154
- selected: defaultValue === true,
7155
7153
  description: 'Print in stdout (this will supersede --out)'
7156
7154
  }, {
7157
7155
  name: '(leave default)',
@@ -7167,12 +7165,10 @@ async function askForEnabled(defaultValue) {
7167
7165
  choices: [{
7168
7166
  name: 'Enable',
7169
7167
  value: true,
7170
- selected: defaultValue === true,
7171
7168
  description: 'Generate manifest files for this language when detected'
7172
7169
  }, {
7173
7170
  name: 'Disable',
7174
7171
  value: false,
7175
- selected: defaultValue === false,
7176
7172
  description: 'Do not generate manifest files for this language when detected, unless explicitly asking for it'
7177
7173
  }, {
7178
7174
  name: 'Cancel',
@@ -7212,12 +7208,10 @@ async function askForVerboseFlag(current) {
7212
7208
  choices: [{
7213
7209
  name: 'no',
7214
7210
  value: 'no',
7215
- selected: current === false,
7216
7211
  description: 'Do not run this manifest in verbose mode'
7217
7212
  }, {
7218
7213
  name: 'yes',
7219
7214
  value: 'yes',
7220
- selected: current === true,
7221
7215
  description: 'Run this manifest in verbose mode'
7222
7216
  }, {
7223
7217
  name: '(leave default)',
@@ -7227,7 +7221,7 @@ async function askForVerboseFlag(current) {
7227
7221
  default: current === true ? 'yes' : current === false ? 'no' : ''
7228
7222
  });
7229
7223
  }
7230
- function canceledByUser() {
7224
+ function canceledByUser$1() {
7231
7225
  logger.logger.log('');
7232
7226
  logger.logger.info('User canceled');
7233
7227
  logger.logger.log('');
@@ -7238,7 +7232,7 @@ function canceledByUser() {
7238
7232
  }
7239
7233
  };
7240
7234
  }
7241
- function notCanceled() {
7235
+ function notCanceled$1() {
7242
7236
  return {
7243
7237
  ok: true,
7244
7238
  data: {
@@ -7253,9 +7247,9 @@ async function handleManifestSetup(cwd, defaultOnReadError) {
7253
7247
  }
7254
7248
 
7255
7249
  const {
7256
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$s
7250
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$t
7257
7251
  } = constants;
7258
- const config$v = {
7252
+ const config$w = {
7259
7253
  commandName: 'setup',
7260
7254
  description: 'Start interactive configurator to customize default flag values for `socket manifest` in this dir',
7261
7255
  hidden: false,
@@ -7299,16 +7293,16 @@ const config$v = {
7299
7293
  `
7300
7294
  };
7301
7295
  const cmdManifestSetup = {
7302
- description: config$v.description,
7303
- hidden: config$v.hidden,
7304
- run: run$v
7296
+ description: config$w.description,
7297
+ hidden: config$w.hidden,
7298
+ run: run$w
7305
7299
  };
7306
- async function run$v(argv, importMeta, {
7300
+ async function run$w(argv, importMeta, {
7307
7301
  parentName
7308
7302
  }) {
7309
7303
  const cli = utils.meowOrExit({
7310
7304
  argv,
7311
- config: config$v,
7305
+ config: config$w,
7312
7306
  importMeta,
7313
7307
  parentName
7314
7308
  });
@@ -7320,13 +7314,13 @@ async function run$v(argv, importMeta, {
7320
7314
  // If given path is absolute then cwd should not affect it.
7321
7315
  cwd = path.resolve(process.cwd(), cwd);
7322
7316
  if (cli.flags['dryRun']) {
7323
- logger.logger.log(DRY_RUN_BAILING_NOW$s);
7317
+ logger.logger.log(DRY_RUN_BAILING_NOW$t);
7324
7318
  return;
7325
7319
  }
7326
7320
  await handleManifestSetup(cwd, Boolean(defaultOnReadError));
7327
7321
  }
7328
7322
 
7329
- const config$u = {
7323
+ const config$v = {
7330
7324
  commandName: 'manifest',
7331
7325
  description: 'Generate a dependency manifest for given file or dir',
7332
7326
  hidden: false,
@@ -7334,11 +7328,11 @@ const config$u = {
7334
7328
  ...utils.commonFlags
7335
7329
  }};
7336
7330
  const cmdManifest = {
7337
- description: config$u.description,
7338
- hidden: config$u.hidden,
7339
- run: run$u
7331
+ description: config$v.description,
7332
+ hidden: config$v.hidden,
7333
+ run: run$v
7340
7334
  };
7341
- async function run$u(argv, importMeta, {
7335
+ async function run$v(argv, importMeta, {
7342
7336
  parentName
7343
7337
  }) {
7344
7338
  await utils.meowWithSubcommands({
@@ -7353,23 +7347,23 @@ async function run$u(argv, importMeta, {
7353
7347
  argv,
7354
7348
  aliases: {
7355
7349
  yolo: {
7356
- description: config$u.description,
7350
+ description: config$v.description,
7357
7351
  hidden: true,
7358
7352
  argv: ['auto']
7359
7353
  }
7360
7354
  },
7361
- description: config$u.description,
7355
+ description: config$v.description,
7362
7356
  importMeta,
7363
- flags: config$u.flags,
7364
- name: `${parentName} ${config$u.commandName}`
7357
+ flags: config$v.flags,
7358
+ name: `${parentName} ${config$v.commandName}`
7365
7359
  });
7366
7360
  }
7367
7361
 
7368
7362
  const require$3 =Module.createRequire(require$$0.pathToFileURL(__filename).href)
7369
7363
  const {
7370
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$r
7364
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$s
7371
7365
  } = constants;
7372
- const config$t = {
7366
+ const config$u = {
7373
7367
  commandName: 'npm',
7374
7368
  description: `npm wrapper functionality`,
7375
7369
  hidden: false,
@@ -7382,21 +7376,21 @@ const config$t = {
7382
7376
  `
7383
7377
  };
7384
7378
  const cmdNpm = {
7385
- description: config$t.description,
7386
- hidden: config$t.hidden,
7387
- run: run$t
7379
+ description: config$u.description,
7380
+ hidden: config$u.hidden,
7381
+ run: run$u
7388
7382
  };
7389
- async function run$t(argv, importMeta, {
7383
+ async function run$u(argv, importMeta, {
7390
7384
  parentName
7391
7385
  }) {
7392
7386
  const cli = utils.meowOrExit({
7393
7387
  argv,
7394
- config: config$t,
7388
+ config: config$u,
7395
7389
  importMeta,
7396
7390
  parentName
7397
7391
  });
7398
7392
  if (cli.flags['dryRun']) {
7399
- logger.logger.log(DRY_RUN_BAILING_NOW$r);
7393
+ logger.logger.log(DRY_RUN_BAILING_NOW$s);
7400
7394
  return;
7401
7395
  }
7402
7396
 
@@ -7407,9 +7401,9 @@ async function run$t(argv, importMeta, {
7407
7401
 
7408
7402
  const require$2 =Module.createRequire(require$$0.pathToFileURL(__filename).href)
7409
7403
  const {
7410
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$q
7404
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$r
7411
7405
  } = constants;
7412
- const config$s = {
7406
+ const config$t = {
7413
7407
  commandName: 'npx',
7414
7408
  description: `npx wrapper functionality`,
7415
7409
  hidden: false,
@@ -7422,21 +7416,21 @@ const config$s = {
7422
7416
  `
7423
7417
  };
7424
7418
  const cmdNpx = {
7425
- description: config$s.description,
7426
- hidden: config$s.hidden,
7427
- run: run$s
7419
+ description: config$t.description,
7420
+ hidden: config$t.hidden,
7421
+ run: run$t
7428
7422
  };
7429
- async function run$s(argv, importMeta, {
7423
+ async function run$t(argv, importMeta, {
7430
7424
  parentName
7431
7425
  }) {
7432
7426
  const cli = utils.meowOrExit({
7433
7427
  argv,
7434
- config: config$s,
7428
+ config: config$t,
7435
7429
  importMeta,
7436
7430
  parentName
7437
7431
  });
7438
7432
  if (cli.flags['dryRun']) {
7439
- logger.logger.log(DRY_RUN_BAILING_NOW$q);
7433
+ logger.logger.log(DRY_RUN_BAILING_NOW$r);
7440
7434
  return;
7441
7435
  }
7442
7436
 
@@ -7446,9 +7440,9 @@ async function run$s(argv, importMeta, {
7446
7440
  }
7447
7441
 
7448
7442
  const {
7449
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$p
7443
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$q
7450
7444
  } = constants;
7451
- const config$r = {
7445
+ const config$s = {
7452
7446
  commandName: 'oops',
7453
7447
  description: 'Trigger an intentional error (for development)',
7454
7448
  hidden: true,
@@ -7464,16 +7458,16 @@ const config$r = {
7464
7458
  `
7465
7459
  };
7466
7460
  const cmdOops = {
7467
- description: config$r.description,
7468
- hidden: config$r.hidden,
7469
- run: run$r
7461
+ description: config$s.description,
7462
+ hidden: config$s.hidden,
7463
+ run: run$s
7470
7464
  };
7471
- async function run$r(argv, importMeta, {
7465
+ async function run$s(argv, importMeta, {
7472
7466
  parentName
7473
7467
  }) {
7474
7468
  const cli = utils.meowOrExit({
7475
7469
  argv,
7476
- config: config$r,
7470
+ config: config$s,
7477
7471
  importMeta,
7478
7472
  parentName
7479
7473
  });
@@ -7482,7 +7476,7 @@ async function run$r(argv, importMeta, {
7482
7476
  markdown
7483
7477
  } = cli.flags;
7484
7478
  if (cli.flags['dryRun']) {
7485
- logger.logger.log(DRY_RUN_BAILING_NOW$p);
7479
+ logger.logger.log(DRY_RUN_BAILING_NOW$q);
7486
7480
  return;
7487
7481
  }
7488
7482
  if (json) {
@@ -8238,9 +8232,9 @@ async function handleOptimize({
8238
8232
  }
8239
8233
 
8240
8234
  const {
8241
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$o
8235
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$p
8242
8236
  } = constants;
8243
- const config$q = {
8237
+ const config$r = {
8244
8238
  commandName: 'optimize',
8245
8239
  description: 'Optimize dependencies with @socketregistry overrides',
8246
8240
  hidden: false,
@@ -8270,16 +8264,16 @@ const config$q = {
8270
8264
  `
8271
8265
  };
8272
8266
  const cmdOptimize = {
8273
- description: config$q.description,
8274
- hidden: config$q.hidden,
8275
- run: run$q
8267
+ description: config$r.description,
8268
+ hidden: config$r.hidden,
8269
+ run: run$r
8276
8270
  };
8277
- async function run$q(argv, importMeta, {
8271
+ async function run$r(argv, importMeta, {
8278
8272
  parentName
8279
8273
  }) {
8280
8274
  const cli = utils.meowOrExit({
8281
8275
  argv,
8282
- config: config$q,
8276
+ config: config$r,
8283
8277
  importMeta,
8284
8278
  parentName
8285
8279
  });
@@ -8297,7 +8291,7 @@ async function run$q(argv, importMeta, {
8297
8291
  // If given path is absolute then cwd should not affect it.
8298
8292
  cwd = path.resolve(process.cwd(), cwd);
8299
8293
  if (cli.flags['dryRun']) {
8300
- logger.logger.log(DRY_RUN_BAILING_NOW$o);
8294
+ logger.logger.log(DRY_RUN_BAILING_NOW$p);
8301
8295
  return;
8302
8296
  }
8303
8297
  await handleOptimize({
@@ -8373,9 +8367,9 @@ async function handleOrganizationList(outputKind = 'text') {
8373
8367
  }
8374
8368
 
8375
8369
  const {
8376
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$n
8370
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$o
8377
8371
  } = constants;
8378
- const config$p = {
8372
+ const config$q = {
8379
8373
  commandName: 'list',
8380
8374
  description: 'List organizations associated with the API key used',
8381
8375
  hidden: false,
@@ -8392,20 +8386,20 @@ const config$p = {
8392
8386
  - Permissions: none (does need a token)
8393
8387
 
8394
8388
  Options
8395
- ${utils.getFlagListOutput(config$p.flags, 6)}
8389
+ ${utils.getFlagListOutput(config$q.flags, 6)}
8396
8390
  `
8397
8391
  };
8398
8392
  const cmdOrganizationList = {
8399
- description: config$p.description,
8400
- hidden: config$p.hidden,
8401
- run: run$p
8393
+ description: config$q.description,
8394
+ hidden: config$q.hidden,
8395
+ run: run$q
8402
8396
  };
8403
- async function run$p(argv, importMeta, {
8397
+ async function run$q(argv, importMeta, {
8404
8398
  parentName
8405
8399
  }) {
8406
8400
  const cli = utils.meowOrExit({
8407
8401
  argv,
8408
- config: config$p,
8402
+ config: config$q,
8409
8403
  importMeta,
8410
8404
  parentName
8411
8405
  });
@@ -8432,7 +8426,7 @@ async function run$p(argv, importMeta, {
8432
8426
  return;
8433
8427
  }
8434
8428
  if (cli.flags['dryRun']) {
8435
- logger.logger.log(DRY_RUN_BAILING_NOW$n);
8429
+ logger.logger.log(DRY_RUN_BAILING_NOW$o);
8436
8430
  return;
8437
8431
  }
8438
8432
  await handleOrganizationList(outputKind);
@@ -8478,11 +8472,11 @@ async function handleLicensePolicy(orgSlug, outputKind) {
8478
8472
  }
8479
8473
 
8480
8474
  const {
8481
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$m
8475
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$n
8482
8476
  } = constants;
8483
8477
 
8484
8478
  // TODO: secret toplevel alias `socket license policy`?
8485
- const config$o = {
8479
+ const config$p = {
8486
8480
  commandName: 'license',
8487
8481
  description: 'Retrieve the license policy of an organization',
8488
8482
  hidden: true,
@@ -8508,7 +8502,7 @@ const config$o = {
8508
8502
  - Permissions: license-policy:read
8509
8503
 
8510
8504
  Options
8511
- ${utils.getFlagListOutput(config$o.flags, 6)}
8505
+ ${utils.getFlagListOutput(config$p.flags, 6)}
8512
8506
 
8513
8507
  Your API token will need the \`license-policy:read\` permission otherwise
8514
8508
  the request will fail with an authentication error.
@@ -8519,16 +8513,16 @@ const config$o = {
8519
8513
  `
8520
8514
  };
8521
8515
  const cmdOrganizationPolicyLicense = {
8522
- description: config$o.description,
8523
- hidden: config$o.hidden,
8524
- run: run$o
8516
+ description: config$p.description,
8517
+ hidden: config$p.hidden,
8518
+ run: run$p
8525
8519
  };
8526
- async function run$o(argv, importMeta, {
8520
+ async function run$p(argv, importMeta, {
8527
8521
  parentName
8528
8522
  }) {
8529
8523
  const cli = utils.meowOrExit({
8530
8524
  argv,
8531
- config: config$o,
8525
+ config: config$p,
8532
8526
  importMeta,
8533
8527
  parentName
8534
8528
  });
@@ -8565,7 +8559,7 @@ async function run$o(argv, importMeta, {
8565
8559
  return;
8566
8560
  }
8567
8561
  if (cli.flags['dryRun']) {
8568
- logger.logger.log(DRY_RUN_BAILING_NOW$m);
8562
+ logger.logger.log(DRY_RUN_BAILING_NOW$n);
8569
8563
  return;
8570
8564
  }
8571
8565
  await handleLicensePolicy(orgSlug, outputKind);
@@ -8612,11 +8606,11 @@ async function handleSecurityPolicy(orgSlug, outputKind) {
8612
8606
  }
8613
8607
 
8614
8608
  const {
8615
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$l
8609
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$m
8616
8610
  } = constants;
8617
8611
 
8618
8612
  // TODO: secret toplevel alias `socket security policy`?
8619
- const config$n = {
8613
+ const config$o = {
8620
8614
  commandName: 'security',
8621
8615
  description: 'Retrieve the security policy of an organization',
8622
8616
  hidden: true,
@@ -8642,7 +8636,7 @@ const config$n = {
8642
8636
  - Permissions: security-policy:read
8643
8637
 
8644
8638
  Options
8645
- ${utils.getFlagListOutput(config$n.flags, 6)}
8639
+ ${utils.getFlagListOutput(config$o.flags, 6)}
8646
8640
 
8647
8641
  Your API token will need the \`security-policy:read\` permission otherwise
8648
8642
  the request will fail with an authentication error.
@@ -8653,16 +8647,16 @@ const config$n = {
8653
8647
  `
8654
8648
  };
8655
8649
  const cmdOrganizationPolicyPolicy = {
8656
- description: config$n.description,
8657
- hidden: config$n.hidden,
8658
- run: run$n
8650
+ description: config$o.description,
8651
+ hidden: config$o.hidden,
8652
+ run: run$o
8659
8653
  };
8660
- async function run$n(argv, importMeta, {
8654
+ async function run$o(argv, importMeta, {
8661
8655
  parentName
8662
8656
  }) {
8663
8657
  const cli = utils.meowOrExit({
8664
8658
  argv,
8665
- config: config$n,
8659
+ config: config$o,
8666
8660
  importMeta,
8667
8661
  parentName
8668
8662
  });
@@ -8699,7 +8693,7 @@ async function run$n(argv, importMeta, {
8699
8693
  return;
8700
8694
  }
8701
8695
  if (cli.flags['dryRun']) {
8702
- logger.logger.log(DRY_RUN_BAILING_NOW$l);
8696
+ logger.logger.log(DRY_RUN_BAILING_NOW$m);
8703
8697
  return;
8704
8698
  }
8705
8699
  await handleSecurityPolicy(orgSlug, outputKind);
@@ -8768,9 +8762,9 @@ async function handleQuota(outputKind = 'text') {
8768
8762
  }
8769
8763
 
8770
8764
  const {
8771
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$k
8765
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$l
8772
8766
  } = constants;
8773
- const config$m = {
8767
+ const config$n = {
8774
8768
  commandName: 'quota',
8775
8769
  description: 'List organizations associated with the API key used',
8776
8770
  hidden: true,
@@ -8783,20 +8777,20 @@ const config$m = {
8783
8777
  $ ${command}
8784
8778
 
8785
8779
  Options
8786
- ${utils.getFlagListOutput(config$m.flags, 6)}
8780
+ ${utils.getFlagListOutput(config$n.flags, 6)}
8787
8781
  `
8788
8782
  };
8789
8783
  const cmdOrganizationQuota = {
8790
- description: config$m.description,
8791
- hidden: config$m.hidden,
8792
- run: run$m
8784
+ description: config$n.description,
8785
+ hidden: config$n.hidden,
8786
+ run: run$n
8793
8787
  };
8794
- async function run$m(argv, importMeta, {
8788
+ async function run$n(argv, importMeta, {
8795
8789
  parentName
8796
8790
  }) {
8797
8791
  const cli = utils.meowOrExit({
8798
8792
  argv,
8799
- config: config$m,
8793
+ config: config$n,
8800
8794
  importMeta,
8801
8795
  parentName
8802
8796
  });
@@ -8821,7 +8815,7 @@ async function run$m(argv, importMeta, {
8821
8815
  return;
8822
8816
  }
8823
8817
  if (cli.flags['dryRun']) {
8824
- logger.logger.log(DRY_RUN_BAILING_NOW$k);
8818
+ logger.logger.log(DRY_RUN_BAILING_NOW$l);
8825
8819
  return;
8826
8820
  }
8827
8821
  await handleQuota(outputKind);
@@ -9069,9 +9063,9 @@ function parsePackageSpecifiers(ecosystem, pkgs) {
9069
9063
  }
9070
9064
 
9071
9065
  const {
9072
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$j
9066
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$k
9073
9067
  } = constants;
9074
- const config$l = {
9068
+ const config$m = {
9075
9069
  commandName: 'score',
9076
9070
  description: '[beta] Look up score for one package which reflects all of its transitive dependencies as well',
9077
9071
  hidden: false,
@@ -9113,16 +9107,16 @@ const config$l = {
9113
9107
  `
9114
9108
  };
9115
9109
  const cmdPackageScore = {
9116
- description: config$l.description,
9117
- hidden: config$l.hidden,
9118
- run: run$l
9110
+ description: config$m.description,
9111
+ hidden: config$m.hidden,
9112
+ run: run$m
9119
9113
  };
9120
- async function run$l(argv, importMeta, {
9114
+ async function run$m(argv, importMeta, {
9121
9115
  parentName
9122
9116
  }) {
9123
9117
  const cli = utils.meowOrExit({
9124
9118
  argv,
9125
- config: config$l,
9119
+ config: config$m,
9126
9120
  importMeta,
9127
9121
  parentName
9128
9122
  });
@@ -9164,7 +9158,7 @@ async function run$l(argv, importMeta, {
9164
9158
  return;
9165
9159
  }
9166
9160
  if (cli.flags['dryRun']) {
9167
- logger.logger.log(DRY_RUN_BAILING_NOW$j);
9161
+ logger.logger.log(DRY_RUN_BAILING_NOW$k);
9168
9162
  return;
9169
9163
  }
9170
9164
  await handlePurlDeepScore(purls[0] || '', outputKind);
@@ -9301,9 +9295,9 @@ async function handlePurlsShallowScore({
9301
9295
  }
9302
9296
 
9303
9297
  const {
9304
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$i
9298
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$j
9305
9299
  } = constants;
9306
- const config$k = {
9300
+ const config$l = {
9307
9301
  commandName: 'shallow',
9308
9302
  description: '[beta] Look up info regarding one or more packages but not their transitives',
9309
9303
  hidden: false,
@@ -9345,23 +9339,23 @@ const config$k = {
9345
9339
  `
9346
9340
  };
9347
9341
  const cmdPackageShallow = {
9348
- description: config$k.description,
9349
- hidden: config$k.hidden,
9342
+ description: config$l.description,
9343
+ hidden: config$l.hidden,
9350
9344
  alias: {
9351
9345
  shallowScore: {
9352
- description: config$k.description,
9346
+ description: config$l.description,
9353
9347
  hidden: true,
9354
9348
  argv: []
9355
9349
  }
9356
9350
  },
9357
- run: run$k
9351
+ run: run$l
9358
9352
  };
9359
- async function run$k(argv, importMeta, {
9353
+ async function run$l(argv, importMeta, {
9360
9354
  parentName
9361
9355
  }) {
9362
9356
  const cli = utils.meowOrExit({
9363
9357
  argv,
9364
- config: config$k,
9358
+ config: config$l,
9365
9359
  importMeta,
9366
9360
  parentName
9367
9361
  });
@@ -9396,7 +9390,7 @@ async function run$k(argv, importMeta, {
9396
9390
  return;
9397
9391
  }
9398
9392
  if (cli.flags['dryRun']) {
9399
- logger.logger.log(DRY_RUN_BAILING_NOW$i);
9393
+ logger.logger.log(DRY_RUN_BAILING_NOW$j);
9400
9394
  return;
9401
9395
  }
9402
9396
  await handlePurlsShallowScore({
@@ -9450,10 +9444,10 @@ async function runRawNpm(argv) {
9450
9444
  }
9451
9445
 
9452
9446
  const {
9453
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$h,
9447
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$i,
9454
9448
  NPM
9455
9449
  } = constants;
9456
- const config$j = {
9450
+ const config$k = {
9457
9451
  commandName: 'raw-npm',
9458
9452
  description: `Temporarily disable the Socket ${NPM} wrapper`,
9459
9453
  hidden: false,
@@ -9467,21 +9461,21 @@ const config$j = {
9467
9461
  `
9468
9462
  };
9469
9463
  const cmdRawNpm = {
9470
- description: config$j.description,
9471
- hidden: config$j.hidden,
9472
- run: run$j
9464
+ description: config$k.description,
9465
+ hidden: config$k.hidden,
9466
+ run: run$k
9473
9467
  };
9474
- async function run$j(argv, importMeta, {
9468
+ async function run$k(argv, importMeta, {
9475
9469
  parentName
9476
9470
  }) {
9477
9471
  const cli = utils.meowOrExit({
9478
9472
  argv,
9479
- config: config$j,
9473
+ config: config$k,
9480
9474
  importMeta,
9481
9475
  parentName
9482
9476
  });
9483
9477
  if (cli.flags['dryRun']) {
9484
- logger.logger.log(DRY_RUN_BAILING_NOW$h);
9478
+ logger.logger.log(DRY_RUN_BAILING_NOW$i);
9485
9479
  return;
9486
9480
  }
9487
9481
  await runRawNpm(argv);
@@ -9506,10 +9500,10 @@ async function runRawNpx(argv) {
9506
9500
  }
9507
9501
 
9508
9502
  const {
9509
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$g,
9503
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$h,
9510
9504
  NPX
9511
9505
  } = constants;
9512
- const config$i = {
9506
+ const config$j = {
9513
9507
  commandName: 'raw-npx',
9514
9508
  description: `Temporarily disable the Socket ${NPX} wrapper`,
9515
9509
  hidden: false,
@@ -9523,27 +9517,27 @@ const config$i = {
9523
9517
  `
9524
9518
  };
9525
9519
  const cmdRawNpx = {
9526
- description: config$i.description,
9527
- hidden: config$i.hidden,
9528
- run: run$i
9520
+ description: config$j.description,
9521
+ hidden: config$j.hidden,
9522
+ run: run$j
9529
9523
  };
9530
- async function run$i(argv, importMeta, {
9524
+ async function run$j(argv, importMeta, {
9531
9525
  parentName
9532
9526
  }) {
9533
9527
  const cli = utils.meowOrExit({
9534
9528
  argv,
9535
- config: config$i,
9529
+ config: config$j,
9536
9530
  importMeta,
9537
9531
  parentName
9538
9532
  });
9539
9533
  if (cli.flags['dryRun']) {
9540
- logger.logger.log(DRY_RUN_BAILING_NOW$g);
9534
+ logger.logger.log(DRY_RUN_BAILING_NOW$h);
9541
9535
  return;
9542
9536
  }
9543
9537
  await runRawNpx(argv);
9544
9538
  }
9545
9539
 
9546
- const config$h = {
9540
+ const config$i = {
9547
9541
  commandName: 'create',
9548
9542
  description: '[Deprecated] Create a project report',
9549
9543
  hidden: false,
@@ -9557,16 +9551,16 @@ const config$h = {
9557
9551
  `
9558
9552
  };
9559
9553
  const cmdReportCreate = {
9560
- description: config$h.description,
9561
- hidden: config$h.hidden,
9562
- run: run$h
9554
+ description: config$i.description,
9555
+ hidden: config$i.hidden,
9556
+ run: run$i
9563
9557
  };
9564
- async function run$h(argv, importMeta, {
9558
+ async function run$i(argv, importMeta, {
9565
9559
  parentName
9566
9560
  }) {
9567
9561
  utils.meowOrExit({
9568
9562
  argv,
9569
- config: config$h,
9563
+ config: config$i,
9570
9564
  importMeta,
9571
9565
  parentName
9572
9566
  });
@@ -9574,7 +9568,7 @@ async function run$h(argv, importMeta, {
9574
9568
  process.exitCode = 1;
9575
9569
  }
9576
9570
 
9577
- const config$g = {
9571
+ const config$h = {
9578
9572
  commandName: 'view',
9579
9573
  description: '[Deprecated] View a project report',
9580
9574
  hidden: false,
@@ -9588,16 +9582,16 @@ const config$g = {
9588
9582
  `
9589
9583
  };
9590
9584
  const cmdReportView = {
9591
- description: config$g.description,
9592
- hidden: config$g.hidden,
9593
- run: run$g
9585
+ description: config$h.description,
9586
+ hidden: config$h.hidden,
9587
+ run: run$h
9594
9588
  };
9595
- async function run$g(argv, importMeta, {
9589
+ async function run$h(argv, importMeta, {
9596
9590
  parentName
9597
9591
  }) {
9598
9592
  utils.meowOrExit({
9599
9593
  argv,
9600
- config: config$g,
9594
+ config: config$h,
9601
9595
  importMeta,
9602
9596
  parentName
9603
9597
  });
@@ -9685,9 +9679,9 @@ async function handleCreateRepo({
9685
9679
  }
9686
9680
 
9687
9681
  const {
9688
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$f
9682
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$g
9689
9683
  } = constants;
9690
- const config$f = {
9684
+ const config$g = {
9691
9685
  commandName: 'create',
9692
9686
  description: 'Create a repository in an organization',
9693
9687
  hidden: false,
@@ -9750,16 +9744,16 @@ const config$f = {
9750
9744
  `
9751
9745
  };
9752
9746
  const cmdReposCreate = {
9753
- description: config$f.description,
9754
- hidden: config$f.hidden,
9755
- run: run$f
9747
+ description: config$g.description,
9748
+ hidden: config$g.hidden,
9749
+ run: run$g
9756
9750
  };
9757
- async function run$f(argv, importMeta, {
9751
+ async function run$g(argv, importMeta, {
9758
9752
  parentName
9759
9753
  }) {
9760
9754
  const cli = utils.meowOrExit({
9761
9755
  argv,
9762
- config: config$f,
9756
+ config: config$g,
9763
9757
  importMeta,
9764
9758
  parentName
9765
9759
  });
@@ -9804,7 +9798,7 @@ async function run$f(argv, importMeta, {
9804
9798
  return;
9805
9799
  }
9806
9800
  if (dryRun) {
9807
- logger.logger.log(DRY_RUN_BAILING_NOW$f);
9801
+ logger.logger.log(DRY_RUN_BAILING_NOW$g);
9808
9802
  return;
9809
9803
  }
9810
9804
  await handleCreateRepo({
@@ -9847,9 +9841,9 @@ async function handleDeleteRepo(orgSlug, repoName, outputKind) {
9847
9841
  }
9848
9842
 
9849
9843
  const {
9850
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$e
9844
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$f
9851
9845
  } = constants;
9852
- const config$e = {
9846
+ const config$f = {
9853
9847
  commandName: 'del',
9854
9848
  description: 'Delete a repository in an organization',
9855
9849
  hidden: false,
@@ -9882,16 +9876,16 @@ const config$e = {
9882
9876
  `
9883
9877
  };
9884
9878
  const cmdReposDel = {
9885
- description: config$e.description,
9886
- hidden: config$e.hidden,
9887
- run: run$e
9879
+ description: config$f.description,
9880
+ hidden: config$f.hidden,
9881
+ run: run$f
9888
9882
  };
9889
- async function run$e(argv, importMeta, {
9883
+ async function run$f(argv, importMeta, {
9890
9884
  parentName
9891
9885
  }) {
9892
9886
  const cli = utils.meowOrExit({
9893
9887
  argv,
9894
- config: config$e,
9888
+ config: config$f,
9895
9889
  importMeta,
9896
9890
  parentName
9897
9891
  });
@@ -9928,7 +9922,7 @@ async function run$e(argv, importMeta, {
9928
9922
  return;
9929
9923
  }
9930
9924
  if (dryRun) {
9931
- logger.logger.log(DRY_RUN_BAILING_NOW$e);
9925
+ logger.logger.log(DRY_RUN_BAILING_NOW$f);
9932
9926
  return;
9933
9927
  }
9934
9928
  await handleDeleteRepo(orgSlug, repoName, outputKind);
@@ -10090,9 +10084,9 @@ async function handleListRepos({
10090
10084
  }
10091
10085
 
10092
10086
  const {
10093
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$d
10087
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$e
10094
10088
  } = constants;
10095
- const config$d = {
10089
+ const config$e = {
10096
10090
  commandName: 'list',
10097
10091
  description: 'List repositories in an organization',
10098
10092
  hidden: false,
@@ -10153,16 +10147,16 @@ const config$d = {
10153
10147
  `
10154
10148
  };
10155
10149
  const cmdReposList = {
10156
- description: config$d.description,
10157
- hidden: config$d.hidden,
10158
- run: run$d
10150
+ description: config$e.description,
10151
+ hidden: config$e.hidden,
10152
+ run: run$e
10159
10153
  };
10160
- async function run$d(argv, importMeta, {
10154
+ async function run$e(argv, importMeta, {
10161
10155
  parentName
10162
10156
  }) {
10163
10157
  const cli = utils.meowOrExit({
10164
10158
  argv,
10165
- config: config$d,
10159
+ config: config$e,
10166
10160
  importMeta,
10167
10161
  parentName
10168
10162
  });
@@ -10207,7 +10201,7 @@ async function run$d(argv, importMeta, {
10207
10201
  return;
10208
10202
  }
10209
10203
  if (cli.flags['dryRun']) {
10210
- logger.logger.log(DRY_RUN_BAILING_NOW$d);
10204
+ logger.logger.log(DRY_RUN_BAILING_NOW$e);
10211
10205
  return;
10212
10206
  }
10213
10207
  await handleListRepos({
@@ -10279,9 +10273,9 @@ async function handleUpdateRepo({
10279
10273
  }
10280
10274
 
10281
10275
  const {
10282
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$c
10276
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$d
10283
10277
  } = constants;
10284
- const config$c = {
10278
+ const config$d = {
10285
10279
  commandName: 'update',
10286
10280
  description: 'Update a repository in an organization',
10287
10281
  hidden: false,
@@ -10344,16 +10338,16 @@ const config$c = {
10344
10338
  `
10345
10339
  };
10346
10340
  const cmdReposUpdate = {
10347
- description: config$c.description,
10348
- hidden: config$c.hidden,
10349
- run: run$c
10341
+ description: config$d.description,
10342
+ hidden: config$d.hidden,
10343
+ run: run$d
10350
10344
  };
10351
- async function run$c(argv, importMeta, {
10345
+ async function run$d(argv, importMeta, {
10352
10346
  parentName
10353
10347
  }) {
10354
10348
  const cli = utils.meowOrExit({
10355
10349
  argv,
10356
- config: config$c,
10350
+ config: config$d,
10357
10351
  importMeta,
10358
10352
  parentName
10359
10353
  });
@@ -10398,7 +10392,7 @@ async function run$c(argv, importMeta, {
10398
10392
  return;
10399
10393
  }
10400
10394
  if (cli.flags['dryRun']) {
10401
- logger.logger.log(DRY_RUN_BAILING_NOW$c);
10395
+ logger.logger.log(DRY_RUN_BAILING_NOW$d);
10402
10396
  return;
10403
10397
  }
10404
10398
  await handleUpdateRepo({
@@ -10466,9 +10460,9 @@ async function handleViewRepo(orgSlug, repoName, outputKind) {
10466
10460
  }
10467
10461
 
10468
10462
  const {
10469
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$b
10463
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$c
10470
10464
  } = constants;
10471
- const config$b = {
10465
+ const config$c = {
10472
10466
  commandName: 'view',
10473
10467
  description: 'View repositories in an organization',
10474
10468
  hidden: false,
@@ -10506,16 +10500,16 @@ const config$b = {
10506
10500
  `
10507
10501
  };
10508
10502
  const cmdReposView = {
10509
- description: config$b.description,
10510
- hidden: config$b.hidden,
10511
- run: run$b
10503
+ description: config$c.description,
10504
+ hidden: config$c.hidden,
10505
+ run: run$c
10512
10506
  };
10513
- async function run$b(argv, importMeta, {
10507
+ async function run$c(argv, importMeta, {
10514
10508
  parentName
10515
10509
  }) {
10516
10510
  const cli = utils.meowOrExit({
10517
10511
  argv,
10518
- config: config$b,
10512
+ config: config$c,
10519
10513
  importMeta,
10520
10514
  parentName
10521
10515
  });
@@ -10565,7 +10559,7 @@ async function run$b(argv, importMeta, {
10565
10559
  return;
10566
10560
  }
10567
10561
  if (cli.flags['dryRun']) {
10568
- logger.logger.log(DRY_RUN_BAILING_NOW$b);
10562
+ logger.logger.log(DRY_RUN_BAILING_NOW$c);
10569
10563
  return;
10570
10564
  }
10571
10565
  await handleViewRepo(orgSlug, String(repoName), outputKind);
@@ -10613,9 +10607,9 @@ async function suggestTarget() {
10613
10607
  }
10614
10608
 
10615
10609
  const {
10616
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$a
10610
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$b
10617
10611
  } = constants;
10618
- const config$a = {
10612
+ const config$b = {
10619
10613
  commandName: 'create',
10620
10614
  description: 'Create a scan',
10621
10615
  hidden: false,
@@ -10624,13 +10618,11 @@ const config$a = {
10624
10618
  ...utils.outputFlags,
10625
10619
  autoManifest: {
10626
10620
  type: 'boolean',
10627
- default: false,
10628
10621
  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`.'
10629
10622
  },
10630
10623
  branch: {
10631
10624
  type: 'string',
10632
10625
  shortFlag: 'b',
10633
- default: 'socket-default-branch',
10634
10626
  description: 'Branch name'
10635
10627
  },
10636
10628
  commitMessage: {
@@ -10682,12 +10674,10 @@ const config$a = {
10682
10674
  repo: {
10683
10675
  type: 'string',
10684
10676
  shortFlag: 'r',
10685
- default: 'socket-default-repository',
10686
10677
  description: 'Repository name'
10687
10678
  },
10688
10679
  report: {
10689
10680
  type: 'boolean',
10690
- default: false,
10691
10681
  description: 'Wait for the scan creation to complete, then basically run `socket scan report` on it'
10692
10682
  },
10693
10683
  setAsAlertsPage: {
@@ -10706,25 +10696,29 @@ const config$a = {
10706
10696
  // TODO: your project's "socket.yml" file's "projectIgnorePaths"
10707
10697
  help: (command, config) => `
10708
10698
  Usage
10709
- $ ${command} [...options]${utils.isTestingV1() ? '' : ' <org>'} <TARGET> [TARGET...]
10699
+ $ ${command} [options]${utils.isTestingV1() ? '' : ' <org>'} [TARGET...]
10710
10700
 
10711
10701
  API Token Requirements
10712
10702
  - Quota: 1 unit
10713
10703
  - Permissions: full-scans:create
10714
10704
 
10715
- Uploads the specified "package.json" and lock files for JavaScript, Python,
10716
- Go, Scala, Gradle, and Kotlin dependency manifests.
10717
- If any folder is specified, the ones found in there recursively are uploaded.
10718
-
10719
- Supports globbing such as "**/package.json", "**/requirements.txt", etc.
10705
+ Options
10706
+ ${utils.getFlagListOutput(config.flags, 6)}
10720
10707
 
10721
- Ignores any file specified in your project's ".gitignore" and also has a
10722
- sensible set of default ignores from the "ignore-by-default" module.
10708
+ Uploads the specified dependency manifest files for Go, Gradle, JavaScript,
10709
+ Kotlin, Python, and Scala. Files like "package.json" and "requirements.txt".
10710
+ If any folder is specified, the ones found in there recursively are uploaded.
10723
10711
 
10724
- TARGET should be a FILE or DIR that _must_ be inside the CWD.
10712
+ Details on TARGET:
10725
10713
 
10726
- When a FILE is given only that FILE is targeted. Otherwise any eligible
10727
- files in the given DIR will be considered.
10714
+ - Defaults to the current dir (cwd) if none given
10715
+ - Multiple targets can be specified
10716
+ - If a target is a file, only that file is checked
10717
+ - If it is a dir, the dir is scanned for any supported manifest files
10718
+ - Dirs MUST be within the current dir (cwd), you can use --cwd to change it
10719
+ - Supports globbing such as "**/package.json", "**/requirements.txt", etc.
10720
+ - Ignores any file specified in your project's ".gitignore"
10721
+ - Also a sensible set of default ignores from the "ignore-by-default" module
10728
10722
 
10729
10723
  The --repo and --branch flags tell Socket to associate this Scan with that
10730
10724
  repo/branch. The names will show up on your dashboard on the Socket website.
@@ -10739,31 +10733,28 @@ const config$a = {
10739
10733
  this by using --no-setAsAlertsPage. This flag is ignored for any branch that
10740
10734
  is not designated as the "default branch". It is disabled when using --tmp.
10741
10735
 
10742
- Options
10743
- ${utils.getFlagListOutput(config.flags, 6)}
10736
+ You can use \`socket scan setup\` to configure certain repo flag defaults.
10744
10737
 
10745
10738
  Examples
10746
- $ ${command}${utils.isTestingV1() ? '' : ' FakeOrg'} .
10739
+ $ ${command}${utils.isTestingV1() ? '' : ' FakeOrg'}
10747
10740
  $ ${command} --repo=test-repo --branch=main${utils.isTestingV1() ? '' : ' FakeOrg'} ./package.json
10748
10741
  `
10749
10742
  };
10750
10743
  const cmdScanCreate = {
10751
- description: config$a.description,
10752
- hidden: config$a.hidden,
10753
- run: run$a
10744
+ description: config$b.description,
10745
+ hidden: config$b.hidden,
10746
+ run: run$b
10754
10747
  };
10755
- async function run$a(argv, importMeta, {
10748
+ async function run$b(argv, importMeta, {
10756
10749
  parentName
10757
10750
  }) {
10758
10751
  const cli = utils.meowOrExit({
10759
10752
  argv,
10760
- config: config$a,
10753
+ config: config$b,
10761
10754
  importMeta,
10762
10755
  parentName
10763
10756
  });
10764
10757
  const {
10765
- autoManifest = false,
10766
- branch: branchName = 'socket-default-branch',
10767
10758
  commitHash,
10768
10759
  commitMessage,
10769
10760
  committers,
@@ -10776,11 +10767,15 @@ async function run$a(argv, importMeta, {
10776
10767
  org: orgFlag,
10777
10768
  pullRequest,
10778
10769
  readOnly,
10779
- repo: repoName = 'socket-default-repository',
10780
- report,
10781
10770
  setAsAlertsPage: pendingHeadFlag,
10782
10771
  tmp
10783
10772
  } = cli.flags;
10773
+ let {
10774
+ autoManifest,
10775
+ branch: branchName,
10776
+ repo: repoName,
10777
+ report
10778
+ } = cli.flags;
10784
10779
  const outputKind = utils.getOutputKind(json, markdown);
10785
10780
  const pendingHead = tmp ? false : pendingHeadFlag;
10786
10781
  let [orgSlug, defaultOrgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), cli.input[0] || '', interactive, dryRun);
@@ -10788,8 +10783,45 @@ async function run$a(argv, importMeta, {
10788
10783
  // Tmp. just for TS. will drop this later.
10789
10784
  defaultOrgSlug = '';
10790
10785
  }
10791
- let targets = cli.input.slice(utils.isTestingV1() || defaultOrgSlug ? 0 : 1);
10792
- const cwd = cwdOverride && cwdOverride !== 'process.cwd()' ? String(cwdOverride) : process.cwd();
10786
+
10787
+ // Accept zero or more paths. Default to cwd() if none given.
10788
+ let targets = cli.input.slice(utils.isTestingV1() || defaultOrgSlug ? 0 : 1) || process.cwd();
10789
+ const cwd = cwdOverride && cwdOverride !== 'process.cwd()' ? path.resolve(process.cwd(), String(cwdOverride)) : process.cwd();
10790
+ const socketJson = await utils.readOrDefaultSocketJson(cwd);
10791
+
10792
+ // Note: This needs meow booleanDefault=undefined
10793
+ if (typeof autoManifest !== 'boolean') {
10794
+ if (socketJson.defaults?.scan?.create?.autoManifest !== undefined) {
10795
+ autoManifest = socketJson.defaults.scan.create.autoManifest;
10796
+ logger.logger.info('Using default --autoManifest from socket.json:', autoManifest);
10797
+ } else {
10798
+ autoManifest = false;
10799
+ }
10800
+ }
10801
+ if (!branchName) {
10802
+ if (socketJson.defaults?.scan?.create?.branch) {
10803
+ branchName = socketJson.defaults.scan.create.branch;
10804
+ logger.logger.info('Using default --branch from socket.json:', branchName);
10805
+ } else {
10806
+ branchName = 'socket-default-branch';
10807
+ }
10808
+ }
10809
+ if (!repoName) {
10810
+ if (socketJson.defaults?.scan?.create?.repo) {
10811
+ repoName = socketJson.defaults.scan.create.repo;
10812
+ logger.logger.info('Using default --repo from socket.json:', repoName);
10813
+ } else {
10814
+ repoName = 'socket-default-repository';
10815
+ }
10816
+ }
10817
+ if (typeof report !== 'boolean') {
10818
+ if (socketJson.defaults?.scan?.create?.report !== undefined) {
10819
+ report = socketJson.defaults.scan.create.report;
10820
+ logger.logger.info('Using default --report from socket.json:', report);
10821
+ } else {
10822
+ report = false;
10823
+ }
10824
+ }
10793
10825
 
10794
10826
  // We're going to need an api token to suggest data because those suggestions
10795
10827
  // must come from data we already know. Don't error on missing api token yet.
@@ -10817,7 +10849,6 @@ async function run$a(argv, importMeta, {
10817
10849
  updatedInput = true;
10818
10850
  }
10819
10851
  }
10820
- const socketJson = await utils.readOrDefaultSocketJson(cwd);
10821
10852
  const detected = await detectManifestActions(socketJson, cwd);
10822
10853
  if (detected.count > 0 && !autoManifest) {
10823
10854
  logger.logger.info(`Detected ${detected.count} manifest targets we could try to generate. Please set the --autoManifest flag if you want to include languages covered by \`socket manifest auto\` in the Scan.`);
@@ -10870,7 +10901,7 @@ async function run$a(argv, importMeta, {
10870
10901
 
10871
10902
  // Note exiting earlier to skirt a hidden auth requirement
10872
10903
  if (dryRun) {
10873
- logger.logger.log(DRY_RUN_BAILING_NOW$a);
10904
+ logger.logger.log(DRY_RUN_BAILING_NOW$b);
10874
10905
  return;
10875
10906
  }
10876
10907
  await handleCreateNewScan({
@@ -10924,9 +10955,9 @@ async function handleDeleteScan(orgSlug, scanId, outputKind) {
10924
10955
  }
10925
10956
 
10926
10957
  const {
10927
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$9
10958
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$a
10928
10959
  } = constants;
10929
- const config$9 = {
10960
+ const config$a = {
10930
10961
  commandName: 'del',
10931
10962
  description: 'Delete a scan',
10932
10963
  hidden: false,
@@ -10959,16 +10990,16 @@ const config$9 = {
10959
10990
  `
10960
10991
  };
10961
10992
  const cmdScanDel = {
10962
- description: config$9.description,
10963
- hidden: config$9.hidden,
10964
- run: run$9
10993
+ description: config$a.description,
10994
+ hidden: config$a.hidden,
10995
+ run: run$a
10965
10996
  };
10966
- async function run$9(argv, importMeta, {
10997
+ async function run$a(argv, importMeta, {
10967
10998
  parentName
10968
10999
  }) {
10969
11000
  const cli = utils.meowOrExit({
10970
11001
  argv,
10971
- config: config$9,
11002
+ config: config$a,
10972
11003
  importMeta,
10973
11004
  parentName
10974
11005
  });
@@ -11005,7 +11036,7 @@ async function run$9(argv, importMeta, {
11005
11036
  return;
11006
11037
  }
11007
11038
  if (cli.flags['dryRun']) {
11008
- logger.logger.log(DRY_RUN_BAILING_NOW$9);
11039
+ logger.logger.log(DRY_RUN_BAILING_NOW$a);
11009
11040
  return;
11010
11041
  }
11011
11042
  await handleDeleteScan(orgSlug, scanId, outputKind);
@@ -11199,14 +11230,14 @@ async function handleDiffScan({
11199
11230
  }
11200
11231
 
11201
11232
  const {
11202
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$8,
11233
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$9,
11203
11234
  SOCKET_WEBSITE_URL: SOCKET_WEBSITE_URL$1
11204
11235
  } = constants;
11205
11236
  const SOCKET_SBOM_URL_PREFIX = `${SOCKET_WEBSITE_URL$1}/dashboard/org/SocketDev/sbom/`;
11206
11237
  const {
11207
11238
  length: SOCKET_SBOM_URL_PREFIX_LENGTH
11208
11239
  } = SOCKET_SBOM_URL_PREFIX;
11209
- const config$8 = {
11240
+ const config$9 = {
11210
11241
  commandName: 'diff',
11211
11242
  description: 'See what changed between two Scans',
11212
11243
  hidden: false,
@@ -11258,16 +11289,16 @@ const config$8 = {
11258
11289
  `
11259
11290
  };
11260
11291
  const cmdScanDiff = {
11261
- description: config$8.description,
11262
- hidden: config$8.hidden,
11263
- run: run$8
11292
+ description: config$9.description,
11293
+ hidden: config$9.hidden,
11294
+ run: run$9
11264
11295
  };
11265
- async function run$8(argv, importMeta, {
11296
+ async function run$9(argv, importMeta, {
11266
11297
  parentName
11267
11298
  }) {
11268
11299
  const cli = utils.meowOrExit({
11269
11300
  argv,
11270
- config: config$8,
11301
+ config: config$9,
11271
11302
  importMeta,
11272
11303
  parentName
11273
11304
  });
@@ -11319,7 +11350,7 @@ async function run$8(argv, importMeta, {
11319
11350
  return;
11320
11351
  }
11321
11352
  if (cli.flags['dryRun']) {
11322
- logger.logger.log(DRY_RUN_BAILING_NOW$8);
11353
+ logger.logger.log(DRY_RUN_BAILING_NOW$9);
11323
11354
  return;
11324
11355
  }
11325
11356
  await handleDiffScan({
@@ -11951,9 +11982,9 @@ async function handleCreateGithubScan({
11951
11982
  }
11952
11983
 
11953
11984
  const {
11954
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$7
11985
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$8
11955
11986
  } = constants;
11956
- const config$7 = {
11987
+ const config$8 = {
11957
11988
  commandName: 'github',
11958
11989
  description: 'Create a scan for given GitHub repo',
11959
11990
  hidden: true,
@@ -11971,7 +12002,6 @@ const config$7 = {
11971
12002
  },
11972
12003
  githubApiUrl: {
11973
12004
  type: 'string',
11974
- default: 'https://api.github.com',
11975
12005
  description: 'Base URL of the GitHub API (default: https://api.github.com)'
11976
12006
  },
11977
12007
  interactive: {
@@ -11994,7 +12024,7 @@ const config$7 = {
11994
12024
  },
11995
12025
  help: (command, config) => `
11996
12026
  Usage
11997
- $ ${command}
12027
+ $ ${command} [options] [CWD=.]
11998
12028
 
11999
12029
  API Token Requirements
12000
12030
  - Quota: 1 unit
@@ -12010,49 +12040,85 @@ const config$7 = {
12010
12040
  requires local access to the repo while this command runs entirely through the
12011
12041
  GitHub for file access.
12012
12042
 
12043
+ You can use \`socket scan setup\` to configure certain repo flag defaults.
12044
+
12013
12045
  Options
12014
12046
  ${utils.getFlagListOutput(config.flags, 6)}
12015
12047
 
12016
12048
  Examples
12017
12049
  $ ${command}
12050
+ $ ${command} ./proj
12018
12051
  `
12019
12052
  };
12020
12053
  const cmdScanGithub = {
12021
- description: config$7.description,
12022
- hidden: config$7.hidden,
12023
- run: run$7
12054
+ description: config$8.description,
12055
+ hidden: config$8.hidden,
12056
+ run: run$8
12024
12057
  };
12025
- async function run$7(argv, importMeta, {
12058
+ async function run$8(argv, importMeta, {
12026
12059
  parentName
12027
12060
  }) {
12028
12061
  const cli = utils.meowOrExit({
12029
12062
  argv,
12030
- config: config$7,
12063
+ config: config$8,
12031
12064
  importMeta,
12032
12065
  parentName
12033
12066
  });
12034
12067
  const {
12035
- all = false,
12036
12068
  dryRun = false,
12037
- githubApiUrl = 'https://api.github.com',
12038
12069
  // Lazily access constants.ENV.SOCKET_CLI_GITHUB_TOKEN.
12039
12070
  githubToken = constants.ENV.SOCKET_CLI_GITHUB_TOKEN,
12040
12071
  interactive = true,
12041
12072
  json,
12042
12073
  markdown,
12043
- org: orgFlag,
12044
- orgGithub: orgGithubFlag,
12074
+ org: orgFlag
12075
+ } = cli.flags;
12076
+ let {
12077
+ all,
12078
+ githubApiUrl,
12079
+ orgGithub,
12045
12080
  repos
12046
12081
  } = cli.flags;
12047
12082
  const outputKind = utils.getOutputKind(json, markdown);
12083
+ let [cwd = '.'] = cli.input;
12084
+ // Note: path.resolve vs .join:
12085
+ // If given path is absolute then cwd should not affect it.
12086
+ cwd = path.resolve(process.cwd(), cwd);
12048
12087
  let [orgSlug, defaultOrgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), cli.input[0] || '', interactive, dryRun);
12049
12088
  if (!defaultOrgSlug) {
12050
12089
  // Tmp. just for TS. will drop this later.
12051
12090
  defaultOrgSlug = '';
12052
12091
  }
12053
-
12054
- // Default to Socket org slug. Often that's fine. Vanity and all that.
12055
- const orgGithub = orgGithubFlag || orgSlug;
12092
+ const socketJson = await utils.readOrDefaultSocketJson(cwd);
12093
+ if (all === undefined) {
12094
+ if (socketJson.defaults?.scan?.github?.all !== undefined) {
12095
+ all = socketJson.defaults?.scan?.github?.all;
12096
+ } else {
12097
+ all = false;
12098
+ }
12099
+ }
12100
+ if (!githubApiUrl) {
12101
+ if (socketJson.defaults?.scan?.github?.githubApiUrl !== undefined) {
12102
+ githubApiUrl = socketJson.defaults.scan.github.githubApiUrl;
12103
+ } else {
12104
+ githubApiUrl = 'https://api.github.com';
12105
+ }
12106
+ }
12107
+ if (!orgGithub) {
12108
+ if (socketJson.defaults?.scan?.github?.orgGithub !== undefined) {
12109
+ orgGithub = socketJson.defaults.scan.github.orgGithub;
12110
+ } else {
12111
+ // Default to Socket org slug. Often that's fine. Vanity and all that.
12112
+ orgGithub = orgSlug;
12113
+ }
12114
+ }
12115
+ if (!all && !repos) {
12116
+ if (socketJson.defaults?.scan?.github?.repos !== undefined) {
12117
+ repos = socketJson.defaults.scan.github.repos;
12118
+ } else {
12119
+ repos = '';
12120
+ }
12121
+ }
12056
12122
 
12057
12123
  // We're going to need an api token to suggest data because those suggestions
12058
12124
  // must come from data we already know. Don't error on missing api token yet.
@@ -12102,7 +12168,7 @@ async function run$7(argv, importMeta, {
12102
12168
 
12103
12169
  // Note exiting earlier to skirt a hidden auth requirement
12104
12170
  if (dryRun) {
12105
- logger.logger.log(DRY_RUN_BAILING_NOW$7);
12171
+ logger.logger.log(DRY_RUN_BAILING_NOW$8);
12106
12172
  return;
12107
12173
  }
12108
12174
  await handleCreateGithubScan({
@@ -12113,7 +12179,7 @@ async function run$7(argv, importMeta, {
12113
12179
  orgSlug,
12114
12180
  orgGithub,
12115
12181
  outputKind,
12116
- repos: String(repos || '')
12182
+ repos
12117
12183
  });
12118
12184
  }
12119
12185
 
@@ -12219,9 +12285,9 @@ async function handleListScans({
12219
12285
  }
12220
12286
 
12221
12287
  const {
12222
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$6
12288
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$7
12223
12289
  } = constants;
12224
- const config$6 = {
12290
+ const config$7 = {
12225
12291
  commandName: 'list',
12226
12292
  description: 'List the scans for an organization',
12227
12293
  hidden: false,
@@ -12298,16 +12364,16 @@ const config$6 = {
12298
12364
  `
12299
12365
  };
12300
12366
  const cmdScanList = {
12301
- description: config$6.description,
12302
- hidden: config$6.hidden,
12303
- run: run$6
12367
+ description: config$7.description,
12368
+ hidden: config$7.hidden,
12369
+ run: run$7
12304
12370
  };
12305
- async function run$6(argv, importMeta, {
12371
+ async function run$7(argv, importMeta, {
12306
12372
  parentName
12307
12373
  }) {
12308
12374
  const cli = utils.meowOrExit({
12309
12375
  argv,
12310
- config: config$6,
12376
+ config: config$7,
12311
12377
  importMeta,
12312
12378
  parentName
12313
12379
  });
@@ -12346,7 +12412,7 @@ async function run$6(argv, importMeta, {
12346
12412
  return;
12347
12413
  }
12348
12414
  if (cli.flags['dryRun']) {
12349
- logger.logger.log(DRY_RUN_BAILING_NOW$6);
12415
+ logger.logger.log(DRY_RUN_BAILING_NOW$7);
12350
12416
  return;
12351
12417
  }
12352
12418
  await handleListScans({
@@ -12406,9 +12472,9 @@ async function handleOrgScanMetadata(orgSlug, scanId, outputKind) {
12406
12472
  }
12407
12473
 
12408
12474
  const {
12409
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$5
12475
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$6
12410
12476
  } = constants;
12411
- const config$5 = {
12477
+ const config$6 = {
12412
12478
  commandName: 'metadata',
12413
12479
  description: "Get a scan's metadata",
12414
12480
  hidden: false,
@@ -12441,16 +12507,16 @@ const config$5 = {
12441
12507
  `
12442
12508
  };
12443
12509
  const cmdScanMetadata = {
12444
- description: config$5.description,
12445
- hidden: config$5.hidden,
12446
- run: run$5
12510
+ description: config$6.description,
12511
+ hidden: config$6.hidden,
12512
+ run: run$6
12447
12513
  };
12448
- async function run$5(argv, importMeta, {
12514
+ async function run$6(argv, importMeta, {
12449
12515
  parentName
12450
12516
  }) {
12451
12517
  const cli = utils.meowOrExit({
12452
12518
  argv,
12453
- config: config$5,
12519
+ config: config$6,
12454
12520
  importMeta,
12455
12521
  parentName
12456
12522
  });
@@ -12493,16 +12559,16 @@ async function run$5(argv, importMeta, {
12493
12559
  return;
12494
12560
  }
12495
12561
  if (cli.flags['dryRun']) {
12496
- logger.logger.log(DRY_RUN_BAILING_NOW$5);
12562
+ logger.logger.log(DRY_RUN_BAILING_NOW$6);
12497
12563
  return;
12498
12564
  }
12499
12565
  await handleOrgScanMetadata(orgSlug, scanId, outputKind);
12500
12566
  }
12501
12567
 
12502
12568
  const {
12503
- DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$4
12569
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$5
12504
12570
  } = constants;
12505
- const config$4 = {
12571
+ const config$5 = {
12506
12572
  commandName: 'report',
12507
12573
  description: 'Check whether a scan result passes the organizational policies (security, license)',
12508
12574
  hidden: false,
@@ -12565,16 +12631,16 @@ const config$4 = {
12565
12631
  `
12566
12632
  };
12567
12633
  const cmdScanReport = {
12568
- description: config$4.description,
12569
- hidden: config$4.hidden,
12570
- run: run$4
12634
+ description: config$5.description,
12635
+ hidden: config$5.hidden,
12636
+ run: run$5
12571
12637
  };
12572
- async function run$4(argv, importMeta, {
12638
+ async function run$5(argv, importMeta, {
12573
12639
  parentName
12574
12640
  }) {
12575
12641
  const cli = utils.meowOrExit({
12576
12642
  argv,
12577
- config: config$4,
12643
+ config: config$5,
12578
12644
  importMeta,
12579
12645
  parentName
12580
12646
  });
@@ -12623,7 +12689,7 @@ async function run$4(argv, importMeta, {
12623
12689
  return;
12624
12690
  }
12625
12691
  if (cli.flags['dryRun']) {
12626
- logger.logger.log(DRY_RUN_BAILING_NOW$4);
12692
+ logger.logger.log(DRY_RUN_BAILING_NOW$5);
12627
12693
  return;
12628
12694
  }
12629
12695
  await handleScanReport({
@@ -12638,6 +12704,366 @@ async function run$4(argv, importMeta, {
12638
12704
  });
12639
12705
  }
12640
12706
 
12707
+ async function outputScanConfigResult(result) {
12708
+ if (!result.ok) {
12709
+ process.exitCode = result.code ?? 1;
12710
+ }
12711
+ if (!result.ok) {
12712
+ logger.logger.fail(utils.failMsgWithBadge(result.message, result.cause));
12713
+ return;
12714
+ }
12715
+ logger.logger.log('');
12716
+ logger.logger.log('Finished');
12717
+ logger.logger.log('');
12718
+ }
12719
+
12720
+ async function setupScanConfig(cwd, defaultOnReadError = false) {
12721
+ const jsonPath = path.join(cwd, `socket.json`);
12722
+ if (fs$1.existsSync(jsonPath)) {
12723
+ logger.logger.info(`Found socket.json at ${jsonPath}`);
12724
+ } else {
12725
+ logger.logger.info(`No socket.json found at ${cwd}, will generate a new one`);
12726
+ }
12727
+ logger.logger.log('');
12728
+ logger.logger.log('Note: This tool will set up flag and argument defaults for certain');
12729
+ logger.logger.log(' CLI commands. You can still override them by explicitly');
12730
+ logger.logger.log(' setting the flag. It is meant to be a convenience tool.');
12731
+ logger.logger.log('');
12732
+ logger.logger.log('This command will generate a `socket.json` file in the target cwd.');
12733
+ logger.logger.log('You can choose to add this file to your repo (handy for collab)');
12734
+ logger.logger.log('or to add it to the ignored files, or neither. This file is only');
12735
+ logger.logger.log('used in CLI workflows.');
12736
+ logger.logger.log('');
12737
+ logger.logger.log('Note: For details on a flag you can run `socket <cmd> --help`');
12738
+ logger.logger.log('');
12739
+ const socketJsonResult = await utils.readSocketJson(cwd, defaultOnReadError);
12740
+ if (!socketJsonResult.ok) {
12741
+ return socketJsonResult;
12742
+ }
12743
+ const socketJson = socketJsonResult.data;
12744
+ if (!socketJson.defaults) {
12745
+ socketJson.defaults = {};
12746
+ }
12747
+ if (!socketJson.defaults.scan) {
12748
+ socketJson.defaults.scan = {};
12749
+ }
12750
+ const targetCommand = await prompts.select({
12751
+ message: 'Which scan command do you want to configure?',
12752
+ choices: [{
12753
+ name: 'socket scan create',
12754
+ value: 'create'
12755
+ }, {
12756
+ name: 'socket scan github',
12757
+ value: 'github'
12758
+ }, {
12759
+ name: '(cancel)',
12760
+ value: '',
12761
+ description: 'Exit configurator, make no changes'
12762
+ }]
12763
+ });
12764
+ switch (targetCommand) {
12765
+ case 'create':
12766
+ {
12767
+ if (!socketJson.defaults.scan.create) {
12768
+ socketJson.defaults.scan.create = {};
12769
+ }
12770
+ const result = await configureScan(socketJson.defaults.scan.create);
12771
+ if (!result.ok || result.data.canceled) {
12772
+ return result;
12773
+ }
12774
+ break;
12775
+ }
12776
+ case 'github':
12777
+ {
12778
+ if (!socketJson.defaults.scan.github) {
12779
+ socketJson.defaults.scan.github = {};
12780
+ }
12781
+ const result = await configureGithub(socketJson.defaults.scan.github);
12782
+ if (!result.ok || result.data.canceled) {
12783
+ return result;
12784
+ }
12785
+ break;
12786
+ }
12787
+ default:
12788
+ {
12789
+ return canceledByUser();
12790
+ }
12791
+ }
12792
+ logger.logger.log('');
12793
+ logger.logger.log('Setup complete. Writing socket.json');
12794
+ logger.logger.log('');
12795
+ if (await prompts.select({
12796
+ message: `Do you want to write the new config to ${jsonPath} ?`,
12797
+ choices: [{
12798
+ name: 'yes',
12799
+ value: true,
12800
+ description: 'Update config'
12801
+ }, {
12802
+ name: 'no',
12803
+ value: false,
12804
+ description: 'Do not update the config'
12805
+ }]
12806
+ })) {
12807
+ return await utils.writeSocketJson(cwd, socketJson);
12808
+ }
12809
+ return canceledByUser();
12810
+ }
12811
+ async function configureScan(config) {
12812
+ const defaultRepoName = await prompts.input({
12813
+ message: '(--repo) What repo name (slug) should be reported to Socket for this dir?',
12814
+ default: config.repo || 'socket-default-repository',
12815
+ required: false
12816
+ // validate: async string => bool
12817
+ });
12818
+ if (defaultRepoName === undefined) {
12819
+ return canceledByUser();
12820
+ }
12821
+ if (defaultRepoName.trim()) {
12822
+ // Even if it's 'socket-default-repository' store it because if we change
12823
+ // this default then an existing user probably would not expect the change?
12824
+ config.repo = defaultRepoName.trim();
12825
+ } else {
12826
+ delete config.repo;
12827
+ }
12828
+ const defaultBranchName = await prompts.input({
12829
+ message: '(--branch) What branch name (slug) should be reported to Socket for this dir?',
12830
+ default: config.branch || 'socket-default-branch',
12831
+ required: false
12832
+ // validate: async string => bool
12833
+ });
12834
+ if (defaultBranchName === undefined) {
12835
+ return canceledByUser();
12836
+ }
12837
+ if (defaultBranchName.trim()) {
12838
+ // Even if it's 'socket-default-branch' store it because if we change
12839
+ // this default then an existing user probably would not expect the change?
12840
+ config.branch = defaultBranchName.trim();
12841
+ } else {
12842
+ delete config.branch;
12843
+ }
12844
+ const autoManifest = await prompts.select({
12845
+ message: '(--autoManifest) Do you want to run `socket manifest auto` before creating a scan? You would need this for sbt, gradle, etc.',
12846
+ choices: [{
12847
+ name: 'no',
12848
+ value: 'no',
12849
+ description: 'Do not generate local manifest files'
12850
+ }, {
12851
+ name: 'yes',
12852
+ value: 'yes',
12853
+ description: 'Locally generate manifest files for languages like gradle, sbt, and conda (see `socket manifest auto`), before creating a scan'
12854
+ }, {
12855
+ name: '(leave default)',
12856
+ value: '',
12857
+ description: 'Do not store a setting for this'
12858
+ }],
12859
+ default: config.autoManifest === true ? 'yes' : config.autoManifest === false ? 'no' : ''
12860
+ });
12861
+ if (autoManifest === undefined) {
12862
+ return canceledByUser();
12863
+ }
12864
+ if (autoManifest === 'yes') {
12865
+ config.autoManifest = true;
12866
+ } else if (autoManifest === 'no') {
12867
+ config.autoManifest = false;
12868
+ } else {
12869
+ delete config.autoManifest;
12870
+ }
12871
+ const alwaysReport = await prompts.select({
12872
+ message: '(--report) Do you want to enable --report by default?',
12873
+ choices: [{
12874
+ name: 'no',
12875
+ value: 'no',
12876
+ description: 'Do not wait for Scan result and report by default'
12877
+ }, {
12878
+ name: 'yes',
12879
+ value: 'yes',
12880
+ description: 'After submitting a Scan request, wait for scan to complete, then show a report (like --report would)'
12881
+ }, {
12882
+ name: '(leave default)',
12883
+ value: '',
12884
+ description: 'Do not store a setting for this'
12885
+ }],
12886
+ default: config.report === true ? 'yes' : config.report === false ? 'no' : ''
12887
+ });
12888
+ if (alwaysReport === undefined) {
12889
+ return canceledByUser();
12890
+ }
12891
+ if (alwaysReport === 'yes') {
12892
+ config.report = true;
12893
+ } else if (alwaysReport === 'no') {
12894
+ config.report = false;
12895
+ } else {
12896
+ delete config.report;
12897
+ }
12898
+ return notCanceled();
12899
+ }
12900
+ async function configureGithub(config) {
12901
+ // Do not store the github API token. Just leads to a security rabbit hole.
12902
+
12903
+ const all = await prompts.select({
12904
+ message: '(--all) Do you by default want to fetch all repos from the GitHub API and scan all known repos?',
12905
+ choices: [{
12906
+ name: 'no',
12907
+ value: 'no',
12908
+ description: 'Fetch repos if not given and ask which repo to run on'
12909
+ }, {
12910
+ name: 'yes',
12911
+ value: 'yes',
12912
+ description: 'Run on all remote repos by default'
12913
+ }, {
12914
+ name: '(leave default)',
12915
+ value: '',
12916
+ description: 'Do not store a setting for this'
12917
+ }],
12918
+ default: config.all === true ? 'yes' : config.all === false ? 'no' : ''
12919
+ });
12920
+ if (all === undefined) {
12921
+ return canceledByUser();
12922
+ }
12923
+ if (all === 'yes') {
12924
+ config.all = true;
12925
+ } else if (all === 'no') {
12926
+ config.all = false;
12927
+ } else {
12928
+ delete config.all;
12929
+ }
12930
+ if (!all) {
12931
+ const defaultRepos = await prompts.input({
12932
+ message: '(--repos) Please enter the default repos to run this on, leave empty (backspace) to fetch from GitHub and ask interactive',
12933
+ default: config.repos,
12934
+ required: false
12935
+ // validate: async string => bool
12936
+ });
12937
+ if (defaultRepos === undefined) {
12938
+ return canceledByUser();
12939
+ }
12940
+ if (defaultRepos.trim()) {
12941
+ config.repos = defaultRepos.trim();
12942
+ } else {
12943
+ delete config.repos;
12944
+ }
12945
+ }
12946
+ const defaultGithubApiUrl = await prompts.input({
12947
+ message: '(--githubApiUrl) Do you want to override the default github url?',
12948
+ default: config.githubApiUrl || 'https://api.github.com',
12949
+ required: false
12950
+ // validate: async string => bool
12951
+ });
12952
+ if (defaultGithubApiUrl === undefined) {
12953
+ return canceledByUser();
12954
+ }
12955
+ if (defaultGithubApiUrl.trim() && defaultGithubApiUrl.trim() !== 'https://api.github.com') {
12956
+ config.githubApiUrl = defaultGithubApiUrl.trim();
12957
+ } else {
12958
+ delete config.githubApiUrl;
12959
+ }
12960
+ const defaultOrgGithub = await prompts.input({
12961
+ message: '(--orgGithub) Do you want to change the org slug that is used when talking to the GitHub API? Defaults to your Socket org slug.',
12962
+ default: config.orgGithub || '',
12963
+ required: false
12964
+ // validate: async string => bool
12965
+ });
12966
+ if (defaultOrgGithub === undefined) {
12967
+ return canceledByUser();
12968
+ }
12969
+ if (defaultOrgGithub.trim()) {
12970
+ config.orgGithub = defaultOrgGithub.trim();
12971
+ } else {
12972
+ delete config.orgGithub;
12973
+ }
12974
+ return notCanceled();
12975
+ }
12976
+ function canceledByUser() {
12977
+ logger.logger.log('');
12978
+ logger.logger.info('User canceled');
12979
+ logger.logger.log('');
12980
+ return {
12981
+ ok: true,
12982
+ data: {
12983
+ canceled: true
12984
+ }
12985
+ };
12986
+ }
12987
+ function notCanceled() {
12988
+ return {
12989
+ ok: true,
12990
+ data: {
12991
+ canceled: false
12992
+ }
12993
+ };
12994
+ }
12995
+
12996
+ async function handleScanConfig(cwd, defaultOnReadError = false) {
12997
+ const result = await setupScanConfig(cwd, defaultOnReadError);
12998
+ await outputScanConfigResult(result);
12999
+ }
13000
+
13001
+ const {
13002
+ DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$4
13003
+ } = constants;
13004
+ const config$4 = {
13005
+ commandName: 'setup',
13006
+ description: 'Start interactive configurator to customize default flag values for `socket scan` in this dir',
13007
+ hidden: false,
13008
+ flags: {
13009
+ ...utils.commonFlags,
13010
+ defaultOnReadError: {
13011
+ type: 'boolean',
13012
+ description: 'If reading the socket.json fails, just use a default config? Warning: This might override the existing json file!'
13013
+ }
13014
+ },
13015
+ help: (command, config) => `
13016
+ Usage
13017
+ $ ${command} [options] [CWD=.]
13018
+
13019
+ Options
13020
+ ${utils.getFlagListOutput(config.flags, 6)}
13021
+
13022
+ Interactive configurator to create a local json file in the target directory
13023
+ that helps to set flag defaults for \`socket scan create\`.
13024
+
13025
+ This helps to configure the (Socket reported) repo and branch names, as well
13026
+ as which branch name is the "default branch" (main, master, etc). This way
13027
+ you don't have to specify these flags when creating a scan in this dir.
13028
+
13029
+ This generated configuration file will only be used locally by the CLI. You
13030
+ can commit it to the repo (useful for collaboration) or choose to add it to
13031
+ your .gitignore all the same. Only this CLI will use it.
13032
+
13033
+ Examples
13034
+
13035
+ $ ${command}
13036
+ $ ${command} ./proj
13037
+ `
13038
+ };
13039
+ const cmdScanSetup = {
13040
+ description: config$4.description,
13041
+ hidden: config$4.hidden,
13042
+ run: run$4
13043
+ };
13044
+ async function run$4(argv, importMeta, {
13045
+ parentName
13046
+ }) {
13047
+ const cli = utils.meowOrExit({
13048
+ argv,
13049
+ config: config$4,
13050
+ importMeta,
13051
+ parentName
13052
+ });
13053
+ const {
13054
+ defaultOnReadError = false
13055
+ } = cli.flags;
13056
+ let [cwd = '.'] = cli.input;
13057
+ // Note: path.resolve vs .join:
13058
+ // If given path is absolute then cwd should not affect it.
13059
+ cwd = path.resolve(process.cwd(), cwd);
13060
+ if (cli.flags['dryRun']) {
13061
+ logger.logger.log(DRY_RUN_BAILING_NOW$4);
13062
+ return;
13063
+ }
13064
+ await handleScanConfig(cwd, Boolean(defaultOnReadError));
13065
+ }
13066
+
12641
13067
  async function fetchScan(orgSlug, scanId) {
12642
13068
  const result = await utils.queryApiSafeText(`orgs/${orgSlug}/full-scans/${encodeURIComponent(scanId)}`, 'a scan');
12643
13069
  if (!result.ok) {
@@ -12887,6 +13313,7 @@ const cmdScan = {
12887
13313
  list: cmdScanList,
12888
13314
  metadata: cmdScanMetadata,
12889
13315
  report: cmdScanReport,
13316
+ setup: cmdScanSetup,
12890
13317
  view: cmdScanView
12891
13318
  }, {
12892
13319
  aliases: {
@@ -13680,5 +14107,5 @@ void (async () => {
13680
14107
  await utils.captureException(e);
13681
14108
  }
13682
14109
  })();
13683
- //# debugId=8ad31346-4e7a-47ed-a7fc-67c4e43a1ce
14110
+ //# debugId=4f976c56-27ce-40fe-8c8c-32c83517d5bd
13684
14111
  //# sourceMappingURL=cli.js.map