socket 1.0.52 → 1.0.54

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
@@ -3105,11 +3105,15 @@ function getOctokit() {
3105
3105
  if (!SOCKET_CLI_GITHUB_TOKEN) {
3106
3106
  debug.debugFn('notice', 'miss: SOCKET_CLI_GITHUB_TOKEN env var');
3107
3107
  }
3108
- _octokit = new vendor.Octokit({
3108
+ const octokitOptions = {
3109
3109
  auth: SOCKET_CLI_GITHUB_TOKEN,
3110
3110
  // Lazily access constants.ENV.GITHUB_API_URL.
3111
3111
  baseUrl: constants.ENV.GITHUB_API_URL
3112
+ };
3113
+ debug.debugDir('inspect', {
3114
+ octokitOptions
3112
3115
  });
3116
+ _octokit = new vendor.Octokit(octokitOptions);
3113
3117
  }
3114
3118
  return _octokit;
3115
3119
  }
@@ -3429,14 +3433,18 @@ async function openPr(owner, repo, branch, purl, newVersion, options) {
3429
3433
  const purlObj = utils.getPurlObject(purl);
3430
3434
  const octokit = getOctokit();
3431
3435
  try {
3432
- return await octokit.pulls.create({
3436
+ const octokitPullsCreateParams = {
3433
3437
  owner,
3434
3438
  repo,
3435
3439
  title: getSocketPullRequestTitle(purlObj, newVersion, workspace),
3436
3440
  head: branch,
3437
3441
  base: baseBranch,
3438
3442
  body: getSocketPullRequestBody(purlObj, newVersion, workspace)
3443
+ };
3444
+ debug.debugDir('inspect', {
3445
+ octokitPullsCreateParams
3439
3446
  });
3447
+ return await octokit.pulls.create(octokitPullsCreateParams);
3440
3448
  } catch (e) {
3441
3449
  let message = `Failed to open pull request`;
3442
3450
  const errors = e instanceof vendor.RequestError ? e.response?.data?.['errors'] : undefined;
@@ -11296,7 +11304,9 @@ async function downloadManifestFile({
11296
11304
  }) {
11297
11305
  debug.debugFn('notice', 'request: download url from GitHub');
11298
11306
  const fileUrl = `${repoApiUrl}/contents/${file}?ref=${defaultBranch}`;
11299
- debug.debugFn('inspect', 'url: file', fileUrl);
11307
+ debug.debugDir('inspect', {
11308
+ fileUrl
11309
+ });
11300
11310
  const downloadUrlResponse = await fetch(fileUrl, {
11301
11311
  method: 'GET',
11302
11312
  headers: {
@@ -11379,7 +11389,7 @@ async function streamDownloadWithFetch(localPath, downloadUrl) {
11379
11389
  };
11380
11390
  } catch (error) {
11381
11391
  logger.logger.fail('An error was thrown while trying to download a manifest file... url:', downloadUrl);
11382
- debug.debugFn('inspect', {
11392
+ debug.debugDir('inspect', {
11383
11393
  error
11384
11394
  });
11385
11395
 
@@ -11514,7 +11524,9 @@ async function getRepoDetails({
11514
11524
  repoSlug
11515
11525
  }) {
11516
11526
  const repoApiUrl = `${githubApiUrl}/repos/${orgGithub}/${repoSlug}`;
11517
- debug.debugFn('inspect', 'url: repo', repoApiUrl);
11527
+ debug.debugDir('inspect', {
11528
+ repoApiUrl
11529
+ });
11518
11530
  const repoDetailsResponse = await fetch(repoApiUrl, {
11519
11531
  method: 'GET',
11520
11532
  headers: {
@@ -11599,7 +11611,11 @@ async function getRepoBranchTree({
11599
11611
  };
11600
11612
  }
11601
11613
  if (!treeDetails.tree || !Array.isArray(treeDetails.tree)) {
11602
- debug.debugFn('inspect', 'treeDetails.tree:', treeDetails.tree);
11614
+ debug.debugDir('inspect', {
11615
+ treeDetails: {
11616
+ tree: treeDetails.tree
11617
+ }
11618
+ });
11603
11619
  return {
11604
11620
  ok: false,
11605
11621
  message: `Tree response for default branch ${defaultBranch} for ${orgGithub}/${repoSlug} was not a list`
@@ -14140,5 +14156,5 @@ void (async () => {
14140
14156
  await utils.captureException(e);
14141
14157
  }
14142
14158
  })();
14143
- //# debugId=404eb6bb-65e8-45cb-9cb8-b36c31796d71
14159
+ //# debugId=de2f6428-1c58-4a06-9819-55274bda8df0
14144
14160
  //# sourceMappingURL=cli.js.map