@socketsecurity/cli-with-sentry 1.0.64 → 1.0.66

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 (161) hide show
  1. package/dist/cli.js +704 -521
  2. package/dist/cli.js.map +1 -1
  3. package/dist/constants.js +18 -11
  4. package/dist/constants.js.map +1 -1
  5. package/dist/instrument-with-sentry.js +4 -9
  6. package/dist/instrument-with-sentry.js.map +1 -1
  7. package/dist/shadow-npm-inject.js +13 -16
  8. package/dist/shadow-npm-inject.js.map +1 -1
  9. package/dist/types/commands/analytics/fetch-org-analytics.d.mts +6 -2
  10. package/dist/types/commands/analytics/fetch-org-analytics.d.mts.map +1 -1
  11. package/dist/types/commands/analytics/fetch-repo-analytics.d.mts +6 -2
  12. package/dist/types/commands/analytics/fetch-repo-analytics.d.mts.map +1 -1
  13. package/dist/types/commands/analytics/output-analytics.d.mts +4 -4
  14. package/dist/types/commands/analytics/output-analytics.d.mts.map +1 -1
  15. package/dist/types/commands/audit-log/fetch-audit-log.d.mts +10 -5
  16. package/dist/types/commands/audit-log/fetch-audit-log.d.mts.map +1 -1
  17. package/dist/types/commands/audit-log/handle-audit-log.d.mts +1 -1
  18. package/dist/types/commands/audit-log/handle-audit-log.d.mts.map +1 -1
  19. package/dist/types/commands/audit-log/output-audit-log.d.mts +6 -6
  20. package/dist/types/commands/audit-log/output-audit-log.d.mts.map +1 -1
  21. package/dist/types/commands/ci/fetch-default-org-slug.d.mts +1 -1
  22. package/dist/types/commands/ci/fetch-default-org-slug.d.mts.map +1 -1
  23. package/dist/types/commands/ci/handle-ci.d.mts +1 -1
  24. package/dist/types/commands/ci/handle-ci.d.mts.map +1 -1
  25. package/dist/types/commands/config/cmd-config-auto.d.mts.map +1 -1
  26. package/dist/types/commands/config/cmd-config-get.d.mts.map +1 -1
  27. package/dist/types/commands/config/cmd-config-set.d.mts.map +1 -1
  28. package/dist/types/commands/config/cmd-config-unset.d.mts.map +1 -1
  29. package/dist/types/commands/config/discover-config-value.d.mts.map +1 -1
  30. package/dist/types/commands/config/output-config-list.d.mts.map +1 -1
  31. package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
  32. package/dist/types/commands/fix/handle-fix.d.mts +2 -1
  33. package/dist/types/commands/fix/handle-fix.d.mts.map +1 -1
  34. package/dist/types/commands/login/attempt-login.d.mts.map +1 -1
  35. package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts +1 -1
  36. package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts.map +1 -1
  37. package/dist/types/commands/manifest/output-requirements.d.mts +1 -1
  38. package/dist/types/commands/manifest/output-requirements.d.mts.map +1 -1
  39. package/dist/types/commands/organization/fetch-dependencies.d.mts +8 -3
  40. package/dist/types/commands/organization/fetch-dependencies.d.mts.map +1 -1
  41. package/dist/types/commands/organization/fetch-license-policy.d.mts +6 -2
  42. package/dist/types/commands/organization/fetch-license-policy.d.mts.map +1 -1
  43. package/dist/types/commands/organization/fetch-organization-list.d.mts +6 -2
  44. package/dist/types/commands/organization/fetch-organization-list.d.mts.map +1 -1
  45. package/dist/types/commands/organization/fetch-quota.d.mts +6 -2
  46. package/dist/types/commands/organization/fetch-quota.d.mts.map +1 -1
  47. package/dist/types/commands/organization/fetch-security-policy.d.mts +6 -2
  48. package/dist/types/commands/organization/fetch-security-policy.d.mts.map +1 -1
  49. package/dist/types/commands/organization/output-dependencies.d.mts +2 -2
  50. package/dist/types/commands/organization/output-dependencies.d.mts.map +1 -1
  51. package/dist/types/commands/organization/output-license-policy.d.mts +2 -2
  52. package/dist/types/commands/organization/output-license-policy.d.mts.map +1 -1
  53. package/dist/types/commands/organization/output-organization-list.d.mts +2 -2
  54. package/dist/types/commands/organization/output-organization-list.d.mts.map +1 -1
  55. package/dist/types/commands/organization/output-quota.d.mts +2 -2
  56. package/dist/types/commands/organization/output-quota.d.mts.map +1 -1
  57. package/dist/types/commands/organization/output-security-policy.d.mts +2 -2
  58. package/dist/types/commands/organization/output-security-policy.d.mts.map +1 -1
  59. package/dist/types/commands/package/fetch-purls-shallow-score.d.mts +6 -2
  60. package/dist/types/commands/package/fetch-purls-shallow-score.d.mts.map +1 -1
  61. package/dist/types/commands/repository/fetch-create-repo.d.mts +11 -6
  62. package/dist/types/commands/repository/fetch-create-repo.d.mts.map +1 -1
  63. package/dist/types/commands/repository/fetch-delete-repo.d.mts +6 -2
  64. package/dist/types/commands/repository/fetch-delete-repo.d.mts.map +1 -1
  65. package/dist/types/commands/repository/fetch-list-all-repos.d.mts +8 -6
  66. package/dist/types/commands/repository/fetch-list-all-repos.d.mts.map +1 -1
  67. package/dist/types/commands/repository/fetch-list-repos.d.mts +9 -4
  68. package/dist/types/commands/repository/fetch-list-repos.d.mts.map +1 -1
  69. package/dist/types/commands/repository/fetch-update-repo.d.mts +11 -6
  70. package/dist/types/commands/repository/fetch-update-repo.d.mts.map +1 -1
  71. package/dist/types/commands/repository/fetch-view-repo.d.mts +6 -2
  72. package/dist/types/commands/repository/fetch-view-repo.d.mts.map +1 -1
  73. package/dist/types/commands/repository/handle-create-repo.d.mts +2 -2
  74. package/dist/types/commands/repository/handle-create-repo.d.mts.map +1 -1
  75. package/dist/types/commands/repository/handle-list-repos.d.mts +2 -2
  76. package/dist/types/commands/repository/handle-list-repos.d.mts.map +1 -1
  77. package/dist/types/commands/repository/handle-update-repo.d.mts +2 -2
  78. package/dist/types/commands/repository/handle-update-repo.d.mts.map +1 -1
  79. package/dist/types/commands/repository/output-create-repo.d.mts +2 -2
  80. package/dist/types/commands/repository/output-create-repo.d.mts.map +1 -1
  81. package/dist/types/commands/repository/output-delete-repo.d.mts +2 -2
  82. package/dist/types/commands/repository/output-delete-repo.d.mts.map +1 -1
  83. package/dist/types/commands/repository/output-list-repos.d.mts +2 -2
  84. package/dist/types/commands/repository/output-list-repos.d.mts.map +1 -1
  85. package/dist/types/commands/repository/output-update-repo.d.mts +2 -2
  86. package/dist/types/commands/repository/output-update-repo.d.mts.map +1 -1
  87. package/dist/types/commands/repository/output-view-repo.d.mts +2 -2
  88. package/dist/types/commands/repository/output-view-repo.d.mts.map +1 -1
  89. package/dist/types/commands/scan/create-scan-from-github.d.mts.map +1 -1
  90. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +12 -3
  91. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +1 -1
  92. package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts +6 -2
  93. package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts.map +1 -1
  94. package/dist/types/commands/scan/fetch-diff-scan.d.mts +2 -2
  95. package/dist/types/commands/scan/fetch-diff-scan.d.mts.map +1 -1
  96. package/dist/types/commands/scan/fetch-list-scans.d.mts +9 -4
  97. package/dist/types/commands/scan/fetch-list-scans.d.mts.map +1 -1
  98. package/dist/types/commands/scan/fetch-report-data.d.mts +8 -3
  99. package/dist/types/commands/scan/fetch-report-data.d.mts.map +1 -1
  100. package/dist/types/commands/scan/fetch-scan-metadata.d.mts +6 -2
  101. package/dist/types/commands/scan/fetch-scan-metadata.d.mts.map +1 -1
  102. package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +6 -2
  103. package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts.map +1 -1
  104. package/dist/types/commands/scan/generate-report.d.mts +2 -2
  105. package/dist/types/commands/scan/generate-report.d.mts.map +1 -1
  106. package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
  107. package/dist/types/commands/scan/handle-list-scans.d.mts +2 -2
  108. package/dist/types/commands/scan/handle-list-scans.d.mts.map +1 -1
  109. package/dist/types/commands/scan/handle-scan-report.d.mts.map +1 -1
  110. package/dist/types/commands/scan/output-create-new-scan.d.mts +2 -2
  111. package/dist/types/commands/scan/output-create-new-scan.d.mts.map +1 -1
  112. package/dist/types/commands/scan/output-delete-scan.d.mts +2 -2
  113. package/dist/types/commands/scan/output-delete-scan.d.mts.map +1 -1
  114. package/dist/types/commands/scan/output-diff-scan.d.mts +2 -2
  115. package/dist/types/commands/scan/output-diff-scan.d.mts.map +1 -1
  116. package/dist/types/commands/scan/output-list-scans.d.mts +2 -2
  117. package/dist/types/commands/scan/output-list-scans.d.mts.map +1 -1
  118. package/dist/types/commands/scan/output-scan-metadata.d.mts +2 -2
  119. package/dist/types/commands/scan/output-scan-metadata.d.mts.map +1 -1
  120. package/dist/types/commands/scan/output-scan-report.d.mts +2 -2
  121. package/dist/types/commands/scan/output-scan-report.d.mts.map +1 -1
  122. package/dist/types/commands/scan/stream-scan.d.mts +6 -1
  123. package/dist/types/commands/scan/stream-scan.d.mts.map +1 -1
  124. package/dist/types/commands/scan/suggest-org-slug.d.mts.map +1 -1
  125. package/dist/types/commands/scan/suggest-repo-slug.d.mts +5 -1
  126. package/dist/types/commands/scan/suggest-repo-slug.d.mts.map +1 -1
  127. package/dist/types/constants.d.mts.map +1 -1
  128. package/dist/types/shadow/npm/arborist-helpers.d.mts +1 -1
  129. package/dist/types/shadow/npm/arborist-helpers.d.mts.map +1 -1
  130. package/dist/types/utils/alert/severity.d.mts +2 -2
  131. package/dist/types/utils/alert/severity.d.mts.map +1 -1
  132. package/dist/types/utils/alerts-map.d.mts +1 -1
  133. package/dist/types/utils/alerts-map.d.mts.map +1 -1
  134. package/dist/types/utils/api.d.mts +8 -3
  135. package/dist/types/utils/api.d.mts.map +1 -1
  136. package/dist/types/utils/coana.d.mts.map +1 -1
  137. package/dist/types/utils/config.d.mts +4 -2
  138. package/dist/types/utils/config.d.mts.map +1 -1
  139. package/dist/types/utils/fs.d.mts +3 -1
  140. package/dist/types/utils/fs.d.mts.map +1 -1
  141. package/dist/types/utils/glob.d.mts +4 -2
  142. package/dist/types/utils/glob.d.mts.map +1 -1
  143. package/dist/types/utils/path-resolve.d.mts +2 -2
  144. package/dist/types/utils/path-resolve.d.mts.map +1 -1
  145. package/dist/types/utils/sdk.d.mts +6 -1
  146. package/dist/types/utils/sdk.d.mts.map +1 -1
  147. package/dist/utils.js +262 -145
  148. package/dist/utils.js.map +1 -1
  149. package/dist/vendor.js +143 -64
  150. package/external/@socketsecurity/registry/extensions.json +2 -2
  151. package/external/@socketsecurity/registry/external/@inquirer/select.js +14 -2
  152. package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +4 -4
  153. package/external/@socketsecurity/registry/external/@socketregistry/yocto-spinner.js +20 -11
  154. package/external/@socketsecurity/registry/external/libnpmpack.js +4 -4
  155. package/external/@socketsecurity/registry/external/npm-package-arg.js +4 -4
  156. package/external/@socketsecurity/registry/external/pacote.js +4 -4
  157. package/external/@socketsecurity/registry/external/validate-npm-package-name.js +4 -4
  158. package/external/@socketsecurity/registry/lib/regexps.js +1 -1
  159. package/external/@socketsecurity/registry/lib/spinner.js +27 -23
  160. package/external/@socketsecurity/registry/manifest.json +7 -7
  161. package/package.json +14 -14
