@socketsecurity/cli-with-sentry 1.0.65 → 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 (138) hide show
  1. package/dist/cli.js +522 -345
  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/shadow-npm-inject.js +6 -6
  6. package/dist/shadow-npm-inject.js.map +1 -1
  7. package/dist/types/commands/analytics/fetch-org-analytics.d.mts +6 -2
  8. package/dist/types/commands/analytics/fetch-org-analytics.d.mts.map +1 -1
  9. package/dist/types/commands/analytics/fetch-repo-analytics.d.mts +6 -2
  10. package/dist/types/commands/analytics/fetch-repo-analytics.d.mts.map +1 -1
  11. package/dist/types/commands/analytics/output-analytics.d.mts +4 -4
  12. package/dist/types/commands/analytics/output-analytics.d.mts.map +1 -1
  13. package/dist/types/commands/audit-log/fetch-audit-log.d.mts +10 -5
  14. package/dist/types/commands/audit-log/fetch-audit-log.d.mts.map +1 -1
  15. package/dist/types/commands/audit-log/handle-audit-log.d.mts +1 -1
  16. package/dist/types/commands/audit-log/handle-audit-log.d.mts.map +1 -1
  17. package/dist/types/commands/audit-log/output-audit-log.d.mts +6 -6
  18. package/dist/types/commands/audit-log/output-audit-log.d.mts.map +1 -1
  19. package/dist/types/commands/ci/fetch-default-org-slug.d.mts +1 -1
  20. package/dist/types/commands/ci/fetch-default-org-slug.d.mts.map +1 -1
  21. package/dist/types/commands/ci/handle-ci.d.mts +1 -1
  22. package/dist/types/commands/ci/handle-ci.d.mts.map +1 -1
  23. package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
  24. package/dist/types/commands/fix/handle-fix.d.mts +2 -1
  25. package/dist/types/commands/fix/handle-fix.d.mts.map +1 -1
  26. package/dist/types/commands/login/attempt-login.d.mts.map +1 -1
  27. package/dist/types/commands/organization/fetch-dependencies.d.mts +8 -3
  28. package/dist/types/commands/organization/fetch-dependencies.d.mts.map +1 -1
  29. package/dist/types/commands/organization/fetch-license-policy.d.mts +6 -2
  30. package/dist/types/commands/organization/fetch-license-policy.d.mts.map +1 -1
  31. package/dist/types/commands/organization/fetch-organization-list.d.mts +6 -2
  32. package/dist/types/commands/organization/fetch-organization-list.d.mts.map +1 -1
  33. package/dist/types/commands/organization/fetch-quota.d.mts +6 -2
  34. package/dist/types/commands/organization/fetch-quota.d.mts.map +1 -1
  35. package/dist/types/commands/organization/fetch-security-policy.d.mts +6 -2
  36. package/dist/types/commands/organization/fetch-security-policy.d.mts.map +1 -1
  37. package/dist/types/commands/organization/output-dependencies.d.mts +2 -2
  38. package/dist/types/commands/organization/output-dependencies.d.mts.map +1 -1
  39. package/dist/types/commands/organization/output-license-policy.d.mts +2 -2
  40. package/dist/types/commands/organization/output-license-policy.d.mts.map +1 -1
  41. package/dist/types/commands/organization/output-organization-list.d.mts +2 -2
  42. package/dist/types/commands/organization/output-organization-list.d.mts.map +1 -1
  43. package/dist/types/commands/organization/output-quota.d.mts +2 -2
  44. package/dist/types/commands/organization/output-quota.d.mts.map +1 -1
  45. package/dist/types/commands/organization/output-security-policy.d.mts +2 -2
  46. package/dist/types/commands/organization/output-security-policy.d.mts.map +1 -1
  47. package/dist/types/commands/package/fetch-purls-shallow-score.d.mts +6 -2
  48. package/dist/types/commands/package/fetch-purls-shallow-score.d.mts.map +1 -1
  49. package/dist/types/commands/repository/fetch-create-repo.d.mts +11 -6
  50. package/dist/types/commands/repository/fetch-create-repo.d.mts.map +1 -1
  51. package/dist/types/commands/repository/fetch-delete-repo.d.mts +6 -2
  52. package/dist/types/commands/repository/fetch-delete-repo.d.mts.map +1 -1
  53. package/dist/types/commands/repository/fetch-list-all-repos.d.mts +8 -6
  54. package/dist/types/commands/repository/fetch-list-all-repos.d.mts.map +1 -1
  55. package/dist/types/commands/repository/fetch-list-repos.d.mts +9 -4
  56. package/dist/types/commands/repository/fetch-list-repos.d.mts.map +1 -1
  57. package/dist/types/commands/repository/fetch-update-repo.d.mts +11 -6
  58. package/dist/types/commands/repository/fetch-update-repo.d.mts.map +1 -1
  59. package/dist/types/commands/repository/fetch-view-repo.d.mts +6 -2
  60. package/dist/types/commands/repository/fetch-view-repo.d.mts.map +1 -1
  61. package/dist/types/commands/repository/handle-create-repo.d.mts +2 -2
  62. package/dist/types/commands/repository/handle-create-repo.d.mts.map +1 -1
  63. package/dist/types/commands/repository/handle-list-repos.d.mts +2 -2
  64. package/dist/types/commands/repository/handle-list-repos.d.mts.map +1 -1
  65. package/dist/types/commands/repository/handle-update-repo.d.mts +2 -2
  66. package/dist/types/commands/repository/handle-update-repo.d.mts.map +1 -1
  67. package/dist/types/commands/repository/output-create-repo.d.mts +2 -2
  68. package/dist/types/commands/repository/output-create-repo.d.mts.map +1 -1
  69. package/dist/types/commands/repository/output-delete-repo.d.mts +2 -2
  70. package/dist/types/commands/repository/output-delete-repo.d.mts.map +1 -1
  71. package/dist/types/commands/repository/output-list-repos.d.mts +2 -2
  72. package/dist/types/commands/repository/output-list-repos.d.mts.map +1 -1
  73. package/dist/types/commands/repository/output-update-repo.d.mts +2 -2
  74. package/dist/types/commands/repository/output-update-repo.d.mts.map +1 -1
  75. package/dist/types/commands/repository/output-view-repo.d.mts +2 -2
  76. package/dist/types/commands/repository/output-view-repo.d.mts.map +1 -1
  77. package/dist/types/commands/scan/create-scan-from-github.d.mts.map +1 -1
  78. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +12 -3
  79. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +1 -1
  80. package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts +6 -2
  81. package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts.map +1 -1
  82. package/dist/types/commands/scan/fetch-diff-scan.d.mts +2 -2
  83. package/dist/types/commands/scan/fetch-diff-scan.d.mts.map +1 -1
  84. package/dist/types/commands/scan/fetch-list-scans.d.mts +9 -4
  85. package/dist/types/commands/scan/fetch-list-scans.d.mts.map +1 -1
  86. package/dist/types/commands/scan/fetch-report-data.d.mts +8 -3
  87. package/dist/types/commands/scan/fetch-report-data.d.mts.map +1 -1
  88. package/dist/types/commands/scan/fetch-scan-metadata.d.mts +6 -2
  89. package/dist/types/commands/scan/fetch-scan-metadata.d.mts.map +1 -1
  90. package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +6 -2
  91. package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts.map +1 -1
  92. package/dist/types/commands/scan/generate-report.d.mts +2 -2
  93. package/dist/types/commands/scan/generate-report.d.mts.map +1 -1
  94. package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
  95. package/dist/types/commands/scan/handle-list-scans.d.mts +2 -2
  96. package/dist/types/commands/scan/handle-list-scans.d.mts.map +1 -1
  97. package/dist/types/commands/scan/handle-scan-report.d.mts.map +1 -1
  98. package/dist/types/commands/scan/output-create-new-scan.d.mts +2 -2
  99. package/dist/types/commands/scan/output-create-new-scan.d.mts.map +1 -1
  100. package/dist/types/commands/scan/output-delete-scan.d.mts +2 -2
  101. package/dist/types/commands/scan/output-delete-scan.d.mts.map +1 -1
  102. package/dist/types/commands/scan/output-diff-scan.d.mts +2 -2
  103. package/dist/types/commands/scan/output-diff-scan.d.mts.map +1 -1
  104. package/dist/types/commands/scan/output-list-scans.d.mts +2 -2
  105. package/dist/types/commands/scan/output-list-scans.d.mts.map +1 -1
  106. package/dist/types/commands/scan/output-scan-metadata.d.mts +2 -2
  107. package/dist/types/commands/scan/output-scan-metadata.d.mts.map +1 -1
  108. package/dist/types/commands/scan/output-scan-report.d.mts +2 -2
  109. package/dist/types/commands/scan/output-scan-report.d.mts.map +1 -1
  110. package/dist/types/commands/scan/stream-scan.d.mts +6 -1
  111. package/dist/types/commands/scan/stream-scan.d.mts.map +1 -1
  112. package/dist/types/commands/scan/suggest-org-slug.d.mts.map +1 -1
  113. package/dist/types/commands/scan/suggest-repo-slug.d.mts +5 -1
  114. package/dist/types/commands/scan/suggest-repo-slug.d.mts.map +1 -1
  115. package/dist/types/utils/alert/severity.d.mts +2 -2
  116. package/dist/types/utils/alert/severity.d.mts.map +1 -1
  117. package/dist/types/utils/alerts-map.d.mts.map +1 -1
  118. package/dist/types/utils/api.d.mts +8 -3
  119. package/dist/types/utils/api.d.mts.map +1 -1
  120. package/dist/types/utils/coana.d.mts.map +1 -1
  121. package/dist/types/utils/glob.d.mts +4 -2
  122. package/dist/types/utils/glob.d.mts.map +1 -1
  123. package/dist/types/utils/path-resolve.d.mts +2 -2
  124. package/dist/types/utils/path-resolve.d.mts.map +1 -1
  125. package/dist/types/utils/sdk.d.mts +6 -1
  126. package/dist/types/utils/sdk.d.mts.map +1 -1
  127. package/dist/utils.js +208 -104
  128. package/dist/utils.js.map +1 -1
  129. package/dist/vendor.js +141 -61
  130. package/external/@socketsecurity/registry/external/@inquirer/select.js +14 -2
  131. package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +4 -4
  132. package/external/@socketsecurity/registry/external/libnpmpack.js +4 -4
  133. package/external/@socketsecurity/registry/external/npm-package-arg.js +4 -4
  134. package/external/@socketsecurity/registry/external/pacote.js +4 -4
  135. package/external/@socketsecurity/registry/external/validate-npm-package-name.js +4 -4
  136. package/external/@socketsecurity/registry/lib/regexps.js +1 -1
  137. package/external/@socketsecurity/registry/lib/spinner.js +15 -5
  138. package/package.json +12 -12
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;
@@ -14971,7 +14972,7 @@ var properties$2 = {
14971
14972
  }
