@socketsecurity/cli-with-sentry 0.15.56 → 0.15.58

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.
Files changed (36) hide show
  1. package/dist/cli.js +60 -34
  2. package/dist/cli.js.map +1 -1
  3. package/dist/constants.js +3 -3
  4. package/dist/constants.js.map +1 -1
  5. package/dist/types/commands/fix/npm-fix.d.mts.map +1 -1
  6. package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -1
  7. package/dist/types/commands/scan/handle-reach-scan.d.mts +1 -1
  8. package/dist/types/commands/scan/handle-reach-scan.d.mts.map +1 -1
  9. package/dist/types/commands/scan/scan-reachability.d.mts +1 -1
  10. package/dist/types/commands/scan/scan-reachability.d.mts.map +1 -1
  11. package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +1 -1
  12. package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +4 -1
  13. package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +1 -1
  14. package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +4 -1
  15. package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +1 -1
  16. package/dist/types/utils/purl.d.mts +12 -94
  17. package/dist/types/utils/purl.d.mts.map +1 -1
  18. package/dist/types/utils/socket-package-alert.d.mts.map +1 -1
  19. package/dist/types/utils/socket-url.d.mts.map +1 -1
  20. package/dist/utils.js +2 -1
  21. package/dist/utils.js.map +1 -1
  22. package/dist/vendor.js +21 -21
  23. package/external/@coana-tech/cli/cli.mjs +2 -2
  24. package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +9 -4
  25. package/external/@socketsecurity/registry/external/@socketregistry/yocto-spinner.js +115 -132
  26. package/external/@socketsecurity/registry/external/@yarnpkg/extensions.js +18 -0
  27. package/external/@socketsecurity/registry/external/browserslist.js +662 -658
  28. package/external/@socketsecurity/registry/external/cacache.js +5 -3
  29. package/external/@socketsecurity/registry/external/libnpmpack.js +9 -4
  30. package/external/@socketsecurity/registry/external/make-fetch-happen.js +5 -3
  31. package/external/@socketsecurity/registry/external/npm-package-arg.js +4 -1
  32. package/external/@socketsecurity/registry/external/pacote.js +9 -4
  33. package/external/@socketsecurity/registry/external/validate-npm-package-name.js +4 -1
  34. package/external/@socketsecurity/registry/manifest.json +4 -4
  35. package/external/blessed-contrib/lib/widget/charts/line.js +5 -5
  36. package/package.json +8 -8