package/dist/vendor.js CHANGED
@@ -27,7 +27,8 @@ var require$$2$4 = require$$1$8;
27
27
  var require$$3$3 = require$$2$3;
28
28
  var require$$5$2 = require('node:readline');
29
29
  var require$$6$2 = require('../external/@socketsecurity/registry/lib/constants/abort-signal');
30
- var require$$7$4 = require('../external/@socketsecurity/registry/lib/promises');
30
+ var require$$7$4 = require('../external/@socketsecurity/registry/lib/objects');
31
+ var require$$8$1 = require('../external/@socketsecurity/registry/lib/promises');
31
32
  var node_buffer = require$$0$h;
32
33
  var childProcess = require('node:child_process');
33
34
  var require$$0$k = fs$2;
@@ -51,7 +52,6 @@ var require$$0$r = require('node:http2');
51
52
  var require$$1$d = require('node:v8');
52
53
  var require$$2$7 = require$$6$3;
53
54
 
54
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
55
55
  function camelCase$1(str) {
56
56
  const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
57
57
  if (!isCamelCase) {
@@ -14972,7 +14972,7 @@ var properties$2 = {
14972
14972
  }
14973
14973
  };
14974
14974
  var additionalProperties$1 = false;
14975
- var require$$9$1 = {
14975
+ var require$$9$2 = {
14976
14976
  $id: $id$1,
14977
14977
  description: description$1,
14978
14978
  type: type$3,
@@ -15830,7 +15830,7 @@ function requireCore$1() {
15830
15830
  const resolve_1 = requireResolve();
15831
15831
  const dataType_1 = requireDataType();
15832
15832
  const util_1 = requireUtil$3();
15833
- const $dataRefSchema = require$$9$1;
15833
+ const $dataRefSchema = require$$9$2;
15834
15834
  const uri_1 = requireUri();
15835
15835
  const defaultRegExp = (str, flags) => new RegExp(str, flags);
15836
15836
  defaultRegExp.code = "new RegExp";
@@ -35519,7 +35519,7 @@ var isInteractiveExports = /*@__PURE__*/ requireIsInteractive();
35519
35519
  var dist$e = {};
35520
35520
 
35521
35521
  var name$2 = "@socketsecurity/sdk";
35522
- var version$5 = "1.4.57";
35522
+ var version$5 = "1.4.64";
35523
35523
  var license = "MIT";
35524
35524
  var description = "SDK for the Socket API client";
35525
35525
  var author = {
@@ -35602,15 +35602,15 @@ var scripts = {
35602
35602
  "update:deps": "npx --yes npm-check-updates"
35603
35603
  };
35604
35604
  var dependencies = {
35605
- "@socketsecurity/registry": "1.0.239"
35605
+ "@socketsecurity/registry": "1.0.244"
35606
35606
  };
35607
35607
  var devDependencies = {
35608
35608
  "@biomejs/biome": "2.1.2",
35609
- "@dotenvx/dotenvx": "1.48.0",
35609
+ "@dotenvx/dotenvx": "1.48.3",
35610
35610
  "@eslint/compat": "1.3.1",
35611
35611
  "@eslint/js": "9.31.0",
35612
- "@types/node": "24.0.14",
35613
- "@typescript-eslint/parser": "8.37.0",
35612
+ "@types/node": "24.1.0",
35613
+ "@typescript-eslint/parser": "8.38.0",
35614
35614
  "@vitest/coverage-v8": "3.2.4",
35615
35615
  "del-cli": "6.0.0",
35616
35616
  eslint: "9.31.0",
@@ -35623,15 +35623,15 @@ var devDependencies = {
35623
35623
  globals: "16.3.0",
35624
35624
  "http2-wrapper": "2.2.1",
35625
35625
  husky: "9.1.7",
35626
- knip: "5.61.3",
35626
+ knip: "5.62.0",
35627
35627
  "lint-staged": "16.1.2",
35628
- nock: "14.0.5",
35628
+ nock: "14.0.6",
35629
35629
  "npm-run-all2": "8.0.4",
35630
35630
  "openapi-typescript": "6.7.6",
35631
- oxlint: "1.7.0",
35631
+ oxlint: "1.8.0",
35632
35632
  "type-coverage": "2.29.7",
35633
35633
  typescript: "~5.8.3",
35634
- "typescript-eslint": "8.37.0",
35634
+ "typescript-eslint": "8.38.0",
35635
35635
  vitest: "3.2.4"
35636
35636
  };
35637
35637
  var overrides = {
@@ -35644,7 +35644,7 @@ var files = [
35644
35644
  "dist/**",
35645
35645
  "types/**"
35646
35646
  ];
35647
- var require$$8$1 = {
35647
+ var require$$9$1 = {
35648
35648
  name: name$2,
35649
35649
  version: version$5,
35650
35650
  license: license,
@@ -35686,9 +35686,10 @@ function requireDist$e () {
35686
35686
  const node_path_1 = __importDefault(path$2);
35687
35687
  const node_readline_1 = __importDefault(require$$5$2);
35688
35688
  const abort_signal_1 = __importDefault(require$$6$2);
35689
- const promises_1 = require$$7$4;
35689
+ const objects_1 = require$$7$4;
35690
+ const promises_1 = require$$8$1;
35690
35691
  // @ts-ignore: Avoid TS import attributes error.
35691
- const package_json_1 = __importDefault(require$$8$1);
35692
+ const package_json_1 = __importDefault(require$$9$1);
35692
35693
  const DEFAULT_USER_AGENT = createUserAgentFromPkgJson(package_json_1.default);
35693
35694
  class ResponseError extends Error {
35694
35695
  response;
@@ -35886,6 +35887,14 @@ function requireDist$e () {
35886
35887
  return '(there was an error reading the body content)';
35887
35888
  }
35888
35889
  }
35890
+ function desc(value) {
35891
+ return {
35892
+ __proto__: null,
35893
+ configurable: true,
35894
+ value,
35895
+ writable: true
35896
+ };
35897
+ }
35889
35898
  function getHttpModule(baseUrl) {
35890
35899
  const { protocol } = new URL(baseUrl);
35891
35900
  return protocol === 'https:' ? node_https_1.default : node_http_1.default;
@@ -35935,6 +35944,38 @@ function requireDist$e () {
35935
35944
  const { statusCode } = response;
35936
35945
  return (typeof statusCode === 'number' && statusCode >= 200 && statusCode <= 299);
35937
35946
  }
35947
+ function promiseWithResolvers() {
35948
+ if (Promise.withResolvers) {
35949
+ return Promise.withResolvers();
35950
+ }
35951
+ // This is what the above does but it's not available in node 20 (it is in node 22)
35952
+ // @ts-ignore -- sigh.
35953
+ const obj = {};
35954
+ obj.promise = new Promise((resolver, reject) => {
35955
+ obj.resolve = resolver;
35956
+ obj.reject = reject;
35957
+ });
35958
+ return obj;
35959
+ }
35960
+ function queryToSearchParams(init) {
35961
+ const params = new URLSearchParams(init ?? '');
35962
+ const normalized = { __proto__: null };
35963
+ const entries = params.entries();
35964
+ for (const entry of entries) {
35965
+ let key = entry[0];
35966
+ const value = entry[1];
35967
+ if (key === 'defaultBranch') {
35968
+ key = 'default_branch';
35969
+ }
35970
+ else if (key === 'perPage') {
35971
+ key = 'per_page';
35972
+ }
35973
+ if (value || value === 0) {
35974
+ normalized[key] = value;
35975
+ }
35976
+ }
35977
+ return new URLSearchParams(normalized);
35978
+ }
35938
35979
  function resolveAbsPaths(filepaths, pathsRelativeTo) {
35939
35980
  const basePath = resolveBasePath(pathsRelativeTo);
35940
35981
  // Node's path.resolve will process path segments from right to left until
@@ -35982,20 +36023,20 @@ function requireDist$e () {
35982
36023
  signal: abort_signal_1.default
35983
36024
  };
35984
36025
  }
35985
- async #createBatchPurlRequest(queryParams, componentsObj) {
36026
+ async #createBatchPurlRequest(componentsObj, queryParams) {
35986
36027
  // Adds the first 'abort' listener to abortSignal.
35987
36028
  const req = getHttpModule(this.#baseUrl)
35988
- .request(`${this.#baseUrl}purl?${new URLSearchParams(queryParams ?? '')}`, {
36029
+ .request(`${this.#baseUrl}purl?${queryToSearchParams(queryParams)}`, {
35989
36030
  method: 'POST',
35990
36031
  ...this.#reqOptions
35991
36032
  })
35992
36033
  .end(JSON.stringify(componentsObj));
35993
36034
  return await getResponse(req);
35994
36035
  }
35995
- async *#createBatchPurlGenerator(queryParams, componentsObj) {
36036
+ async *#createBatchPurlGenerator(componentsObj, queryParams) {
35996
36037
  let res;
35997
36038
  try {
35998
- res = await (0, promises_1.pRetry)(() => this.#createBatchPurlRequest(queryParams, componentsObj), {
36039
+ res = await (0, promises_1.pRetry)(() => this.#createBatchPurlRequest(componentsObj, queryParams), {
35999
36040
  retries: 4,
36000
36041
  onRetryRethrow: true,
36001
36042
  onRetry(_attempt, error) {
@@ -36062,10 +36103,17 @@ function requireDist$e () {
36062
36103
  data: data
36063
36104
  };
36064
36105
  }
36065
- async batchPackageFetch(queryParams, componentsObj) {
36106
+ async batchPackageFetch(componentsObj, queryParams) {
36107
+ // Support previous argument signature.
36108
+ if ((0, objects_1.isObjectObject)(componentsObj) && !(0, objects_1.hasOwn)(componentsObj, 'components')) {
36109
+ const oldParam1 = componentsObj;
36110
+ const oldParam2 = queryParams;
36111
+ queryParams = oldParam1;
36112
+ componentsObj = oldParam2;
36113
+ }
36066
36114
  let res;
36067
36115
  try {
36068
- res = await this.#createBatchPurlRequest(queryParams, componentsObj);
36116
+ res = await this.#createBatchPurlRequest(componentsObj, queryParams);
36069
36117
  }
36070
36118
  catch (e) {
36071
36119
  return await this.#handleApiError(e);
@@ -36083,8 +36131,18 @@ function requireDist$e () {
36083
36131
  }
36084
36132
  return this.#handleApiSuccess(results);
36085
36133
  }
36086
- async *batchPackageStream(queryParams, componentsObj, options) {
36087
- const { chunkSize = 100, concurrencyLimit = 10 } = {
36134
+ async *batchPackageStream(componentsObj, options) {
36135
+ // Support previous argument signature.
36136
+ if ((0, objects_1.isObjectObject)(componentsObj) && !(0, objects_1.hasOwn)(componentsObj, 'components')) {
36137
+ const oldParam1 = componentsObj;
36138
+ const oldParam2 = options;
36139
+ componentsObj = oldParam2;
36140
+ options = {
36141
+ queryParams: oldParam1,
36142
+ ...arguments[2]
36143
+ };
36144
+ }
36145
+ const { chunkSize = 100, concurrencyLimit = 10, queryParams } = {
36088
36146
  __proto__: null,
36089
36147
  ...options
36090
36148
  };
@@ -36107,10 +36165,10 @@ function requireDist$e () {
36107
36165
  // No more work to do.
36108
36166
  return;
36109
36167
  }
36110
- const generator = this.#createBatchPurlGenerator(queryParams, {
36168
+ const generator = this.#createBatchPurlGenerator({
36111
36169
  // Chunk components.
36112
36170
  components: components.slice(index, index + chunkSize)
36113
- });
36171
+ }, queryParams);
36114
36172
  continueGen(generator);
36115
36173
  index += chunkSize;
36116
36174
  };
@@ -36151,38 +36209,56 @@ function requireDist$e () {
36151
36209
  node_events_1.default.setMaxListeners(oldAbortSignalMaxListeners, abort_signal_1.default);
36152
36210
  }
36153
36211
  }
36154
- async createDependenciesSnapshot(params, filepaths, pathsRelativeTo = '.') {
36212
+ async createDependenciesSnapshot(filepaths, pathsRelativeTo = '.', queryParams) {
36213
+ // Support previous argument signature.
36214
+ if ((0, objects_1.isObjectObject)(filepaths)) {
36215
+ const oldParam1 = filepaths;
36216
+ const oldParam2 = pathsRelativeTo;
36217
+ const oldParam3 = queryParams;
36218
+ queryParams = oldParam1;
36219
+ filepaths = oldParam2;
36220
+ pathsRelativeTo = oldParam3;
36221
+ }
36155
36222
  const basePath = resolveBasePath(pathsRelativeTo);
36156
36223
  const absFilepaths = resolveAbsPaths(filepaths, basePath);
36157
36224
  try {
36158
- const data = await getResponseJson(await createUploadRequest(this.#baseUrl, `dependencies/upload?${new URLSearchParams(params)}`, createRequestBodyForFilepaths(absFilepaths, basePath), this.#reqOptions));
36225
+ const data = await getResponseJson(await createUploadRequest(this.#baseUrl, `dependencies/upload?${queryToSearchParams(queryParams)}`, createRequestBodyForFilepaths(absFilepaths, basePath), this.#reqOptions));
36159
36226
  return this.#handleApiSuccess(data);
36160
36227
  }
36161
36228
  catch (e) {
36162
36229
  return await this.#handleApiError(e);
36163
36230
  }
36164
36231
  }
36165
- async createOrgFullScan(orgSlug, queryParams, filepaths, pathsRelativeTo = '.') {
36232
+ async createOrgFullScan(orgSlug, filepaths, pathsRelativeTo = '.', queryParams) {
36233
+ // Support previous argument signature.
36234
+ if ((0, objects_1.isObjectObject)(filepaths)) {
36235
+ const oldParam2 = filepaths;
36236
+ const oldParam3 = pathsRelativeTo;
36237
+ const oldParam4 = queryParams;
36238
+ queryParams = oldParam2;
36239
+ filepaths = oldParam3;
36240
+ pathsRelativeTo = oldParam4;
36241
+ }
36166
36242
  const basePath = resolveBasePath(pathsRelativeTo);
36167
36243
  const absFilepaths = resolveAbsPaths(filepaths, basePath);
36168
36244
  try {
36169
- const data = await getResponseJson(await createUploadRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/full-scans?${new URLSearchParams(queryParams ?? '')}`, createRequestBodyForFilepaths(absFilepaths, basePath), this.#reqOptions));
36245
+ const data = await getResponseJson(await createUploadRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/full-scans?${queryToSearchParams(queryParams)}`, createRequestBodyForFilepaths(absFilepaths, basePath), this.#reqOptions));
36170
36246
  return this.#handleApiSuccess(data);
36171
36247
  }
36172
36248
  catch (e) {
36173
36249
  return await this.#handleApiError(e);
36174
36250
  }
36175
36251
  }
36176
- async createOrgRepo(orgSlug, params) {
36252
+ async createOrgRepo(orgSlug, queryParams) {
36177
36253
  try {
36178
- const data = await getResponseJson(await createPostRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/repos`, params, this.#reqOptions));
36254
+ const data = await getResponseJson(await createPostRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/repos`, queryParams, this.#reqOptions));
36179
36255
  return this.#handleApiSuccess(data);
36180
36256
  }
36181
36257
  catch (e) {
36182
36258
  return await this.#handleApiError(e);
36183
36259
  }
36184
36260
  }
36185
- async createReportFromFilepaths(filepaths, pathsRelativeTo = '.', issueRules) {
36261
+ async createScanFromFilepaths(filepaths, pathsRelativeTo = '.', issueRules) {
36186
36262
  const basePath = resolveBasePath(pathsRelativeTo);
36187
36263
  const absFilepaths = resolveAbsPaths(filepaths, basePath);
36188
36264
  try {
@@ -36201,10 +36277,6 @@ function requireDist$e () {
36201
36277
  return await this.#handleApiError(e);
36202
36278
  }
36203
36279
  }
36204
- // Alias to preserve backwards compatibility.
36205
- async createReportFromFilePaths(filepaths, pathsRelativeTo = '.', issueRules) {
36206
- return await this.createReportFromFilepaths(filepaths, pathsRelativeTo, issueRules);
36207
- }
36208
36280
  async deleteOrgFullScan(orgSlug, fullScanId) {
36209
36281
  try {
36210
36282
  const data = await getResponseJson(await createDeleteRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/full-scans/${encodeURIComponent(fullScanId)}`, this.#reqOptions));
@@ -36225,7 +36297,7 @@ function requireDist$e () {
36225
36297
  }
36226
36298
  async getAuditLogEvents(orgSlug, queryParams) {
36227
36299
  try {
36228
- const data = await getResponseJson(await createGetRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/audit-log?${new URLSearchParams(queryParams ?? '')}`, this.#reqOptions));
36300
+ const data = await getResponseJson(await createGetRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/audit-log?${queryToSearchParams(queryParams)}`, this.#reqOptions));
36229
36301
  return this.#handleApiSuccess(data);
36230
36302
  }
36231
36303
  catch (e) {
@@ -36282,7 +36354,7 @@ function requireDist$e () {
36282
36354
  }
36283
36355
  async getOrgFullScanList(orgSlug, queryParams) {
36284
36356
  try {
36285
- const data = await getResponseJson(await createGetRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/full-scans?${new URLSearchParams(queryParams ?? '')}`, this.#reqOptions));
36357
+ const data = await getResponseJson(await createGetRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/full-scans?${queryToSearchParams(queryParams)}`, this.#reqOptions));
36286
36358
  return this.#handleApiSuccess(data);
36287
36359
  }
36288
36360
  catch (e) {
@@ -36320,7 +36392,7 @@ function requireDist$e () {
36320
36392
  }
36321
36393
  async getOrgRepoList(orgSlug, queryParams) {
36322
36394
  try {
36323
- const data = await getResponseJson(await createGetRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/repos?${new URLSearchParams(queryParams ?? '')}`, this.#reqOptions));
36395
+ const data = await getResponseJson(await createGetRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/repos?${queryToSearchParams(queryParams)}`, this.#reqOptions));
36324
36396
  return this.#handleApiSuccess(data);
36325
36397
  }
36326
36398
  catch (e) {
@@ -36354,7 +36426,7 @@ function requireDist$e () {
36354
36426
  return await this.#handleApiError(e);
36355
36427
  }
36356
36428
  }
36357
- async getReport(id) {
36429
+ async getScan(id) {
36358
36430
  try {
36359
36431
  const data = await getResponseJson(await createGetRequest(this.#baseUrl, `report/view/${encodeURIComponent(id)}`, this.#reqOptions));
36360
36432
  return this.#handleApiSuccess(data);
@@ -36363,7 +36435,7 @@ function requireDist$e () {
36363
36435
  return await this.#handleApiError(e);
36364
36436
  }
36365
36437
  }
36366
- async getReportList() {
36438
+ async getScanList() {
36367
36439
  try {
36368
36440
  const data = await getResponseJson(await createGetRequest(this.#baseUrl, 'report/list', this.#reqOptions));
36369
36441
  return this.#handleApiSuccess(data);
@@ -36372,7 +36444,7 @@ function requireDist$e () {
36372
36444
  return await this.#handleApiError(e);
36373
36445
  }
36374
36446
  }
36375
- async getReportSupportedFiles() {
36447
+ async getSupportedScanFiles() {
36376
36448
  try {
36377
36449
  const data = await getResponseJson(await createGetRequest(this.#baseUrl, 'report/supported', this.#reqOptions));
36378
36450
  return this.#handleApiSuccess(data);
@@ -36381,7 +36453,7 @@ function requireDist$e () {
36381
36453
  return await this.#handleApiError(e);
36382
36454
  }
36383
36455
  }
36384
- async getScoreByNPMPackage(pkgName, version) {
36456
+ async getScoreByNpmPackage(pkgName, version) {
36385
36457
  try {
36386
36458
  const data = await getResponseJson(await createGetRequest(this.#baseUrl, `npm/${encodeURIComponent(pkgName)}/${encodeURIComponent(version)}/score`, this.#reqOptions));
36387
36459
  return this.#handleApiSuccess(data);
@@ -36399,39 +36471,46 @@ function requireDist$e () {
36399
36471
  return await this.#handleApiError(e);
36400
36472
  }
36401
36473
  }
36402
- async searchDependencies(params) {
36474
+ async searchDependencies(queryParams) {
36403
36475
  try {
36404
- const data = await getResponseJson(await createPostRequest(this.#baseUrl, 'dependencies/search', params, this.#reqOptions));
36476
+ const data = await getResponseJson(await createPostRequest(this.#baseUrl, 'dependencies/search', queryParams, this.#reqOptions));
36405
36477
  return this.#handleApiSuccess(data);
36406
36478
  }
36407
36479
  catch (e) {
36408
36480
  return await this.#handleApiError(e);
36409
36481
  }
36410
36482
  }
36411
- async updateOrgRepo(orgSlug, repoSlug, params) {
36483
+ async updateOrgRepo(orgSlug, repoSlug, queryParams) {
36412
36484
  try {
36413
- const data = await getResponseJson(await createPostRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/repos/${encodeURIComponent(repoSlug)}`, params, this.#reqOptions));
36485
+ const data = await getResponseJson(await createPostRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/repos/${encodeURIComponent(repoSlug)}`, queryParams, this.#reqOptions));
36414
36486
  return this.#handleApiSuccess(data);
36415
36487
  }
36416
36488
  catch (e) {
36417
36489
  return await this.#handleApiError(e);
36418
36490
  }
36419
36491
  }
36420
- }
36421
- dist$e.SocketSdk = SocketSdk;
36422
- function promiseWithResolvers() {
36423
- if (Promise.withResolvers) {
36424
- return Promise.withResolvers();
36492
+ async uploadManifestFiles(orgSlug, filepaths, pathsRelativeTo = '.') {
36493
+ const basePath = resolveBasePath(pathsRelativeTo);
36494
+ const absFilepaths = resolveAbsPaths(filepaths, basePath);
36495
+ try {
36496
+ const data = await getResponseJson(await createUploadRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/upload-manifest-files`, createRequestBodyForFilepaths(absFilepaths, basePath), this.#reqOptions));
36497
+ return this.#handleApiSuccess(data);
36498
+ }
36499
+ catch (e) {
36500
+ return (await this.#handleApiError(e));
36501
+ }
36425
36502
  }
36426
- // This is what the above does but it's not available in node 20 (it is in node 22)
36427
- // @ts-ignore -- sigh.
36428
- const obj = {};
36429
- obj.promise = new Promise((resolver, reject) => {
36430
- obj.resolve = resolver;
36431
- obj.reject = reject;
36432
- });
36433
- return obj;
36434
36503
  }
36504
+ dist$e.SocketSdk = SocketSdk;
36505
+ // Add aliases.
36506
+ Object.defineProperties(SocketSdk.prototype, {
36507
+ createReportFromFilepaths: desc(SocketSdk.prototype.createScanFromFilepaths),
36508
+ createReportFromFilePaths: desc(SocketSdk.prototype.createScanFromFilepaths),
36509
+ getReport: desc(SocketSdk.prototype.getScan),
36510
+ getReportList: desc(SocketSdk.prototype.getScanList),
36511
+ getReportSupportedFiles: desc(SocketSdk.prototype.getSupportedScanFiles),
36512
+ getScoreByNPMPackage: desc(SocketSdk.prototype.getScoreByNpmPackage)
36513
+ });
36435
36514
 
36436
36515
  return dist$e;
36437
36516
  }
@@ -41065,7 +41144,7 @@ async function defaultBrowser() {
41065
41144
  const execFile = require$$1$6.promisify(childProcess.execFile);
41066
41145
 
41067
41146
  // Path to included `xdg-open`.
41068
- const __dirname$1 = path$2.dirname(require$$0$7.fileURLToPath((typeof document === 'undefined' ? require$$0$7.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vendor.js', document.baseURI).href))));
41147
+ const __dirname$1 = path$2.dirname(require$$0$7.fileURLToPath(require('node:url').pathToFileURL(__filename).href));
41069
41148
  const localXdgOpenPath = path$2.join(__dirname$1, 'xdg-open');
41070
41149
  const {
41071
41150
  platform,
@@ -166554,7 +166633,7 @@ if (nodeVersion) {
166554
166633
  }
166555
166634
  // Creates a yargs-parser instance using Node.js standard libraries:
166556
166635
  const env = process ? process.env : {};
166557
- const require$1 = require$$5$3.createRequire ? require$$5$3.createRequire((typeof document === 'undefined' ? require$$0$7.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vendor.js', document.baseURI).href))) : undefined;
166636
+ const require$1 = require$$5$3.createRequire ? require$$5$3.createRequire(require('node:url').pathToFileURL(__filename).href) : undefined;
166558
166637
  const parser = new YargsParser({
166559
166638
  cwd: process.cwd,
166560
166639
  env: () => {
@@ -168581,5 +168660,5 @@ exports.terminalLinkExports = terminalLinkExports;
168581
168660
  exports.updater = updater$1;
168582
168661
  exports.yargsParser = yargsParser;
168583
168662
  exports.yoctocolorsCjsExports = yoctocolorsCjsExports;
168584
- //# debugId=a6d120ac-674c-4f55-94f7-a4c5c64f00cb
168663
+ //# debugId=9bf3c64f-db54-4de9-bf0a-7d81a00c9c65
168585
168664
  //# sourceMappingURL=vendor.js.map
@@ -4,7 +4,7 @@
4
4
  "pkg:npm/%40socketregistry/packageurl-js@latest",
5
5
  {
6
6
  "categories": ["levelup"],
7
- "engines": { "node": ">=18.20.4" },
7
+ "engines": { "node": ">=18" },
8
8
  "interop": ["cjs"],
9
9
  "license": "MIT",
10
10
  "name": "@socketregistry/packageurl-js",
@@ -16,7 +16,7 @@
16
16
  "pkg:npm/shell-quote@latest",
17
17
  {
18
18
  "categories": ["tuneup"],
19
- "engines": { "node": ">=18.20.4" },
19
+ "engines": { "node": ">=18" },
20
20
  "interop": ["cjs"],
21
21
  "license": "MIT",
22
22
  "name": "shell-quote",
@@ -3590,7 +3590,16 @@ const index = createPrompt((config, done) => {
3590
3590
  setActive(next)
3591
3591
  }
3592
3592
  } else if (isNumberKey(key) && !Number.isNaN(Number(rl.line))) {
3593
- const position = Number(rl.line) - 1
3593
+ const selectedIndex = Number(rl.line) - 1
3594
+ // Find the nth item (ignoring separators)
3595
+ let selectableIndex = -1
3596
+ const position = items.findIndex(item => {
3597
+ if (Separator.isSeparator(item)) {
3598
+ return false
3599
+ }
3600
+ selectableIndex++
3601
+ return selectableIndex === selectedIndex
3602
+ })
3594
3603
  const item = items[position]
3595
3604
  if (item != null && isSelectable(item)) {
3596
3605
  setActive(position)
@@ -3639,14 +3648,17 @@ const index = createPrompt((config, done) => {
3639
3648
  )
3640
3649
  }
3641
3650
  }
3651
+ let separatorCount = 0
3642
3652
  const page = usePagination({
3643
3653
  items,
3644
3654
  active,
3645
3655
  renderItem({ item, isActive, index }) {
3646
3656
  if (Separator.isSeparator(item)) {
3657
+ separatorCount++
3647
3658
  return ` ${item.separator}`
3648
3659
  }
3649
- const indexLabel = theme.indexMode === 'number' ? `${index + 1}. ` : ''
3660
+ const indexLabel =
3661
+ theme.indexMode === 'number' ? `${index + 1 - separatorCount}. ` : ''
3650
3662
  if (item.disabled) {
3651
3663
  const disabledLabel =
3652
3664
  typeof item.disabled === 'string' ? item.disabled : '(disabled)'
@@ -14362,7 +14362,7 @@ function requireLib$5() {
14362
14362
  hasRequiredLib$5 = 1
14363
14363
  const { builtinModules: builtins } = require$$0$5
14364
14364
  const scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$')
14365
- const blacklist = ['node_modules', 'favicon.ico']
14365
+ const exclusionList = ['node_modules', 'favicon.ico']
14366
14366
  function validate(name) {
14367
14367
  const warnings = []
14368
14368
  const errors = []
@@ -14392,9 +14392,9 @@ function requireLib$5() {
14392
14392
  }
14393
14393
 
14394
14394
  // No funny business
14395
- blacklist.forEach(function (blacklistedName) {
14396
- if (name.toLowerCase() === blacklistedName) {
14397
- errors.push(blacklistedName + ' is a blacklisted name')
14395
+ exclusionList.forEach(function (excludedName) {
14396
+ if (name.toLowerCase() === excludedName) {
14397
+ errors.push(excludedName + ' is not a valid package name')
14398
14398
  }
14399
14399
  })
14400
14400
 
@@ -140,7 +140,7 @@ function requireYoctoSpinner() {
140
140
  function getYoctocolors() {
141
141
  if (_yoctocolors === undefined) {
142
142
  _yoctocolors = {
143
- .../*@__PURE__*/ requireYoctocolorsCjs()
143
+ .../*@__PURE__*/ /*@__PURE__*/ requireYoctocolorsCjs()
144
144
  }
145
145
  }
146
146
  return _yoctocolors
@@ -195,6 +195,9 @@ function requireYoctoSpinner() {
195
195
  }
196
196
  return _stripVTControlCharacters(string)
197
197
  }
198
+ function normalizeText(value) {
199
+ return typeof value === 'string' ? value.trimStart() : ''
200
+ }
198
201
  class YoctoSpinner {
199
202
  #color
200
203
  #currentFrame = -1
@@ -216,9 +219,11 @@ function requireYoctoSpinner() {
216
219
  }
217
220
  const spinner = opts.spinner ?? getDefaultSpinner()
218
221
  const stream = opts.stream ?? getProcess().stderr
219
- this.#frames = spinner.frames
222
+ const { frames } = spinner
223
+ this.#frames =
224
+ (frames?.length ?? 0) < 1 ? [''] : frames.map(f => f.trim())
220
225
  this.#interval = spinner.interval
221
- this.#text = options.text ?? ''
226
+ this.#text = normalizeText(options.text)
222
227
  this.#stream = stream ?? process.stderr
223
228
  this.#color = options.color ?? 'cyan'
224
229
  this.#isInteractive = !!stream.isTTY && isProcessInteractive()
@@ -228,7 +233,6 @@ function requireYoctoSpinner() {
228
233
  if (this.isSpinning) {
229
234
  this.stop()
230
235
  }
231
-
232
236
  // SIGINT: 128 + 2
233
237
  // SIGTERM: 128 + 15
234
238
  const exitCode =
@@ -264,7 +268,7 @@ function requireYoctoSpinner() {
264
268
  const colors = getYoctocolors()
265
269
  const applyColor = colors[this.#color] ?? colors.cyan
266
270
  const frame = this.#frames[this.#currentFrame]
267
- let string = `${applyColor(frame)} ${this.#text}`
271
+ let string = `${frame ? `${applyColor(frame)} ` : ''}${this.#text}`
268
272
  if (string) {
269
273
  if (this.#indention.length) {
270
274
  string = `${this.#indention}${string}`
@@ -273,8 +277,12 @@ function requireYoctoSpinner() {
273
277
  string += '\n'
274
278
  }
275
279
  }
276
- this.clear()
277
- this.#write(string)
280
+ if (this.#isInteractive) {
281
+ this.clear()
282
+ }
283
+ if (string) {
284
+ this.#write(string)
285
+ }
278
286
  if (this.#isInteractive) {
279
287
  this.#lines = this.#lineCount(string)
280
288
  }
@@ -313,7 +321,7 @@ function requireYoctoSpinner() {
313
321
  return this.#text
314
322
  }
315
323
  set text(value) {
316
- this.#text = value ?? ''
324
+ this.#text = normalizeText(value)
317
325
  this.#render()
318
326
  }
319
327
  clear() {
@@ -321,7 +329,7 @@ function requireYoctoSpinner() {
321
329
  return this
322
330
  }
323
331
  this.#stream.cursorTo(0)
324
- for (let index = 0; index < this.#lines; index++) {
332
+ for (let index = 0; index < this.#lines; index += 1) {
325
333
  if (index > 0) {
326
334
  this.#stream.moveCursor(0, -1)
327
335
  }
@@ -349,8 +357,9 @@ function requireYoctoSpinner() {
349
357
  return this
350
358
  }
351
359
  start(text) {
352
- if (text) {
353
- this.#text = text
360
+ const normalized = normalizeText(text)
361
+ if (normalized) {
362
+ this.#text = normalized
354
363
  }
355
364
  if (this.isSpinning) {
356
365
  return this
@@ -14383,7 +14383,7 @@ function requireLib$I() {
14383
14383
  hasRequiredLib$I = 1
14384
14384
  const { builtinModules: builtins } = require$$0$b
14385
14385
  const scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$')
14386
- const blacklist = ['node_modules', 'favicon.ico']
14386
+ const exclusionList = ['node_modules', 'favicon.ico']
14387
14387
  function validate(name) {
14388
14388
  const warnings = []
14389
14389
  const errors = []
@@ -14413,9 +14413,9 @@ function requireLib$I() {
14413
14413
  }
14414
14414
 
14415
14415
  // No funny business
14416
- blacklist.forEach(function (blacklistedName) {
14417
- if (name.toLowerCase() === blacklistedName) {
14418
- errors.push(blacklistedName + ' is a blacklisted name')
14416
+ exclusionList.forEach(function (excludedName) {
14417
+ if (name.toLowerCase() === excludedName) {
14418
+ errors.push(excludedName + ' is not a valid package name')
14419
14419
  }
14420
14420
  })
14421
14421