14972
14973
  };
14973
14974
  var additionalProperties$1 = false;
14974
- var require$$9$1 = {
14975
+ var require$$9$2 = {
14975
14976
  $id: $id$1,
14976
14977
  description: description$1,
14977
14978
  type: type$3,
@@ -15829,7 +15830,7 @@ function requireCore$1() {
15829
15830
  const resolve_1 = requireResolve();
15830
15831
  const dataType_1 = requireDataType();
15831
15832
  const util_1 = requireUtil$3();
15832
- const $dataRefSchema = require$$9$1;
15833
+ const $dataRefSchema = require$$9$2;
15833
15834
  const uri_1 = requireUri();
15834
15835
  const defaultRegExp = (str, flags) => new RegExp(str, flags);
15835
15836
  defaultRegExp.code = "new RegExp";
@@ -35518,7 +35519,7 @@ var isInteractiveExports = /*@__PURE__*/ requireIsInteractive();
35518
35519
  var dist$e = {};
35519
35520
 
35520
35521
  var name$2 = "@socketsecurity/sdk";
35521
- var version$5 = "1.4.57";
35522
+ var version$5 = "1.4.64";
35522
35523
  var license = "MIT";
35523
35524
  var description = "SDK for the Socket API client";
35524
35525
  var author = {
@@ -35601,15 +35602,15 @@ var scripts = {
35601
35602
  "update:deps": "npx --yes npm-check-updates"
35602
35603
  };
35603
35604
  var dependencies = {
35604
- "@socketsecurity/registry": "1.0.239"
35605
+ "@socketsecurity/registry": "1.0.244"
35605
35606
  };
35606
35607
  var devDependencies = {
35607
35608
  "@biomejs/biome": "2.1.2",
35608
- "@dotenvx/dotenvx": "1.48.0",
35609
+ "@dotenvx/dotenvx": "1.48.3",
35609
35610
  "@eslint/compat": "1.3.1",
35610
35611
  "@eslint/js": "9.31.0",
35611
- "@types/node": "24.0.14",
35612
- "@typescript-eslint/parser": "8.37.0",
35612
+ "@types/node": "24.1.0",
35613
+ "@typescript-eslint/parser": "8.38.0",
35613
35614
  "@vitest/coverage-v8": "3.2.4",
35614
35615
  "del-cli": "6.0.0",
35615
35616
  eslint: "9.31.0",
@@ -35622,15 +35623,15 @@ var devDependencies = {
35622
35623
  globals: "16.3.0",
35623
35624
  "http2-wrapper": "2.2.1",
35624
35625
  husky: "9.1.7",
35625
- knip: "5.61.3",
35626
+ knip: "5.62.0",
35626
35627
  "lint-staged": "16.1.2",
35627
- nock: "14.0.5",
35628
+ nock: "14.0.6",
35628
35629
  "npm-run-all2": "8.0.4",
35629
35630
  "openapi-typescript": "6.7.6",
35630
- oxlint: "1.7.0",
35631
+ oxlint: "1.8.0",
35631
35632
  "type-coverage": "2.29.7",
35632
35633
  typescript: "~5.8.3",
35633
- "typescript-eslint": "8.37.0",
35634
+ "typescript-eslint": "8.38.0",
35634
35635
  vitest: "3.2.4"
35635
35636
  };
35636
35637
  var overrides = {
@@ -35643,7 +35644,7 @@ var files = [
35643
35644
  "dist/**",
35644
35645
  "types/**"
35645
35646
  ];
35646
- var require$$8$1 = {
35647
+ var require$$9$1 = {
35647
35648
  name: name$2,
35648
35649
  version: version$5,
35649
35650
  license: license,
@@ -35685,9 +35686,10 @@ function requireDist$e () {
35685
35686
  const node_path_1 = __importDefault(path$2);
35686
35687
  const node_readline_1 = __importDefault(require$$5$2);
35687
35688
  const abort_signal_1 = __importDefault(require$$6$2);
35688
- const promises_1 = require$$7$4;
35689
+ const objects_1 = require$$7$4;
35690
+ const promises_1 = require$$8$1;
35689
35691
  // @ts-ignore: Avoid TS import attributes error.
35690
- const package_json_1 = __importDefault(require$$8$1);
35692
+ const package_json_1 = __importDefault(require$$9$1);
35691
35693
  const DEFAULT_USER_AGENT = createUserAgentFromPkgJson(package_json_1.default);
35692
35694
  class ResponseError extends Error {
35693
35695
  response;
@@ -35885,6 +35887,14 @@ function requireDist$e () {
35885
35887
  return '(there was an error reading the body content)';
35886
35888
  }
35887
35889
  }
35890
+ function desc(value) {
35891
+ return {
35892
+ __proto__: null,
35893
+ configurable: true,
35894
+ value,
35895
+ writable: true
35896
+ };
35897
+ }
35888
35898
  function getHttpModule(baseUrl) {
35889
35899
  const { protocol } = new URL(baseUrl);
35890
35900
  return protocol === 'https:' ? node_https_1.default : node_http_1.default;
@@ -35934,6 +35944,38 @@ function requireDist$e () {
35934
35944
  const { statusCode } = response;
35935
35945
  return (typeof statusCode === 'number' && statusCode >= 200 && statusCode <= 299);
35936
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
+ }
35937
35979
  function resolveAbsPaths(filepaths, pathsRelativeTo) {
35938
35980
  const basePath = resolveBasePath(pathsRelativeTo);
35939
35981
  // Node's path.resolve will process path segments from right to left until
@@ -35981,20 +36023,20 @@ function requireDist$e () {
35981
36023
  signal: abort_signal_1.default
35982
36024
  };
35983
36025
  }
35984
- async #createBatchPurlRequest(queryParams, componentsObj) {
36026
+ async #createBatchPurlRequest(componentsObj, queryParams) {
35985
36027
  // Adds the first 'abort' listener to abortSignal.
35986
36028
  const req = getHttpModule(this.#baseUrl)
35987
- .request(`${this.#baseUrl}purl?${new URLSearchParams(queryParams ?? '')}`, {
36029
+ .request(`${this.#baseUrl}purl?${queryToSearchParams(queryParams)}`, {
35988
36030
  method: 'POST',
35989
36031
  ...this.#reqOptions
35990
36032
  })
35991
36033
  .end(JSON.stringify(componentsObj));
35992
36034
  return await getResponse(req);
35993
36035
  }
35994
- async *#createBatchPurlGenerator(queryParams, componentsObj) {
36036
+ async *#createBatchPurlGenerator(componentsObj, queryParams) {
35995
36037
  let res;
35996
36038
  try {
35997
- res = await (0, promises_1.pRetry)(() => this.#createBatchPurlRequest(queryParams, componentsObj), {
36039
+ res = await (0, promises_1.pRetry)(() => this.#createBatchPurlRequest(componentsObj, queryParams), {
35998
36040
  retries: 4,
35999
36041
  onRetryRethrow: true,
36000
36042
  onRetry(_attempt, error) {
@@ -36061,10 +36103,17 @@ function requireDist$e () {
36061
36103
  data: data
36062
36104
  };
36063
36105
  }
36064
- 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
+ }
36065
36114
  let res;
36066
36115
  try {
36067
- res = await this.#createBatchPurlRequest(queryParams, componentsObj);
36116
+ res = await this.#createBatchPurlRequest(componentsObj, queryParams);
36068
36117
  }
36069
36118
  catch (e) {
36070
36119
  return await this.#handleApiError(e);
@@ -36082,8 +36131,18 @@ function requireDist$e () {
36082
36131
  }
36083
36132
  return this.#handleApiSuccess(results);
36084
36133
  }
36085
- async *batchPackageStream(queryParams, componentsObj, options) {
36086
- 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 } = {
36087
36146
  __proto__: null,
36088
36147
  ...options
36089
36148
  };
@@ -36106,10 +36165,10 @@ function requireDist$e () {
36106
36165
  // No more work to do.
36107
36166
  return;
36108
36167
  }
36109
- const generator = this.#createBatchPurlGenerator(queryParams, {
36168
+ const generator = this.#createBatchPurlGenerator({
36110
36169
  // Chunk components.
36111
36170
  components: components.slice(index, index + chunkSize)
36112
- });
36171
+ }, queryParams);
36113
36172
  continueGen(generator);
36114
36173
  index += chunkSize;
36115
36174
  };
@@ -36150,38 +36209,56 @@ function requireDist$e () {
36150
36209
  node_events_1.default.setMaxListeners(oldAbortSignalMaxListeners, abort_signal_1.default);
36151
36210
  }
36152
36211
  }
36153
- 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
+ }
36154
36222
  const basePath = resolveBasePath(pathsRelativeTo);
36155
36223
  const absFilepaths = resolveAbsPaths(filepaths, basePath);
36156
36224
  try {
36157
- 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));
36158
36226
  return this.#handleApiSuccess(data);
36159
36227
  }
36160
36228
  catch (e) {
36161
36229
  return await this.#handleApiError(e);
36162
36230
  }
36163
36231
  }
36164
- 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
+ }
36165
36242
  const basePath = resolveBasePath(pathsRelativeTo);
36166
36243
  const absFilepaths = resolveAbsPaths(filepaths, basePath);
36167
36244
  try {
36168
- 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));
36169
36246
  return this.#handleApiSuccess(data);
36170
36247
  }
36171
36248
  catch (e) {
36172
36249
  return await this.#handleApiError(e);
36173
36250
  }
36174
36251
  }