package/dist/cli.js CHANGED
@@ -12852,18 +12852,17 @@ async function outputScanReach(result, cwd, outputKind) {
12852
12852
  const {
12853
12853
  DOT_SOCKET_DOT_FACTS_JSON
12854
12854
  } = constants;
12855
- async function scanReachability(cwd) {
12855
+ async function scanReachability(argv, cwd) {
12856
12856
  try {
12857
12857
  const result = await spawn.spawn(constants.execPath, [
12858
12858
  // Lazily access constants.nodeNoWarningsFlags.
12859
12859
  ...constants.nodeNoWarningsFlags,
12860
12860
  // Lazily access constants.coanaBinPath.
12861
- constants.coanaBinPath, 'run', cwd, '--output-dir', cwd, '--disable-report-submission', '--socket-mode', DOT_SOCKET_DOT_FACTS_JSON], {
12861
+ constants.coanaBinPath, 'run', cwd, '--output-dir', cwd, '--socket-mode', DOT_SOCKET_DOT_FACTS_JSON, '--disable-report-submission', ...argv], {
12862
12862
  cwd,
12863
12863
  env: {
12864
12864
  ...process.env,
12865
- // Lazily access constants.ENV.SOCKET_CLI_API_TOKEN
12866
- SOCKET_CLI_API_TOKEN: constants.ENV.SOCKET_CLI_API_TOKEN
12865
+ SOCKET_CLI_API_TOKEN: utils.getDefaultToken()
12867
12866
  }
12868
12867
  });
12869
12868
  return {
@@ -12880,8 +12879,8 @@ async function scanReachability(cwd) {
12880
12879
  }
12881
12880
  }
12882
12881
 
12883
- async function handleScanReach(cwd, outputKind) {
12884
- const result = await scanReachability(cwd);
12882
+ async function handleScanReach(argv, cwd, outputKind) {
12883
+ const result = await scanReachability(argv, cwd);
12885
12884
  await outputScanReach(result, cwd, outputKind);
12886
12885
  }
12887
12886
 
@@ -12940,7 +12939,7 @@ async function run$6(argv, importMeta, {
12940
12939
  logger.logger.log(DRY_RUN_BAILING_NOW$6);
12941
12940
  return;
12942
12941
  }
12943
- await handleScanReach(cwd, outputKind);
12942
+ await handleScanReach(argv, cwd, outputKind);
12944
12943
  }
12945
12944
 
12946
12945
  const {
@@ -13725,11 +13724,14 @@ async function fetchThreatFeed({
13725
13724
  direction,
13726
13725
  ecosystem,
13727
13726
  filter,
13727
+ orgSlug,
13728
13728
  page,
13729
- perPage
13729
+ perPage,
13730
+ pkg,
13731
+ version
13730
13732
  }) {
13731
- const queryParams = new URLSearchParams([['direction', direction], ['ecosystem', ecosystem], ['filter', filter], ['page', page], ['per_page', String(perPage)]]);
13732
- return await utils.queryApiSafeJson(`threat-feed?${queryParams}`, 'the Threat Feed data');
13733
+ const queryParams = new URLSearchParams([['direction', direction], ['ecosystem', ecosystem], filter ? ['filter', filter] : ['', ''], ['page_cursor', page], ['per_page', String(perPage)], pkg ? ['name', pkg] : ['', ''], version ? ['version', version] : ['', '']]);
13734
+ return await utils.queryApiSafeJson(`orgs/${orgSlug}/threat-feed?${queryParams}`, 'the Threat Feed data');
13733
13735
  }
13734
13736
 
13735
13737
  const require$1 =Module.createRequire(require$$0.pathToFileURL(__filename).href)
@@ -13868,16 +13870,22 @@ async function handleThreatFeed({
13868
13870
  direction,
13869
13871
  ecosystem,
13870
13872
  filter,
13873
+ orgSlug,
13871
13874
  outputKind,
13872
13875
  page,
13873
- perPage
13876
+ perPage,
13877
+ pkg,
13878
+ version
13874
13879
  }) {
13875
13880
  const data = await fetchThreatFeed({
13876
13881
  direction,
13877
13882
  ecosystem,
13878
13883
  filter,
13884
+ orgSlug,
13879
13885
  page,
13880
- perPage
13886
+ perPage,
13887
+ pkg,
13888
+ version
13881
13889
  });
13882
13890
  await outputThreatFeed(data, outputKind);
13883
13891
  }
@@ -13892,6 +13900,24 @@ const config$2 = {
13892
13900
  flags: {
13893
13901
  ...utils.commonFlags,
13894
13902
  ...utils.outputFlags,
13903
+ direction: {
13904
+ type: 'string',
13905
+ shortFlag: 'd',
13906
+ default: 'desc',
13907
+ description: 'Order asc or desc by the createdAt attribute'
13908
+ },
13909
+ eco: {
13910
+ type: 'string',
13911
+ shortFlag: 'e',
13912
+ default: '',
13913
+ description: 'Only show threats for a particular ecosystem'
13914
+ },
13915
+ filter: {
13916
+ type: 'string',
13917
+ shortFlag: 'f',
13918
+ default: 'mal',
13919
+ description: 'Filter what type of threats to return'
13920
+ },
13895
13921
  interactive: {
13896
13922
  type: 'boolean',
13897
13923
  default: true,
@@ -13901,35 +13927,25 @@ const config$2 = {
13901
13927
  type: 'string',
13902
13928
  description: 'Force override the organization slug, overrides the default org from config'
13903
13929
  },
13904
- perPage: {
13905
- type: 'number',
13906
- shortFlag: 'pp',
13907
- default: 30,
13908
- description: 'Number of items per page'
13909
- },
13910
13930
  page: {
13911
13931
  type: 'string',
13912
13932
  shortFlag: 'p',
13913
13933
  default: '1',
13914
13934
  description: 'Page token'
13915
13935
  },
13916
- direction: {
13917
- type: 'string',
13918
- shortFlag: 'd',
13919
- default: 'desc',
13920
- description: 'Order asc or desc by the createdAt attribute'
13936
+ perPage: {
13937
+ type: 'number',
13938
+ shortFlag: 'pp',
13939
+ default: 30,
13940
+ description: 'Number of items per page'
13921
13941
  },
13922
- eco: {
13942
+ pkg: {
13923
13943
  type: 'string',
13924
- shortFlag: 'e',
13925
- default: '',
13926
- description: 'Only show threats for a particular ecosystem'
13944
+ description: 'Filter by this package name'
13927
13945
  },
13928
- filter: {
13946
+ version: {
13929
13947
  type: 'string',
13930
- shortFlag: 'f',
13931
- default: 'mal',
13932
- description: 'Filter what type of threats to return'
13948
+ description: 'Filter by this package version'
13933
13949
  }
13934
13950
  },
13935
13951
  help: (command, config) => `
@@ -13970,6 +13986,11 @@ const config$2 = {
13970
13986
  - nuget
13971
13987
  - pypi
13972
13988
 
13989
+ Note: if you filter by package name or version, it will do so for anything
13990
+ unless you also filter by that ecosystem and/or package name. When in
13991
+ doubt, look at the threat-feed and see the names in the name/version
13992
+ column. That's what you want to search for.
13993
+
13973
13994
  Examples
13974
13995
  $ ${command}${utils.isTestingV1() ? '' : ' FakeOrg'}
13975
13996
  $ ${command}${utils.isTestingV1() ? '' : ' FakeOrg'} --perPage=5 --page=2 --direction=asc --filter=joke
@@ -13994,7 +14015,9 @@ async function run$2(argv, importMeta, {
13994
14015
  interactive,
13995
14016
  json,
13996
14017
  markdown,
13997
- org: orgFlag
14018
+ org: orgFlag,
14019
+ pkg,
14020
+ version
13998
14021
  } = cli.flags;
13999
14022
  const outputKind = utils.getOutputKind(json, markdown);
14000
14023
  const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), cli.input[0] || '', !!interactive, !!dryRun);
@@ -14030,8 +14053,11 @@ async function run$2(argv, importMeta, {
14030
14053
  ecosystem: String(cli.flags['eco'] || ''),
14031
14054
  filter: String(cli.flags['filter'] || 'mal'),
14032
14055
  outputKind,
14056
+ orgSlug,
14033
14057
  page: String(cli.flags['page'] || '1'),
14034
- perPage: Number(cli.flags['perPage']) || 30
14058
+ perPage: Number(cli.flags['perPage']) || 30,
14059
+ pkg: String(pkg || ''),
14060
+ version: String(version || '')
14035
14061
  });
14036
14062
  }
14037
14063
 
@@ -14619,5 +14645,5 @@ void (async () => {
14619
14645
  await utils.captureException(e);
14620
14646
  }
14621
14647
  })();
14622
- //# debugId=f53da652-ed7e-41d2-baff-cba59a65e6b2
14648
+ //# debugId=858f0ee1-e2b9-482a-bf53-f0c50425ff4
14623
14649
  //# sourceMappingURL=cli.js.map