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