36175
- async createOrgRepo(orgSlug, params) {
36252
+ async createOrgRepo(orgSlug, queryParams) {
36176
36253
  try {
36177
- 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));
36178
36255
  return this.#handleApiSuccess(data);
36179
36256
  }
36180
36257
  catch (e) {
36181
36258
  return await this.#handleApiError(e);
36182
36259
  }
36183
36260
  }
36184
- async createReportFromFilepaths(filepaths, pathsRelativeTo = '.', issueRules) {
36261
+ async createScanFromFilepaths(filepaths, pathsRelativeTo = '.', issueRules) {
36185
36262
  const basePath = resolveBasePath(pathsRelativeTo);
36186
36263
  const absFilepaths = resolveAbsPaths(filepaths, basePath);
36187
36264
  try {
@@ -36200,10 +36277,6 @@ function requireDist$e () {
36200
36277
  return await this.#handleApiError(e);
36201
36278
  }
36202
36279
  }
36203
- // Alias to preserve backwards compatibility.
36204
- async createReportFromFilePaths(filepaths, pathsRelativeTo = '.', issueRules) {
36205
- return await this.createReportFromFilepaths(filepaths, pathsRelativeTo, issueRules);
36206
- }
36207
36280
  async deleteOrgFullScan(orgSlug, fullScanId) {
36208
36281
  try {
36209
36282
  const data = await getResponseJson(await createDeleteRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/full-scans/${encodeURIComponent(fullScanId)}`, this.#reqOptions));
@@ -36224,7 +36297,7 @@ function requireDist$e () {
36224
36297
  }
36225
36298
  async getAuditLogEvents(orgSlug, queryParams) {
36226
36299
  try {
36227
- 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));
36228
36301
  return this.#handleApiSuccess(data);
36229
36302
  }
36230
36303
  catch (e) {
@@ -36281,7 +36354,7 @@ function requireDist$e () {
36281
36354
  }
36282
36355
  async getOrgFullScanList(orgSlug, queryParams) {
36283
36356
  try {
36284
- 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));
36285
36358
  return this.#handleApiSuccess(data);
36286
36359
  }
36287
36360
  catch (e) {
@@ -36319,7 +36392,7 @@ function requireDist$e () {
36319
36392
  }
36320
36393
  async getOrgRepoList(orgSlug, queryParams) {
36321
36394
  try {
36322
- 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));
36323
36396
  return this.#handleApiSuccess(data);
36324
36397
  }
36325
36398
  catch (e) {
@@ -36353,7 +36426,7 @@ function requireDist$e () {
36353
36426
  return await this.#handleApiError(e);
36354
36427
  }
36355
36428
  }
36356
- async getReport(id) {
36429
+ async getScan(id) {
36357
36430
  try {
36358
36431
  const data = await getResponseJson(await createGetRequest(this.#baseUrl, `report/view/${encodeURIComponent(id)}`, this.#reqOptions));
36359
36432
  return this.#handleApiSuccess(data);
@@ -36362,7 +36435,7 @@ function requireDist$e () {
36362
36435
  return await this.#handleApiError(e);
36363
36436
  }
36364
36437
  }
36365
- async getReportList() {
36438
+ async getScanList() {
36366
36439
  try {
36367
36440
  const data = await getResponseJson(await createGetRequest(this.#baseUrl, 'report/list', this.#reqOptions));
36368
36441
  return this.#handleApiSuccess(data);
@@ -36371,7 +36444,7 @@ function requireDist$e () {
36371
36444
  return await this.#handleApiError(e);
36372
36445
  }
36373
36446
  }
36374
- async getReportSupportedFiles() {
36447
+ async getSupportedScanFiles() {
36375
36448
  try {
36376
36449
  const data = await getResponseJson(await createGetRequest(this.#baseUrl, 'report/supported', this.#reqOptions));
36377
36450
  return this.#handleApiSuccess(data);
@@ -36380,7 +36453,7 @@ function requireDist$e () {
36380
36453
  return await this.#handleApiError(e);
36381
36454
  }
36382
36455
  }
36383
- async getScoreByNPMPackage(pkgName, version) {
36456
+ async getScoreByNpmPackage(pkgName, version) {
36384
36457
  try {
36385
36458
  const data = await getResponseJson(await createGetRequest(this.#baseUrl, `npm/${encodeURIComponent(pkgName)}/${encodeURIComponent(version)}/score`, this.#reqOptions));
36386
36459
  return this.#handleApiSuccess(data);
@@ -36398,39 +36471,46 @@ function requireDist$e () {
36398
36471
  return await this.#handleApiError(e);
36399
36472
  }
36400
36473
  }
36401
- async searchDependencies(params) {
36474
+ async searchDependencies(queryParams) {
36402
36475
  try {
36403
- 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));
36404
36477
  return this.#handleApiSuccess(data);
36405
36478
  }
36406
36479
  catch (e) {
36407
36480
  return await this.#handleApiError(e);
36408
36481
  }
36409
36482
  }
36410
- async updateOrgRepo(orgSlug, repoSlug, params) {
36483
+ async updateOrgRepo(orgSlug, repoSlug, queryParams) {
36411
36484
  try {
36412
- 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));
36413
36486
  return this.#handleApiSuccess(data);
36414
36487
  }
36415
36488
  catch (e) {
36416
36489
  return await this.#handleApiError(e);
36417
36490
  }
36418
36491
  }
36419
- }
36420
- dist$e.SocketSdk = SocketSdk;
36421
- function promiseWithResolvers() {
36422
- if (Promise.withResolvers) {
36423
- 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
+ }
36424
36502
  }
36425
- // This is what the above does but it's not available in node 20 (it is in node 22)
36426
- // @ts-ignore -- sigh.
36427
- const obj = {};
36428
- obj.promise = new Promise((resolver, reject) => {
36429
- obj.resolve = resolver;
36430
- obj.reject = reject;
36431
- });
36432
- return obj;
36433
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
+ });
36434
36514
 
36435
36515
  return dist$e;
36436
36516
  }
@@ -168580,5 +168660,5 @@ exports.terminalLinkExports = terminalLinkExports;
168580
168660
  exports.updater = updater$1;
168581
168661
  exports.yargsParser = yargsParser;
168582
168662
  exports.yoctocolorsCjsExports = yoctocolorsCjsExports;
168583
- //# debugId=17127725-c333-4fdd-a9b0-2ef9149d90d8
168663
+ //# debugId=9bf3c64f-db54-4de9-bf0a-7d81a00c9c65
168584
168664
  //# sourceMappingURL=vendor.js.map
@@ -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
 
@@ -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
 
@@ -4969,7 +4969,7 @@ function requireLib$1() {
4969
4969
  hasRequiredLib$1 = 1
4970
4970
  const { builtinModules: builtins } = require$$0$1
4971
4971
  const scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$')
4972
- const blacklist = ['node_modules', 'favicon.ico']
4972
+ const exclusionList = ['node_modules', 'favicon.ico']
4973
4973
  function validate(name) {
4974
4974
  const warnings = []
4975
4975
  const errors = []
@@ -4999,9 +4999,9 @@ function requireLib$1() {
4999
4999
  }
5000
5000
 
5001
5001
  // No funny business
5002
- blacklist.forEach(function (blacklistedName) {
5003
- if (name.toLowerCase() === blacklistedName) {
5004
- errors.push(blacklistedName + ' is a blacklisted name')
5002
+ exclusionList.forEach(function (excludedName) {
5003
+ if (name.toLowerCase() === excludedName) {
5004
+ errors.push(excludedName + ' is not a valid package name')
5005
5005
  }
5006
5006
  })
5007
5007
 
@@ -14381,7 +14381,7 @@ function requireLib$o() {
14381
14381
  hasRequiredLib$o = 1
14382
14382
  const { builtinModules: builtins } = require$$0$b
14383
14383
  const scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$')
14384
- const blacklist = ['node_modules', 'favicon.ico']
14384
+ const exclusionList = ['node_modules', 'favicon.ico']
14385
14385
  function validate(name) {
14386
14386
  const warnings = []
14387
14387
  const errors = []
@@ -14411,9 +14411,9 @@ function requireLib$o() {
14411
14411
  }
14412
14412
 
14413
14413
  // No funny business
14414
- blacklist.forEach(function (blacklistedName) {
14415
- if (name.toLowerCase() === blacklistedName) {
14416
- errors.push(blacklistedName + ' is a blacklisted name')
14414
+ exclusionList.forEach(function (excludedName) {
14415
+ if (name.toLowerCase() === excludedName) {
14416
+ errors.push(excludedName + ' is not a valid package name')
14417
14417
  }
14418
14418
  })
14419
14419
 
@@ -11,7 +11,7 @@ function requireLib() {
11
11
  hasRequiredLib = 1
12
12
  const { builtinModules: builtins } = require$$0
13
13
  const scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$')
14
- const blacklist = ['node_modules', 'favicon.ico']
14
+ const exclusionList = ['node_modules', 'favicon.ico']
15
15
  function validate(name) {
16
16
  const warnings = []
17
17
  const errors = []
@@ -41,9 +41,9 @@ function requireLib() {
41
41
  }
42
42
 
43
43
  // No funny business
44
- blacklist.forEach(function (blacklistedName) {
45
- if (name.toLowerCase() === blacklistedName) {
46
- errors.push(blacklistedName + ' is a blacklisted name')
44
+ exclusionList.forEach(function (excludedName) {
45
+ if (name.toLowerCase() === excludedName) {
46
+ errors.push(excludedName + ' is not a valid package name')
47
47
  }
48
48
  })
49
49
 
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- // Inlined "escape-string-regexp":
3
+ // Inlined escape-string-regexp:
4
4
  // https://socket.dev/npm/package/escape-string-regexp/overview/5.0.0
5
5
  // MIT License
6
6
  // Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
@@ -9,6 +9,15 @@ const ciSpinner = {
9
9
  interval: 2147483647
10
10
  }
11
11
 
12
+ function desc(value) {
13
+ return {
14
+ __proto__: null,
15
+ configurable: true,
16
+ value,
17
+ writable: true
18
+ }
19
+ }
20
+
12
21
  function normalizeText(value) {
13
22
  return typeof value === 'string' ? value.trimStart() : ''
14
23
  }
@@ -156,11 +165,12 @@ function Spinner(options) {
156
165
  }
157
166
  }
158
167
  // Add aliases.
159
- _Spinner.prototype.error = _Spinner.prototype.fail
160
- _Spinner.prototype.errorAndStop = _Spinner.prototype.failAndStop
161
- _Spinner.prototype.warning = _Spinner.prototype.warn
162
- _Spinner.prototype.warningAndStop = _Spinner.prototype.warnAndStop
163
-
168
+ Object.defineProperties(_Spinner.prototype, {
169
+ error: desc(_Spinner.prototype.fail),
170
+ errorAndStop: desc(_Spinner.prototype.failAndStop),
171
+ warning: desc(_Spinner.prototype.warn),
172
+ warningAndStop: desc(_Spinner.prototype.warnAndStop)
173
+ })
164
174
  _defaultSpinner = ENV.CI ? ciSpinner : undefined
165
175
  }
166
176
  return new _Spinner({