@socketsecurity/cli-with-sentry 0.15.51 → 0.15.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -315,7 +315,7 @@ const config$T = {
315
315
  file: {
316
316
  type: 'string',
317
317
  shortFlag: 'f',
318
- description: 'Filepath to save output. Only valid with --json/--markdown. Defaults to stdout.'
318
+ description: 'Filepath to save output when given. Only valid with --json/--markdown.'
319
319
  },
320
320
  repo: {
321
321
  type: 'string',
@@ -3222,7 +3222,7 @@ const description$9 = 'Commands related to the local CLI configuration';
3222
3222
  const cmdConfig = {
3223
3223
  description: description$9,
3224
3224
  hidden: true,
3225
- // [beta]
3225
+ // [beta]; isTestingV1
3226
3226
  async run(argv, importMeta, {
3227
3227
  parentName
3228
3228
  }) {
@@ -4771,11 +4771,6 @@ async function pnpmFix(pkgEnvDetails, {
4771
4771
  isCi && repoInfo ? await getOpenSocketPrs(repoInfo.owner, repoInfo.repo, {
4772
4772
  author: gitUser
4773
4773
  }) : [];
4774
- if (openPrs.length) {
4775
- debug.debugFn(`found: ${openPrs.length} open PRs\n`, openPrs);
4776
- } else {
4777
- debug.debugFn('miss: 0 open PRs found');
4778
- }
4779
4774
  let count = 0;
4780
4775
  let actualTree;
4781
4776
  const lockfilePath = path.join(rootPath, 'pnpm-lock.yaml');
@@ -4825,9 +4820,9 @@ async function pnpmFix(pkgEnvDetails, {
4825
4820
  let alertsMap;
4826
4821
  try {
4827
4822
  alertsMap = purls.length ? await utils.getAlertsMapFromPurls(purls, getAlertsMapOptions({
4828
- limit: limit + openPrs.length
4823
+ limit: Math.max(limit, openPrs.length)
4829
4824
  })) : await utils.getAlertsMapFromPnpmLockfile(lockfile, getAlertsMapOptions({
4830
- limit: limit + openPrs.length
4825
+ limit: Math.max(limit, openPrs.length)
4831
4826
  }));
4832
4827
  } catch (e) {
4833
4828
  spinner?.stop();
@@ -4839,7 +4834,7 @@ async function pnpmFix(pkgEnvDetails, {
4839
4834
  };
4840
4835
  }
4841
4836
  const infoByPartialPurl = utils.getCveInfoFromAlertsMap(alertsMap, {
4842
- limit: limit + openPrs.length
4837
+ limit: Math.max(limit, openPrs.length)
4843
4838
  });
4844
4839
  if (!infoByPartialPurl) {
4845
4840
  spinner?.stop();
@@ -4921,6 +4916,7 @@ async function pnpmFix(pkgEnvDetails, {
4921
4916
  const pkgPath = path.dirname(pkgJsonPath);
4922
4917
  const isWorkspaceRoot = pkgJsonPath === pkgEnvDetails.editablePkgJson.filename;
4923
4918
  const workspace = isWorkspaceRoot ? 'root' : path.relative(rootPath, pkgPath);
4919
+ const branchWorkspace = isCi ? getSocketBranchWorkspaceComponent(workspace) : '';
4924
4920
 
4925
4921
  // actualTree may not be defined on the first iteration of pkgJsonPathsLoop.
4926
4922
  if (!actualTree) {
@@ -4990,9 +4986,13 @@ async function pnpmFix(pkgEnvDetails, {
4990
4986
  continue infosLoop;
4991
4987
  }
4992
4988
  const newVersion = shadowInject.findBestPatchVersion(node, availableVersions, vulnerableVersionRange);
4993
- if (activeBranches.find(b => b.newVersion === newVersion)) {
4989
+ if (activeBranches.find(b => b.workspace === branchWorkspace && b.newVersion === newVersion)) {
4994
4990
  debug.debugFn(`skip: open PR found for ${name}@${newVersion}`);
4995
- count += 1;
4991
+ if (++count >= limit) {
4992
+ logger.logger.dedent();
4993
+ spinner?.dedent();
4994
+ break infoEntriesLoop;
4995
+ }
4996
4996
  continue infosLoop;
4997
4997
  }
4998
4998
  const newVersionPackument = newVersion ? packument.versions[newVersion] : undefined;
@@ -5869,7 +5869,7 @@ const config$F = {
5869
5869
  commandName: 'completion',
5870
5870
  description: 'Install bash completion for Socket CLI',
5871
5871
  hidden: true,
5872
- // beta
5872
+ // beta; isTestingV1
5873
5873
  flags: {
5874
5874
  ...utils.commonFlags
5875
5875
  },
@@ -5928,7 +5928,7 @@ const description$7 = 'Setup the Socket CLI command in your environment';
5928
5928
  const cmdInstall = {
5929
5929
  description: description$7,
5930
5930
  hidden: true,
5931
- // beta
5931
+ // beta; isTestingV1
5932
5932
  async run(argv, importMeta, {
5933
5933
  parentName
5934
5934
  }) {
@@ -8352,16 +8352,16 @@ async function run$s(argv, importMeta, {
8352
8352
  });
8353
8353
  }
8354
8354
 
8355
- async function fetchOrganization() {
8355
+ async function fetchLicensePolicy(orgSlug) {
8356
8356
  const sockSdkResult = await utils.setupSdk();
8357
8357
  if (!sockSdkResult.ok) {
8358
8358
  return sockSdkResult;
8359
8359
  }
8360
8360
  const sockSdk = sockSdkResult.data;
8361
- return await utils.handleApiCall(sockSdk.getOrganizations(), 'organization list');
8361
+ return await utils.handleApiCall(sockSdk.getOrgLicensePolicy(orgSlug), 'organization license policy');
8362
8362
  }
8363
8363
 
8364
- async function outputOrganizationList(result, outputKind = 'text') {
8364
+ async function outputLicensePolicy(result, outputKind) {
8365
8365
  if (!result.ok) {
8366
8366
  process.exitCode = result.code ?? 1;
8367
8367
  }
@@ -8373,73 +8373,66 @@ async function outputOrganizationList(result, outputKind = 'text') {
8373
8373
  logger.logger.fail(utils.failMsgWithBadge(result.message, result.cause));
8374
8374
  return;
8375
8375
  }
8376
- const organizations = Object.values(result.data.organizations);
8377
- const visibleTokenPrefix = utils.getVisibleTokenPrefix();
8378
- switch (outputKind) {
8379
- case 'markdown':
8380
- {
8381
- // | Syntax | Description |
8382
- // | ----------- | ----------- |
8383
- // | Header | Title |
8384
- // | Paragraph | Text |
8385
- let mw1 = 4;
8386
- let mw2 = 2;
8387
- let mw3 = 4;
8388
- for (const o of organizations) {
8389
- mw1 = Math.max(mw1, o.name?.length ?? 0);
8390
- mw2 = Math.max(mw2, o.id.length);
8391
- mw3 = Math.max(mw3, o.plan.length);
8392
- }
8393
- logger.logger.log('# Organizations\n');
8394
- logger.logger.log(`List of organizations associated with your API key, starting with: ${vendor.yoctocolorsCjsExports.italic(visibleTokenPrefix)}\n`);
8395
- logger.logger.log(`| Name${' '.repeat(mw1 - 4)} | ID${' '.repeat(mw2 - 2)} | Plan${' '.repeat(mw3 - 4)} |`);
8396
- logger.logger.log(`| ${'-'.repeat(mw1)} | ${'-'.repeat(mw2)} | ${'-'.repeat(mw3)} |`);
8397
- for (const o of organizations) {
8398
- logger.logger.log(`| ${(o.name || '').padEnd(mw1, ' ')} | ${(o.id || '').padEnd(mw2, ' ')} | ${(o.plan || '').padEnd(mw3, ' ')} |`);
8399
- }
8400
- logger.logger.log(`| ${'-'.repeat(mw1)} | ${'-'.repeat(mw2)} | ${'-'.repeat(mw3)} |`);
8401
- return;
8402
- }
8403
- default:
8404
- {
8405
- logger.logger.log(`List of organizations associated with your API key, starting with: ${vendor.yoctocolorsCjsExports.italic(visibleTokenPrefix)}\n`);
8406
- // Just dump
8407
- for (const o of organizations) {
8408
- logger.logger.log(`- Name: ${vendor.yoctocolorsCjsExports.bold(o.name ?? 'undefined')}, ID: ${vendor.yoctocolorsCjsExports.bold(o.id)}, Plan: ${vendor.yoctocolorsCjsExports.bold(o.plan)}`);
8409
- }
8410
- }
8411
- }
8376
+ logger.logger.info('Use --json to get the full result');
8377
+ logger.logger.log('# License policy');
8378
+ logger.logger.log('');
8379
+ logger.logger.log('This is the license policy for your organization:');
8380
+ logger.logger.log('');
8381
+ const rules = result.data['license_policy'];
8382
+ const entries = rules ? Object.entries(rules) : [];
8383
+ const mapped = entries.map(([key, value]) => [key, value?.['allowed'] ? ' yes' : ' no']);
8384
+ mapped.sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
8385
+ logger.logger.log(utils.mdTableOfPairs(mapped, ['License Name', 'Allowed']));
8386
+ logger.logger.log('');
8412
8387
  }
8413
8388
 
8414
- async function handleOrganizationList(outputKind = 'text') {
8415
- const data = await fetchOrganization();
8416
- await outputOrganizationList(data, outputKind);
8389
+ async function handleLicensePolicy(orgSlug, outputKind) {
8390
+ const data = await fetchLicensePolicy(orgSlug);
8391
+ await outputLicensePolicy(data, outputKind);
8417
8392
  }
8418
8393
 
8419
8394
  const {
8420
8395
  DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$p
8421
8396
  } = constants;
8397
+
8398
+ // TODO: secret toplevel alias `socket license policy`?
8422
8399
  const config$r = {
8423
- commandName: 'list',
8424
- description: 'List organizations associated with the API key used',
8425
- hidden: false,
8400
+ commandName: 'license',
8401
+ description: 'Retrieve the license policy of an organization',
8402
+ hidden: true,
8426
8403
  flags: {
8427
8404
  ...utils.commonFlags,
8428
- ...utils.outputFlags
8405
+ ...utils.outputFlags,
8406
+ interactive: {
8407
+ type: 'boolean',
8408
+ default: true,
8409
+ description: 'Allow for interactive elements, asking for input. Use --no-interactive to prevent any input questions, defaulting them to cancel/no.'
8410
+ },
8411
+ org: {
8412
+ type: 'string',
8413
+ description: 'Force override the organization slug, overrides the default org from config'
8414
+ }
8429
8415
  },
8430
8416
  help: (command, _config) => `
8431
8417
  Usage
8432
- $ ${command}
8418
+ $ ${command}${utils.isTestingV1() ? '' : ' <org slug>'}
8433
8419
 
8434
8420
  API Token Requirements
8435
8421
  - Quota: 1 unit
8436
- - Permissions: none (does need a token)
8422
+ - Permissions: license-policy:read
8437
8423
 
8438
8424
  Options
8439
8425
  ${utils.getFlagListOutput(config$r.flags, 6)}
8426
+
8427
+ Your API token will need the \`license-policy:read\` permission otherwise
8428
+ the request will fail with an authentication error.
8429
+
8430
+ Examples
8431
+ $ ${command}${utils.isTestingV1() ? '' : ' mycorp'}
8432
+ $ ${command}${utils.isTestingV1() ? '' : ' mycorp'} --json
8440
8433
  `
8441
8434
  };
8442
- const cmdOrganizationList = {
8435
+ const cmdOrganizationPolicyLicense = {
8443
8436
  description: config$r.description,
8444
8437
  hidden: config$r.hidden,
8445
8438
  run: run$r
@@ -8454,17 +8447,27 @@ async function run$r(argv, importMeta, {
8454
8447
  parentName
8455
8448
  });
8456
8449
  const {
8450
+ dryRun,
8451
+ interactive,
8457
8452
  json,
8458
- markdown
8453
+ markdown,
8454
+ org: orgFlag
8459
8455
  } = cli.flags;
8460
8456
  const outputKind = utils.getOutputKind(json, markdown);
8457
+ const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), cli.input[0] || '', !!interactive, !!dryRun);
8461
8458
  const hasApiToken = utils.hasDefaultToken();
8462
8459
  const wasValidInput = utils.checkCommandInput(outputKind, {
8460
+ nook: true,
8461
+ test: !!orgSlug,
8462
+ message: utils.isTestingV1() ? 'Org name by default setting, --org, or auto-discovered' : 'Org name must be the first argument',
8463
+ pass: 'ok',
8464
+ fail: 'missing'
8465
+ }, {
8463
8466
  nook: true,
8464
8467
  test: !json || !markdown,
8465
- message: 'The `--json` and `--markdown` flags can not be used at the same time',
8468
+ message: 'The json and markdown flags cannot be both set, pick one',
8466
8469
  pass: 'ok',
8467
- fail: 'bad'
8470
+ fail: 'omit one'
8468
8471
  }, {
8469
8472
  nook: true,
8470
8473
  test: hasApiToken,
@@ -8479,19 +8482,19 @@ async function run$r(argv, importMeta, {
8479
8482
  logger.logger.log(DRY_RUN_BAILING_NOW$p);
8480
8483
  return;
8481
8484
  }
8482
- await handleOrganizationList(outputKind);
8485
+ await handleLicensePolicy(orgSlug, outputKind);
8483
8486
  }
8484
8487
 
8485
- async function fetchLicensePolicy(orgSlug) {
8488
+ async function fetchSecurityPolicy(orgSlug) {
8486
8489
  const sockSdkResult = await utils.setupSdk();
8487
8490
  if (!sockSdkResult.ok) {
8488
8491
  return sockSdkResult;
8489
8492
  }
8490
8493
  const sockSdk = sockSdkResult.data;
8491
- return await utils.handleApiCall(sockSdk.getOrgLicensePolicy(orgSlug), 'organization license policy');
8494
+ return await utils.handleApiCall(sockSdk.getOrgSecurityPolicy(orgSlug), 'organization security policy');
8492
8495
  }
8493
8496
 
8494
- async function outputLicensePolicy(result, outputKind) {
8497
+ async function outputSecurityPolicy(result, outputKind) {
8495
8498
  if (!result.ok) {
8496
8499
  process.exitCode = result.code ?? 1;
8497
8500
  }
@@ -8503,32 +8506,33 @@ async function outputLicensePolicy(result, outputKind) {
8503
8506
  logger.logger.fail(utils.failMsgWithBadge(result.message, result.cause));
8504
8507
  return;
8505
8508
  }
8506
- logger.logger.info('Use --json to get the full result');
8507
- logger.logger.log('# License policy');
8509
+ logger.logger.log('# Security policy');
8508
8510
  logger.logger.log('');
8509
- logger.logger.log('This is the license policy for your organization:');
8511
+ logger.logger.log(`The default security policy setting is: "${result.data.securityPolicyDefault}"`);
8510
8512
  logger.logger.log('');
8511
- const rules = result.data['license_policy'];
8513
+ logger.logger.log('These are the security policies per setting for your organization:');
8514
+ logger.logger.log('');
8515
+ const rules = result.data.securityPolicyRules;
8512
8516
  const entries = rules ? Object.entries(rules) : [];
8513
- const mapped = entries.map(([key, value]) => [key, value?.['allowed'] ? ' yes' : ' no']);
8517
+ const mapped = entries.map(([key, value]) => [key, value.action]);
8514
8518
  mapped.sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
8515
- logger.logger.log(utils.mdTableOfPairs(mapped, ['License Name', 'Allowed']));
8519
+ logger.logger.log(utils.mdTableOfPairs(mapped, ['name', 'action']));
8516
8520
  logger.logger.log('');
8517
8521
  }
8518
8522
 
8519
- async function handleLicensePolicy(orgSlug, outputKind) {
8520
- const data = await fetchLicensePolicy(orgSlug);
8521
- await outputLicensePolicy(data, outputKind);
8523
+ async function handleSecurityPolicy(orgSlug, outputKind) {
8524
+ const data = await fetchSecurityPolicy(orgSlug);
8525
+ await outputSecurityPolicy(data, outputKind);
8522
8526
  }
8523
8527
 
8524
8528
  const {
8525
8529
  DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$o
8526
8530
  } = constants;
8527
8531
 
8528
- // TODO: secret toplevel alias `socket license policy`?
8532
+ // TODO: secret toplevel alias `socket security policy`?
8529
8533
  const config$q = {
8530
- commandName: 'license',
8531
- description: 'Retrieve the license policy of an organization',
8534
+ commandName: 'security',
8535
+ description: 'Retrieve the security policy of an organization',
8532
8536
  hidden: true,
8533
8537
  flags: {
8534
8538
  ...utils.commonFlags,
@@ -8549,12 +8553,12 @@ const config$q = {
8549
8553
 
8550
8554
  API Token Requirements
8551
8555
  - Quota: 1 unit
8552
- - Permissions: license-policy:read
8556
+ - Permissions: security-policy:read
8553
8557
 
8554
8558
  Options
8555
8559
  ${utils.getFlagListOutput(config$q.flags, 6)}
8556
8560
 
8557
- Your API token will need the \`license-policy:read\` permission otherwise
8561
+ Your API token will need the \`security-policy:read\` permission otherwise
8558
8562
  the request will fail with an authentication error.
8559
8563
 
8560
8564
  Examples
@@ -8562,7 +8566,7 @@ const config$q = {
8562
8566
  $ ${command}${utils.isTestingV1() ? '' : ' mycorp'} --json
8563
8567
  `
8564
8568
  };
8565
- const cmdOrganizationPolicyLicense = {
8569
+ const cmdOrganizationPolicyPolicy = {
8566
8570
  description: config$q.description,
8567
8571
  hidden: config$q.hidden,
8568
8572
  run: run$q
@@ -8589,7 +8593,7 @@ async function run$q(argv, importMeta, {
8589
8593
  const wasValidInput = utils.checkCommandInput(outputKind, {
8590
8594
  nook: true,
8591
8595
  test: !!orgSlug,
8592
- message: utils.isTestingV1() ? 'Org name by default setting, --org, or auto-discovered' : 'Org name must be the first argument',
8596
+ message: 'Org name as the first argument',
8593
8597
  pass: 'ok',
8594
8598
  fail: 'missing'
8595
8599
  }, {
@@ -8612,19 +8616,19 @@ async function run$q(argv, importMeta, {
8612
8616
  logger.logger.log(DRY_RUN_BAILING_NOW$o);
8613
8617
  return;
8614
8618
  }
8615
- await handleLicensePolicy(orgSlug, outputKind);
8619
+ await handleSecurityPolicy(orgSlug, outputKind);
8616
8620
  }
8617
8621
 
8618
- async function fetchSecurityPolicy(orgSlug) {
8622
+ async function fetchOrganization() {
8619
8623
  const sockSdkResult = await utils.setupSdk();
8620
8624
  if (!sockSdkResult.ok) {
8621
8625
  return sockSdkResult;
8622
8626
  }
8623
8627
  const sockSdk = sockSdkResult.data;
8624
- return await utils.handleApiCall(sockSdk.getOrgSecurityPolicy(orgSlug), 'organization security policy');
8628
+ return await utils.handleApiCall(sockSdk.getOrganizations(), 'organization list');
8625
8629
  }
8626
8630
 
8627
- async function outputSecurityPolicy(result, outputKind) {
8631
+ async function outputOrganizationList(result, outputKind = 'text') {
8628
8632
  if (!result.ok) {
8629
8633
  process.exitCode = result.code ?? 1;
8630
8634
  }
@@ -8636,67 +8640,73 @@ async function outputSecurityPolicy(result, outputKind) {
8636
8640
  logger.logger.fail(utils.failMsgWithBadge(result.message, result.cause));
8637
8641
  return;
8638
8642
  }
8639
- logger.logger.log('# Security policy');
8640
- logger.logger.log('');
8641
- logger.logger.log(`The default security policy setting is: "${result.data.securityPolicyDefault}"`);
8642
- logger.logger.log('');
8643
- logger.logger.log('These are the security policies per setting for your organization:');
8644
- logger.logger.log('');
8645
- const rules = result.data.securityPolicyRules;
8646
- const entries = rules ? Object.entries(rules) : [];
8647
- const mapped = entries.map(([key, value]) => [key, value.action]);
8648
- mapped.sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
8649
- logger.logger.log(utils.mdTableOfPairs(mapped, ['name', 'action']));
8650
- logger.logger.log('');
8643
+ const organizations = Object.values(result.data.organizations);
8644
+ const visibleTokenPrefix = utils.getVisibleTokenPrefix();
8645
+ switch (outputKind) {
8646
+ case 'markdown':
8647
+ {
8648
+ // | Syntax | Description |
8649
+ // | ----------- | ----------- |
8650
+ // | Header | Title |
8651
+ // | Paragraph | Text |
8652
+ let mw1 = 4;
8653
+ let mw2 = 2;
8654
+ let mw3 = 4;
8655
+ for (const o of organizations) {
8656
+ mw1 = Math.max(mw1, o.name?.length ?? 0);
8657
+ mw2 = Math.max(mw2, o.id.length);
8658
+ mw3 = Math.max(mw3, o.plan.length);
8659
+ }
8660
+ logger.logger.log('# Organizations\n');
8661
+ logger.logger.log(`List of organizations associated with your API key, starting with: ${vendor.yoctocolorsCjsExports.italic(visibleTokenPrefix)}\n`);
8662
+ logger.logger.log(`| Name${' '.repeat(mw1 - 4)} | ID${' '.repeat(mw2 - 2)} | Plan${' '.repeat(mw3 - 4)} |`);
8663
+ logger.logger.log(`| ${'-'.repeat(mw1)} | ${'-'.repeat(mw2)} | ${'-'.repeat(mw3)} |`);
8664
+ for (const o of organizations) {
8665
+ logger.logger.log(`| ${(o.name || '').padEnd(mw1, ' ')} | ${(o.id || '').padEnd(mw2, ' ')} | ${(o.plan || '').padEnd(mw3, ' ')} |`);
8666
+ }
8667
+ logger.logger.log(`| ${'-'.repeat(mw1)} | ${'-'.repeat(mw2)} | ${'-'.repeat(mw3)} |`);
8668
+ return;
8669
+ }
8670
+ default:
8671
+ {
8672
+ logger.logger.log(`List of organizations associated with your API key, starting with: ${vendor.yoctocolorsCjsExports.italic(visibleTokenPrefix)}\n`);
8673
+ // Just dump
8674
+ for (const o of organizations) {
8675
+ logger.logger.log(`- Name: ${vendor.yoctocolorsCjsExports.bold(o.name ?? 'undefined')}, ID: ${vendor.yoctocolorsCjsExports.bold(o.id)}, Plan: ${vendor.yoctocolorsCjsExports.bold(o.plan)}`);
8676
+ }
8677
+ }
8678
+ }
8651
8679
  }
8652
8680
 
8653
- async function handleSecurityPolicy(orgSlug, outputKind) {
8654
- const data = await fetchSecurityPolicy(orgSlug);
8655
- await outputSecurityPolicy(data, outputKind);
8681
+ async function handleOrganizationList(outputKind = 'text') {
8682
+ const data = await fetchOrganization();
8683
+ await outputOrganizationList(data, outputKind);
8656
8684
  }
8657
8685
 
8658
8686
  const {
8659
8687
  DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$n
8660
8688
  } = constants;
8661
-
8662
- // TODO: secret toplevel alias `socket security policy`?
8663
8689
  const config$p = {
8664
- commandName: 'security',
8665
- description: 'Retrieve the security policy of an organization',
8666
- hidden: true,
8690
+ commandName: 'list',
8691
+ description: 'List organizations associated with the API key used',
8692
+ hidden: false,
8667
8693
  flags: {
8668
8694
  ...utils.commonFlags,
8669
- ...utils.outputFlags,
8670
- interactive: {
8671
- type: 'boolean',
8672
- default: true,
8673
- description: 'Allow for interactive elements, asking for input. Use --no-interactive to prevent any input questions, defaulting them to cancel/no.'
8674
- },
8675
- org: {
8676
- type: 'string',
8677
- description: 'Force override the organization slug, overrides the default org from config'
8678
- }
8695
+ ...utils.outputFlags
8679
8696
  },
8680
8697
  help: (command, _config) => `
8681
8698
  Usage
8682
- $ ${command}${utils.isTestingV1() ? '' : ' <org slug>'}
8699
+ $ ${command}
8683
8700
 
8684
8701
  API Token Requirements
8685
8702
  - Quota: 1 unit
8686
- - Permissions: security-policy:read
8703
+ - Permissions: none (does need a token)
8687
8704
 
8688
8705
  Options
8689
8706
  ${utils.getFlagListOutput(config$p.flags, 6)}
8690
-
8691
- Your API token will need the \`security-policy:read\` permission otherwise
8692
- the request will fail with an authentication error.
8693
-
8694
- Examples
8695
- $ ${command}${utils.isTestingV1() ? '' : ' mycorp'}
8696
- $ ${command}${utils.isTestingV1() ? '' : ' mycorp'} --json
8697
8707
  `
8698
8708
  };
8699
- const cmdOrganizationPolicyPolicy = {
8709
+ const cmdOrganizationList = {
8700
8710
  description: config$p.description,
8701
8711
  hidden: config$p.hidden,
8702
8712
  run: run$p
@@ -8711,27 +8721,17 @@ async function run$p(argv, importMeta, {
8711
8721
  parentName
8712
8722
  });
8713
8723
  const {
8714
- dryRun,
8715
- interactive,
8716
8724
  json,
8717
- markdown,
8718
- org: orgFlag
8725
+ markdown
8719
8726
  } = cli.flags;
8720
8727
  const outputKind = utils.getOutputKind(json, markdown);
8721
- const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), cli.input[0] || '', !!interactive, !!dryRun);
8722
8728
  const hasApiToken = utils.hasDefaultToken();
8723
8729
  const wasValidInput = utils.checkCommandInput(outputKind, {
8724
- nook: true,
8725
- test: !!orgSlug,
8726
- message: 'Org name as the first argument',
8727
- pass: 'ok',
8728
- fail: 'missing'
8729
- }, {
8730
8730
  nook: true,
8731
8731
  test: !json || !markdown,
8732
- message: 'The json and markdown flags cannot be both set, pick one',
8732
+ message: 'The `--json` and `--markdown` flags can not be used at the same time',
8733
8733
  pass: 'ok',
8734
- fail: 'omit one'
8734
+ fail: 'bad'
8735
8735
  }, {
8736
8736
  nook: true,
8737
8737
  test: hasApiToken,
@@ -8746,7 +8746,7 @@ async function run$p(argv, importMeta, {
8746
8746
  logger.logger.log(DRY_RUN_BAILING_NOW$n);
8747
8747
  return;
8748
8748
  }
8749
- await handleSecurityPolicy(orgSlug, outputKind);
8749
+ await handleOrganizationList(outputKind);
8750
8750
  }
8751
8751
 
8752
8752
  const description$6 = 'Organization policy details';
@@ -8874,11 +8874,7 @@ async function run$o(argv, importMeta, {
8874
8874
  const description$5 = 'Account details';
8875
8875
  const cmdOrganization = {
8876
8876
  description: description$5,
8877
- // Hidden because it was broken all this time (nobody could be using it)
8878
- // and we're not sure if it's useful to anyone in its current state.
8879
- // Until we do, we'll hide this to keep the help tidier.
8880
- // And later, we may simply move this under `scan`, anyways.
8881
- hidden: true,
8877
+ hidden: false,
8882
8878
  async run(argv, importMeta, {
8883
8879
  parentName
8884
8880
  }) {
@@ -8887,6 +8883,18 @@ const cmdOrganization = {
8887
8883
  quota: cmdOrganizationQuota,
8888
8884
  policy: cmdOrganizationPolicy
8889
8885
  }, {
8886
+ aliases: {
8887
+ license: {
8888
+ description: cmdOrganizationPolicyLicense.description,
8889
+ hidden: true,
8890
+ argv: ['policy', 'license']
8891
+ },
8892
+ security: {
8893
+ description: cmdOrganizationPolicyPolicy.description,
8894
+ hidden: true,
8895
+ argv: ['policy', 'security']
8896
+ }
8897
+ },
8890
8898
  argv,
8891
8899
  description: description$5,
8892
8900
  defaultSub: 'list',
@@ -9117,7 +9125,7 @@ const {
9117
9125
  } = constants;
9118
9126
  const config$n = {
9119
9127
  commandName: 'score',
9120
- description: '[beta] Look up score for one package which reflects all of its transitive dependencies as well',
9128
+ description: 'Look up score for one package which reflects all of its transitive dependencies as well',
9121
9129
  hidden: false,
9122
9130
  flags: {
9123
9131
  ...utils.commonFlags,
@@ -9349,7 +9357,7 @@ const {
9349
9357
  } = constants;
9350
9358
  const config$m = {
9351
9359
  commandName: 'shallow',
9352
- description: '[beta] Look up info regarding one or more packages but not their transitives',
9360
+ description: 'Look up info regarding one or more packages but not their transitives',
9353
9361
  hidden: false,
9354
9362
  flags: {
9355
9363
  ...utils.commonFlags,
@@ -13468,7 +13476,17 @@ const cmdScan = {
13468
13476
  view: cmdScanView
13469
13477
  }, {
13470
13478
  aliases: {
13471
- // Backwards compat. TODO: Drop next major bump
13479
+ meta: {
13480
+ description: cmdScanMetadata.description,
13481
+ hidden: true,
13482
+ argv: ['metadata']
13483
+ },
13484
+ reachability: {
13485
+ description: cmdScanReach.description,
13486
+ hidden: true,
13487
+ argv: ['reach']
13488
+ },
13489
+ // Backwards compat. TODO: Drop next major bump; isTestingV1
13472
13490
  stream: {
13473
13491
  description: cmdScanView.description,
13474
13492
  hidden: true,
@@ -13892,7 +13910,7 @@ const config$1 = {
13892
13910
  commandName: 'completion',
13893
13911
  description: 'Uninstall bash completion for Socket CLI',
13894
13912
  hidden: true,
13895
- // beta
13913
+ // beta; isTestingV1
13896
13914
  flags: {
13897
13915
  ...utils.commonFlags
13898
13916
  },
@@ -13943,7 +13961,7 @@ const description = 'Teardown the Socket command from your environment';
13943
13961
  const cmdUninstall = {
13944
13962
  description,
13945
13963
  hidden: true,
13946
- // beta
13964
+ // beta; isTestingV1
13947
13965
  async run(argv, importMeta, {
13948
13966
  parentName
13949
13967
  }) {
@@ -14243,7 +14261,83 @@ void (async () => {
14243
14261
  manifest: cmdManifest,
14244
14262
  uninstall: cmdUninstall
14245
14263
  }, {
14246
- aliases: {},
14264
+ aliases: {
14265
+ audit: {
14266
+ description: cmdAuditLog.description,
14267
+ hidden: true,
14268
+ argv: ['audit-log']
14269
+ },
14270
+ auditLogs: {
14271
+ description: cmdAuditLog.description,
14272
+ hidden: true,
14273
+ argv: ['audit-log']
14274
+ },
14275
+ deps: {
14276
+ description: cmdScanCreate$1.description,
14277
+ hidden: true,
14278
+ argv: ['dependencies']
14279
+ },
14280
+ feed: {
14281
+ description: cmdThreatFeed.description,
14282
+ hidden: true,
14283
+ argv: ['threat-feed']
14284
+ },
14285
+ license: {
14286
+ description: cmdOrganizationPolicyLicense.description,
14287
+ hidden: true,
14288
+ argv: ['organization', 'policy', 'license']
14289
+ },
14290
+ org: {
14291
+ description: cmdOrganization.description,
14292
+ hidden: true,
14293
+ argv: ['organization']
14294
+ },
14295
+ orgs: {
14296
+ description: cmdOrganization.description,
14297
+ hidden: true,
14298
+ argv: ['organization']
14299
+ },
14300
+ organizations: {
14301
+ description: cmdOrganization.description,
14302
+ hidden: true,
14303
+ argv: ['organization']
14304
+ },
14305
+ organisation: {
14306
+ description: cmdOrganization.description,
14307
+ hidden: true,
14308
+ argv: ['organization']
14309
+ },
14310
+ organisations: {
14311
+ description: cmdOrganization.description,
14312
+ hidden: true,
14313
+ argv: ['organization']
14314
+ },
14315
+ pkg: {
14316
+ description: cmdPackage.description,
14317
+ hidden: true,
14318
+ argv: ['package']
14319
+ },
14320
+ repo: {
14321
+ description: cmdRepos.description,
14322
+ hidden: true,
14323
+ argv: ['repos']
14324
+ },
14325
+ repository: {
14326
+ description: cmdRepos.description,
14327
+ hidden: true,
14328
+ argv: ['repos']
14329
+ },
14330
+ repositories: {
14331
+ description: cmdRepos.description,
14332
+ hidden: true,
14333
+ argv: ['repos']
14334
+ },
14335
+ security: {
14336
+ description: cmdOrganizationPolicyPolicy.description,
14337
+ hidden: true,
14338
+ argv: ['organization', 'policy', 'security']
14339
+ }
14340
+ },
14247
14341
  argv: process.argv.slice(2),
14248
14342
  name: SOCKET_CLI_BIN_NAME,
14249
14343
  importMeta: {
@@ -14278,5 +14372,5 @@ void (async () => {
14278
14372
  await utils.captureException(e);
14279
14373
  }
14280
14374
  })();
14281
- //# debugId=71ac8155-0e71-498a-8c38-412756a59a68
14375
+ //# debugId=fc631456-d58c-4127-856d-214963966236
14282
14376
  //# sourceMappingURL=cli.js.map