mobbdev 1.0.11 → 1.0.12

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 (2) hide show
  1. package/dist/index.mjs +20 -0
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -4599,6 +4599,10 @@ var AdoSCMLib = class extends SCMLib {
4599
4599
  prNumber
4600
4600
  });
4601
4601
  }
4602
+ async getPrId(prUrl) {
4603
+ const match = prUrl.match(/\/pullrequest\/(\d+)/);
4604
+ return match?.[1] || "";
4605
+ }
4602
4606
  async getCommitUrl(commitId) {
4603
4607
  this._validateUrl();
4604
4608
  const adoSdk = await this.getAdoSdk();
@@ -5124,6 +5128,10 @@ var BitbucketSCMLib = class extends SCMLib {
5124
5128
  `https://bitbucket.org/${workspace}/${repoSlug}/pull-requests/${prNumber}`
5125
5129
  );
5126
5130
  }
5131
+ async getPrId(prUrl) {
5132
+ const match = prUrl.match(/\/pull-requests\/(\d+)/);
5133
+ return match?.[1] || "";
5134
+ }
5127
5135
  getCommitUrl(commitId) {
5128
5136
  this._validateUrl();
5129
5137
  const { repoSlug, workspace } = parseBitbucketOrganizationAndRepo(this.url);
@@ -5326,6 +5334,10 @@ var GithubSCMLib = class extends SCMLib {
5326
5334
  });
5327
5335
  return getPrRes.data.html_url;
5328
5336
  }
5337
+ async getPrId(prUrl) {
5338
+ const match = prUrl.match(/\/pull\/(\d+)/);
5339
+ return match?.[1] || "";
5340
+ }
5329
5341
  async getCommitUrl(commitId) {
5330
5342
  this._validateAccessTokenAndUrl();
5331
5343
  const { owner, repo } = parseGithubOwnerAndRepo(this.url);
@@ -5888,6 +5900,10 @@ var GitlabSCMLib = class extends SCMLib {
5888
5900
  });
5889
5901
  return res.web_url;
5890
5902
  }
5903
+ async getPrId(prUrl) {
5904
+ const match = prUrl.match(/\/merge_requests\/(\d+)/);
5905
+ return match?.[1] || "";
5906
+ }
5891
5907
  async getCommitUrl(commitId) {
5892
5908
  this._validateAccessTokenAndUrl();
5893
5909
  const res = await getGitlabCommitUrl({
@@ -5971,6 +5987,10 @@ var StubSCMLib = class extends SCMLib {
5971
5987
  console.error("getPr() not implemented");
5972
5988
  throw new Error("getPr() not implemented");
5973
5989
  }
5990
+ async getPrId(_prUrl) {
5991
+ console.error("getPrId() not implemented");
5992
+ throw new Error("getPrId() not implemented");
5993
+ }
5974
5994
  async getCommitUrl(_commitId) {
5975
5995
  console.error("getCommitUrl() not implemented");
5976
5996
  throw new Error("getCommitUrl() not implemented");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobbdev",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Automated secure code remediation tool",
5
5
  "repository": "git+https://github.com/mobb-dev/bugsy.git",
6
6
  "main": "dist/index.js",