mobbdev 1.0.53 → 1.0.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 (2) hide show
  1. package/dist/index.mjs +189 -267
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -25,7 +25,7 @@ import chalk10 from "chalk";
25
25
  import yargs from "yargs/yargs";
26
26
 
27
27
  // src/args/commands/analyze.ts
28
- import fs5 from "node:fs";
28
+ import fs4 from "node:fs";
29
29
 
30
30
  // src/commands/index.ts
31
31
  import crypto from "node:crypto";
@@ -123,6 +123,7 @@ var IssueType_Enum = /* @__PURE__ */ ((IssueType_Enum2) => {
123
123
  IssueType_Enum2["DefaultRightsInObjDefinition"] = "DEFAULT_RIGHTS_IN_OBJ_DEFINITION";
124
124
  IssueType_Enum2["DeprecatedFunction"] = "DEPRECATED_FUNCTION";
125
125
  IssueType_Enum2["DosStringBuilder"] = "DOS_STRING_BUILDER";
126
+ IssueType_Enum2["DuplicatedStrings"] = "DUPLICATED_STRINGS";
126
127
  IssueType_Enum2["ErroneousStringCompare"] = "ERRONEOUS_STRING_COMPARE";
127
128
  IssueType_Enum2["ErrorCondtionWithoutAction"] = "ERROR_CONDTION_WITHOUT_ACTION";
128
129
  IssueType_Enum2["FrameableLoginPage"] = "FRAMEABLE_LOGIN_PAGE";
@@ -919,6 +920,10 @@ var BaseIssuePartsZ = z4.object({
919
920
  createdAt: z4.string(),
920
921
  parsedSeverity: ParsedSeverityZ,
921
922
  category: ValidCategoriesZ,
923
+ extraData: z4.object({
924
+ missing_files: z4.string().array().nullish(),
925
+ error_files: z4.string().array().nullish()
926
+ }),
922
927
  vulnerabilityReportIssueTags: z4.array(
923
928
  z4.object({
924
929
  tag: z4.nativeEnum(Vulnerability_Report_Issue_Tag_Enum)
@@ -1102,7 +1107,8 @@ var issueTypeMap = {
1102
1107
  ["FRAMEABLE_LOGIN_PAGE" /* FrameableLoginPage */]: "Frameable Login Page",
1103
1108
  ["USE_OF_HARD_CODED_CRYPTOGRAPHIC_KEY" /* UseOfHardCodedCryptographicKey */]: "Use of Hardcoded Cryptographic Key",
1104
1109
  ["MISSING_SSL_MINVERSION" /* MissingSslMinversion */]: "Missing SSL MinVersion",
1105
- ["WEBSOCKET_MISSING_ORIGIN_CHECK" /* WebsocketMissingOriginCheck */]: "Missing Websocket Origin Check"
1110
+ ["WEBSOCKET_MISSING_ORIGIN_CHECK" /* WebsocketMissingOriginCheck */]: "Missing Websocket Origin Check",
1111
+ ["DUPLICATED_STRINGS" /* DuplicatedStrings */]: "String Literals Should not Be Duplicated"
1106
1112
  };
1107
1113
  var issueTypeZ = z5.nativeEnum(IssueType_Enum);
1108
1114
  var getIssueTypeFriendlyString = (issueType) => {
@@ -1605,9 +1611,9 @@ var progressMassages = {
1605
1611
  var VUL_REPORT_DIGEST_TIMEOUT_MS = 1e3 * 60 * 30;
1606
1612
 
1607
1613
  // src/features/analysis/index.ts
1608
- import fs4 from "node:fs";
1614
+ import fs3 from "node:fs";
1609
1615
  import fsPromises from "node:fs/promises";
1610
- import path7 from "node:path";
1616
+ import path6 from "node:path";
1611
1617
  import { env as env2 } from "node:process";
1612
1618
  import { pipeline } from "node:stream/promises";
1613
1619
 
@@ -1721,8 +1727,8 @@ import extract from "extract-zip";
1721
1727
  import { createSpinner as createSpinner4 } from "nanospinner";
1722
1728
  import fetch4 from "node-fetch";
1723
1729
  import open2 from "open";
1724
- import tmp2 from "tmp";
1725
- import { z as z31 } from "zod";
1730
+ import tmp from "tmp";
1731
+ import { z as z29 } from "zod";
1726
1732
 
1727
1733
  // src/features/analysis/add_fix_comments_for_pr/add_fix_comments_for_pr.ts
1728
1734
  import Debug8 from "debug";
@@ -2007,7 +2013,8 @@ var fixDetailsData = {
2007
2013
  ["FRAMEABLE_LOGIN_PAGE" /* FrameableLoginPage */]: void 0,
2008
2014
  ["USE_OF_HARD_CODED_CRYPTOGRAPHIC_KEY" /* UseOfHardCodedCryptographicKey */]: void 0,
2009
2015
  ["MISSING_SSL_MINVERSION" /* MissingSslMinversion */]: void 0,
2010
- ["WEBSOCKET_MISSING_ORIGIN_CHECK" /* WebsocketMissingOriginCheck */]: void 0
2016
+ ["WEBSOCKET_MISSING_ORIGIN_CHECK" /* WebsocketMissingOriginCheck */]: void 0,
2017
+ ["DUPLICATED_STRINGS" /* DuplicatedStrings */]: void 0
2011
2018
  };
2012
2019
 
2013
2020
  // src/features/analysis/scm/shared/src/commitDescriptionMarkup.ts
@@ -2655,6 +2662,15 @@ var confusingNaming = {
2655
2662
  }
2656
2663
  };
2657
2664
 
2665
+ // src/features/analysis/scm/shared/src/storedQuestionData/java/duplicatedStrings.ts
2666
+ var duplicatedStrings = {
2667
+ constantName: {
2668
+ content: () => "New constant name",
2669
+ description: () => "",
2670
+ guidance: () => ""
2671
+ }
2672
+ };
2673
+
2658
2674
  // src/features/analysis/scm/shared/src/storedQuestionData/java/erroneousStringCompare.ts
2659
2675
  var erroneousStringCompare = {
2660
2676
  javaVersionGreaterOrEqual17: {
@@ -3051,7 +3067,8 @@ var vulnerabilities11 = {
3051
3067
  ["INSECURE_COOKIE" /* InsecureCookie */]: insecureCookie2,
3052
3068
  ["TRUST_BOUNDARY_VIOLATION" /* TrustBoundaryViolation */]: trustBoundaryViolation2,
3053
3069
  ["LEFTOVER_DEBUG_CODE" /* LeftoverDebugCode */]: leftoverDebugCode,
3054
- ["ERRONEOUS_STRING_COMPARE" /* ErroneousStringCompare */]: erroneousStringCompare
3070
+ ["ERRONEOUS_STRING_COMPARE" /* ErroneousStringCompare */]: erroneousStringCompare,
3071
+ ["DUPLICATED_STRINGS" /* DuplicatedStrings */]: duplicatedStrings
3055
3072
  };
3056
3073
  var java_default2 = vulnerabilities11;
3057
3074
 
@@ -3868,17 +3885,9 @@ import { z as z15 } from "zod";
3868
3885
  var EnvVariablesZod = z15.object({
3869
3886
  GITLAB_API_TOKEN: z15.string().optional(),
3870
3887
  GITHUB_API_TOKEN: z15.string().optional(),
3871
- GIT_COMMITTER_EMAIL: z15.string().optional(),
3872
- GIT_COMMITTER_NAME: z15.string().optional(),
3873
3888
  GIT_PROXY_HOST: z15.string()
3874
3889
  });
3875
- var {
3876
- GITLAB_API_TOKEN,
3877
- GITHUB_API_TOKEN,
3878
- GIT_PROXY_HOST,
3879
- GIT_COMMITTER_EMAIL,
3880
- GIT_COMMITTER_NAME
3881
- } = EnvVariablesZod.parse(process.env);
3890
+ var { GITLAB_API_TOKEN, GITHUB_API_TOKEN, GIT_PROXY_HOST } = EnvVariablesZod.parse(process.env);
3882
3891
 
3883
3892
  // src/features/analysis/scm/utils/index.ts
3884
3893
  import { z as z16 } from "zod";
@@ -4429,7 +4438,7 @@ async function getAdoSdk(params) {
4429
4438
  const url = new URL(repoUrl);
4430
4439
  const origin2 = url.origin.toLowerCase().endsWith(".visualstudio.com") ? DEFUALT_ADO_ORIGIN : url.origin.toLowerCase();
4431
4440
  const params2 = `path=/&versionDescriptor[versionOptions]=0&versionDescriptor[versionType]=commit&versionDescriptor[version]=${branch}&resolveLfs=true&$format=zip&api-version=5.0&download=true`;
4432
- const path9 = [
4441
+ const path8 = [
4433
4442
  prefixPath,
4434
4443
  owner,
4435
4444
  projectName,
@@ -4440,7 +4449,7 @@ async function getAdoSdk(params) {
4440
4449
  "items",
4441
4450
  "items"
4442
4451
  ].filter(Boolean).join("/");
4443
- return new URL(`${path9}?${params2}`, origin2).toString();
4452
+ return new URL(`${path8}?${params2}`, origin2).toString();
4444
4453
  },
4445
4454
  async getAdoBranchList({ repoUrl }) {
4446
4455
  try {
@@ -4664,112 +4673,7 @@ async function getAdoRepoList({
4664
4673
  import { setTimeout as setTimeout2 } from "node:timers/promises";
4665
4674
 
4666
4675
  // src/features/analysis/scm/scmSubmit/index.ts
4667
- import fs2 from "node:fs/promises";
4668
- import parseDiff from "parse-diff";
4669
- import path4 from "path";
4670
4676
  import { simpleGit } from "simple-git";
4671
- import tmp from "tmp";
4672
- import { z as z20 } from "zod";
4673
-
4674
- // src/features/analysis/scm/scmSubmit/types.ts
4675
- import { z as z19 } from "zod";
4676
- var BaseSubmitToScmMessageZ = z19.object({
4677
- submitFixRequestId: z19.string().uuid(),
4678
- fixes: z19.array(
4679
- z19.object({
4680
- fixId: z19.string().uuid(),
4681
- patchesOriginalEncodingBase64: z19.array(z19.string()),
4682
- patches: z19.array(z19.string())
4683
- })
4684
- ),
4685
- commitHash: z19.string(),
4686
- repoUrl: z19.string(),
4687
- mobbUserEmail: z19.string(),
4688
- extraHeaders: z19.record(z19.string(), z19.string()).default({})
4689
- });
4690
- var submitToScmMessageType = {
4691
- commitToSameBranch: "commitToSameBranch",
4692
- submitFixesForDifferentBranch: "submitFixesForDifferentBranch"
4693
- };
4694
- var CommitToSameBranchParamsZ = BaseSubmitToScmMessageZ.merge(
4695
- z19.object({
4696
- type: z19.literal(submitToScmMessageType.commitToSameBranch),
4697
- branch: z19.string(),
4698
- commitMessages: z19.array(z19.string()),
4699
- commitDescriptions: z19.array(z19.string().nullish()),
4700
- githubCommentId: z19.number().nullish(),
4701
- prId: z19.number().nullish()
4702
- })
4703
- );
4704
- var SubmitFixesToDifferentBranchParamsZ = z19.object({
4705
- type: z19.literal(submitToScmMessageType.submitFixesForDifferentBranch),
4706
- submitBranch: z19.string(),
4707
- baseBranch: z19.string()
4708
- }).merge(BaseSubmitToScmMessageZ);
4709
- var SubmitFixesMessageZ = z19.union([
4710
- CommitToSameBranchParamsZ,
4711
- SubmitFixesToDifferentBranchParamsZ
4712
- ]);
4713
- var FixResponseArrayZ = z19.array(
4714
- z19.object({
4715
- fixId: z19.string().uuid()
4716
- })
4717
- );
4718
- var SubmitFixesBaseResponseMessageZ = z19.object({
4719
- mobbUserEmail: z19.string(),
4720
- submitFixRequestId: z19.string().uuid(),
4721
- submitBranches: z19.array(
4722
- z19.object({
4723
- branchName: z19.string(),
4724
- fixes: FixResponseArrayZ
4725
- })
4726
- ),
4727
- error: z19.object({
4728
- type: z19.enum([
4729
- "InitialRepoAccessError",
4730
- "PushBranchError",
4731
- "AllFixesConflictWithTargetBranchError",
4732
- "InternalFixConflictError",
4733
- "UnknownError"
4734
- ]),
4735
- info: z19.object({
4736
- message: z19.string(),
4737
- pushBranchName: z19.string().optional()
4738
- })
4739
- }).optional()
4740
- });
4741
- var authorSchemaZ = z19.object({
4742
- email: z19.string(),
4743
- name: z19.string()
4744
- }).nullable();
4745
- var summarySchemaZ = z19.object({
4746
- changes: z19.number(),
4747
- insertions: z19.number(),
4748
- deletions: z19.number()
4749
- });
4750
- var GitCommitZ = z19.object({
4751
- author: authorSchemaZ,
4752
- branch: z19.string(),
4753
- commit: z19.string(),
4754
- root: z19.boolean(),
4755
- summary: summarySchemaZ
4756
- });
4757
- var SubmitFixesToSameBranchResponseMessageZ = z19.object({
4758
- type: z19.literal(submitToScmMessageType.commitToSameBranch),
4759
- githubCommentId: z19.number().nullish(),
4760
- commits: z19.array(GitCommitZ),
4761
- prId: z19.number().nullish()
4762
- }).merge(SubmitFixesBaseResponseMessageZ);
4763
- var SubmitFixesToDifferentBranchResponseMessageZ = z19.object({
4764
- type: z19.literal(submitToScmMessageType.submitFixesForDifferentBranch),
4765
- githubCommentId: z19.number().optional()
4766
- }).merge(SubmitFixesBaseResponseMessageZ);
4767
- var SubmitFixesResponseMessageZ = z19.discriminatedUnion("type", [
4768
- SubmitFixesToSameBranchResponseMessageZ,
4769
- SubmitFixesToDifferentBranchResponseMessageZ
4770
- ]);
4771
-
4772
- // src/features/analysis/scm/scmSubmit/index.ts
4773
4677
  var isValidBranchName = async (branchName) => {
4774
4678
  const git = simpleGit();
4775
4679
  try {
@@ -4782,12 +4686,6 @@ var isValidBranchName = async (branchName) => {
4782
4686
  return false;
4783
4687
  }
4784
4688
  };
4785
- var FixesZ = z20.array(
4786
- z20.object({
4787
- fixId: z20.string(),
4788
- patchesOriginalEncodingBase64: z20.array(z20.string())
4789
- })
4790
- ).nonempty();
4791
4689
 
4792
4690
  // src/features/analysis/scm/scm.ts
4793
4691
  var SCMLib = class {
@@ -5049,33 +4947,33 @@ import querystring2 from "node:querystring";
5049
4947
  import * as bitbucketPkgNode from "bitbucket";
5050
4948
  import bitbucketPkg from "bitbucket";
5051
4949
  import Debug3 from "debug";
5052
- import { z as z22 } from "zod";
4950
+ import { z as z20 } from "zod";
5053
4951
 
5054
4952
  // src/features/analysis/scm/bitbucket/validation.ts
5055
- import { z as z21 } from "zod";
5056
- var BitbucketAuthResultZ = z21.object({
5057
- access_token: z21.string(),
5058
- token_type: z21.string(),
5059
- refresh_token: z21.string()
4953
+ import { z as z19 } from "zod";
4954
+ var BitbucketAuthResultZ = z19.object({
4955
+ access_token: z19.string(),
4956
+ token_type: z19.string(),
4957
+ refresh_token: z19.string()
5060
4958
  });
5061
4959
 
5062
4960
  // src/features/analysis/scm/bitbucket/bitbucket.ts
5063
4961
  var debug3 = Debug3("scm:bitbucket");
5064
4962
  var BITBUCKET_HOSTNAME = "bitbucket.org";
5065
- var TokenExpiredErrorZ = z22.object({
5066
- status: z22.number(),
5067
- error: z22.object({
5068
- type: z22.string(),
5069
- error: z22.object({
5070
- message: z22.string()
4963
+ var TokenExpiredErrorZ = z20.object({
4964
+ status: z20.number(),
4965
+ error: z20.object({
4966
+ type: z20.string(),
4967
+ error: z20.object({
4968
+ message: z20.string()
5071
4969
  })
5072
4970
  })
5073
4971
  });
5074
4972
  var BITBUCKET_ACCESS_TOKEN_URL = `https://${BITBUCKET_HOSTNAME}/site/oauth2/access_token`;
5075
- var BitbucketParseResultZ = z22.object({
5076
- organization: z22.string(),
5077
- repoName: z22.string(),
5078
- hostname: z22.literal(BITBUCKET_HOSTNAME)
4973
+ var BitbucketParseResultZ = z20.object({
4974
+ organization: z20.string(),
4975
+ repoName: z20.string(),
4976
+ hostname: z20.literal(BITBUCKET_HOSTNAME)
5079
4977
  });
5080
4978
  function parseBitbucketOrganizationAndRepo(bitbucketUrl) {
5081
4979
  const parsedGitHubUrl = normalizeUrl(bitbucketUrl);
@@ -5136,7 +5034,7 @@ function getBitbucketSdk(params) {
5136
5034
  if (!res.data.values) {
5137
5035
  return [];
5138
5036
  }
5139
- return res.data.values.filter((branch) => !!branch.name).map((branch) => z22.string().parse(branch.name));
5037
+ return res.data.values.filter((branch) => !!branch.name).map((branch) => z20.string().parse(branch.name));
5140
5038
  },
5141
5039
  async getIsUserCollaborator(params2) {
5142
5040
  const { repoUrl } = params2;
@@ -5251,7 +5149,7 @@ function getBitbucketSdk(params) {
5251
5149
  return GetRefererenceResultZ.parse({
5252
5150
  sha: tagRes.data.target?.hash,
5253
5151
  type: "TAG" /* TAG */,
5254
- date: new Date(z22.string().parse(tagRes.data.target?.date))
5152
+ date: new Date(z20.string().parse(tagRes.data.target?.date))
5255
5153
  });
5256
5154
  },
5257
5155
  async getBranchRef(params2) {
@@ -5259,7 +5157,7 @@ function getBitbucketSdk(params) {
5259
5157
  return GetRefererenceResultZ.parse({
5260
5158
  sha: getBranchRes.target?.hash,
5261
5159
  type: "BRANCH" /* BRANCH */,
5262
- date: new Date(z22.string().parse(getBranchRes.target?.date))
5160
+ date: new Date(z20.string().parse(getBranchRes.target?.date))
5263
5161
  });
5264
5162
  },
5265
5163
  async getCommitRef(params2) {
@@ -5267,13 +5165,13 @@ function getBitbucketSdk(params) {
5267
5165
  return GetRefererenceResultZ.parse({
5268
5166
  sha: getCommitRes.hash,
5269
5167
  type: "COMMIT" /* COMMIT */,
5270
- date: new Date(z22.string().parse(getCommitRes.date))
5168
+ date: new Date(z20.string().parse(getCommitRes.date))
5271
5169
  });
5272
5170
  },
5273
5171
  async getDownloadUrl({ url, sha }) {
5274
5172
  this.getReferenceData({ ref: sha, url });
5275
5173
  const repoRes = await this.getRepo({ repoUrl: url });
5276
- const parsedRepoUrl = z22.string().url().parse(repoRes.links?.html?.href);
5174
+ const parsedRepoUrl = z20.string().url().parse(repoRes.links?.html?.href);
5277
5175
  return `${parsedRepoUrl}/get/${sha}.zip`;
5278
5176
  },
5279
5177
  async getPullRequest(params2) {
@@ -5338,7 +5236,7 @@ async function validateBitbucketParams(params) {
5338
5236
  }
5339
5237
  async function getUsersworkspacesSlugs(bitbucketClient) {
5340
5238
  const res = await bitbucketClient.workspaces.getWorkspaces({});
5341
- return res.data.values?.map((v) => z22.string().parse(v.slug));
5239
+ return res.data.values?.map((v) => z20.string().parse(v.slug));
5342
5240
  }
5343
5241
  async function getllUsersrepositories(bitbucketClient) {
5344
5242
  const userWorspacesSlugs = await getUsersworkspacesSlugs(bitbucketClient);
@@ -5366,10 +5264,10 @@ async function getRepositoriesByWorkspace(bitbucketClient, { workspaceSlug }) {
5366
5264
 
5367
5265
  // src/features/analysis/scm/bitbucket/BitbucketSCMLib.ts
5368
5266
  import { setTimeout as setTimeout3 } from "node:timers/promises";
5369
- import { z as z23 } from "zod";
5267
+ import { z as z21 } from "zod";
5370
5268
  function getUserAndPassword(token) {
5371
5269
  const [username, password] = token.split(":");
5372
- const safePasswordAndUsername = z23.object({ username: z23.string(), password: z23.string() }).parse({ username, password });
5270
+ const safePasswordAndUsername = z21.object({ username: z21.string(), password: z21.string() }).parse({ username, password });
5373
5271
  return {
5374
5272
  username: safePasswordAndUsername.username,
5375
5273
  password: safePasswordAndUsername.password
@@ -5441,7 +5339,7 @@ var BitbucketSCMLib = class extends SCMLib {
5441
5339
  return { username, password, authType };
5442
5340
  }
5443
5341
  case "token": {
5444
- return { authType, token: z23.string().parse(this.accessToken) };
5342
+ return { authType, token: z21.string().parse(this.accessToken) };
5445
5343
  }
5446
5344
  case "public":
5447
5345
  return { authType };
@@ -5455,7 +5353,7 @@ var BitbucketSCMLib = class extends SCMLib {
5455
5353
  ...params,
5456
5354
  repoUrl: this.url
5457
5355
  });
5458
- return String(z23.number().parse(pullRequestRes.id));
5356
+ return String(z21.number().parse(pullRequestRes.id));
5459
5357
  } catch (e) {
5460
5358
  console.warn(
5461
5359
  `error creating pull request for BB. Try number ${i + 1}`,
@@ -5540,7 +5438,7 @@ var BitbucketSCMLib = class extends SCMLib {
5540
5438
  async getUsername() {
5541
5439
  this._validateAccessToken();
5542
5440
  const res = await this.bitbucketSdk.getUser();
5543
- return z23.string().parse(res.username);
5441
+ return z21.string().parse(res.username);
5544
5442
  }
5545
5443
  async getSubmitRequestStatus(_scmSubmitRequestId) {
5546
5444
  this._validateAccessTokenAndUrl();
@@ -5569,7 +5467,7 @@ var BitbucketSCMLib = class extends SCMLib {
5569
5467
  async getRepoDefaultBranch() {
5570
5468
  this._validateUrl();
5571
5469
  const repoRes = await this.bitbucketSdk.getRepo({ repoUrl: this.url });
5572
- return z23.string().parse(repoRes.mainbranch?.name);
5470
+ return z21.string().parse(repoRes.mainbranch?.name);
5573
5471
  }
5574
5472
  getSubmitRequestUrl(submitRequestId) {
5575
5473
  this._validateUrl();
@@ -5600,7 +5498,7 @@ var BitbucketSCMLib = class extends SCMLib {
5600
5498
  };
5601
5499
 
5602
5500
  // src/features/analysis/scm/github/GithubSCMLib.ts
5603
- import { z as z24 } from "zod";
5501
+ import { z as z22 } from "zod";
5604
5502
  var GithubSCMLib = class extends SCMLib {
5605
5503
  // we don't always need a url, what's important is that we have an access token
5606
5504
  constructor(url, accessToken, scmOrg) {
@@ -5701,7 +5599,7 @@ var GithubSCMLib = class extends SCMLib {
5701
5599
  owner,
5702
5600
  repo
5703
5601
  });
5704
- return z24.string().parse(prRes.data);
5602
+ return z22.string().parse(prRes.data);
5705
5603
  }
5706
5604
  async getRepoList(_scmOrg) {
5707
5605
  this._validateAccessToken();
@@ -5765,11 +5663,11 @@ var GithubSCMLib = class extends SCMLib {
5765
5663
  markdownComment: comment
5766
5664
  });
5767
5665
  }
5768
- async getRepoBlameRanges(ref, path9) {
5666
+ async getRepoBlameRanges(ref, path8) {
5769
5667
  this._validateUrl();
5770
5668
  return await this.githubSdk.getGithubBlameRanges({
5771
5669
  ref,
5772
- path: path9,
5670
+ path: path8,
5773
5671
  gitHubUrl: this.url
5774
5672
  });
5775
5673
  }
@@ -5863,11 +5761,11 @@ import {
5863
5761
  } from "undici";
5864
5762
 
5865
5763
  // src/features/analysis/scm/gitlab/types.ts
5866
- import { z as z25 } from "zod";
5867
- var GitlabAuthResultZ = z25.object({
5868
- access_token: z25.string(),
5869
- token_type: z25.string(),
5870
- refresh_token: z25.string()
5764
+ import { z as z23 } from "zod";
5765
+ var GitlabAuthResultZ = z23.object({
5766
+ access_token: z23.string(),
5767
+ token_type: z23.string(),
5768
+ refresh_token: z23.string()
5871
5769
  });
5872
5770
 
5873
5771
  // src/features/analysis/scm/gitlab/gitlab.ts
@@ -6165,13 +6063,13 @@ function parseGitlabOwnerAndRepo(gitlabUrl) {
6165
6063
  const { organization, repoName, projectPath } = parsingResult;
6166
6064
  return { owner: organization, repo: repoName, projectPath };
6167
6065
  }
6168
- async function getGitlabBlameRanges({ ref, gitlabUrl, path: path9 }, options) {
6066
+ async function getGitlabBlameRanges({ ref, gitlabUrl, path: path8 }, options) {
6169
6067
  const { projectPath } = parseGitlabOwnerAndRepo(gitlabUrl);
6170
6068
  const api2 = getGitBeaker({
6171
6069
  url: gitlabUrl,
6172
6070
  gitlabAuthToken: options?.gitlabAuthToken
6173
6071
  });
6174
- const resp = await api2.RepositoryFiles.allFileBlames(projectPath, path9, ref);
6072
+ const resp = await api2.RepositoryFiles.allFileBlames(projectPath, path8, ref);
6175
6073
  let lineNumber = 1;
6176
6074
  return resp.filter((range) => range.lines).map((range) => {
6177
6075
  const oldLineNumber = lineNumber;
@@ -6357,10 +6255,10 @@ var GitlabSCMLib = class extends SCMLib {
6357
6255
  markdownComment: comment
6358
6256
  });
6359
6257
  }
6360
- async getRepoBlameRanges(ref, path9) {
6258
+ async getRepoBlameRanges(ref, path8) {
6361
6259
  this._validateUrl();
6362
6260
  return await getGitlabBlameRanges(
6363
- { ref, path: path9, gitlabUrl: this.url },
6261
+ { ref, path: path8, gitlabUrl: this.url },
6364
6262
  {
6365
6263
  url: this.url,
6366
6264
  gitlabAuthToken: this.accessToken
@@ -6409,7 +6307,7 @@ var GitlabSCMLib = class extends SCMLib {
6409
6307
  };
6410
6308
 
6411
6309
  // src/features/analysis/scm/scmFactory.ts
6412
- import { z as z26 } from "zod";
6310
+ import { z as z24 } from "zod";
6413
6311
 
6414
6312
  // src/features/analysis/scm/StubSCMLib.ts
6415
6313
  var StubSCMLib = class extends SCMLib {
@@ -6531,7 +6429,7 @@ async function createScmLib({ url, accessToken, scmType, scmOrg }, { propagateEx
6531
6429
  if (e instanceof InvalidRepoUrlError && url) {
6532
6430
  throw new RepoNoTokenAccessError(
6533
6431
  "no access to repo",
6534
- scmLibScmTypeToScmType[z26.nativeEnum(ScmLibScmType).parse(scmType)]
6432
+ scmLibScmTypeToScmType[z24.nativeEnum(ScmLibScmType).parse(scmType)]
6535
6433
  );
6536
6434
  }
6537
6435
  console.error(`error validating scm: ${scmType} `, e);
@@ -6862,14 +6760,14 @@ function getGithubSdk(params = {}) {
6862
6760
  };
6863
6761
  },
6864
6762
  async getGithubBlameRanges(params2) {
6865
- const { ref, gitHubUrl, path: path9 } = params2;
6763
+ const { ref, gitHubUrl, path: path8 } = params2;
6866
6764
  const { owner, repo } = parseGithubOwnerAndRepo(gitHubUrl);
6867
6765
  const res = await octokit.graphql(
6868
6766
  GET_BLAME_DOCUMENT,
6869
6767
  {
6870
6768
  owner,
6871
6769
  repo,
6872
- path: path9,
6770
+ path: path8,
6873
6771
  ref
6874
6772
  }
6875
6773
  );
@@ -7012,8 +6910,8 @@ function getGithubSdk(params = {}) {
7012
6910
 
7013
6911
  // src/features/analysis/add_fix_comments_for_pr/utils/utils.ts
7014
6912
  import Debug7 from "debug";
7015
- import parseDiff2 from "parse-diff";
7016
- import { z as z28 } from "zod";
6913
+ import parseDiff from "parse-diff";
6914
+ import { z as z26 } from "zod";
7017
6915
 
7018
6916
  // src/features/analysis/utils/by_key.ts
7019
6917
  function keyBy(array, keyBy2) {
@@ -7085,7 +6983,7 @@ var scannerToFriendlyString = {
7085
6983
 
7086
6984
  // src/features/analysis/add_fix_comments_for_pr/utils/buildCommentBody.ts
7087
6985
  import Debug6 from "debug";
7088
- import { z as z27 } from "zod";
6986
+ import { z as z25 } from "zod";
7089
6987
  var debug6 = Debug6("mobbdev:handle-finished-analysis");
7090
6988
  var getCommitFixButton = (commitUrl) => `<a href="${commitUrl}"><img src=${COMMIT_FIX_SVG}></a>`;
7091
6989
  function buildCommentBody({
@@ -7119,11 +7017,11 @@ function buildCommentBody({
7119
7017
  });
7120
7018
  const issueType = getIssueTypeFriendlyString(fix.safeIssueType);
7121
7019
  const title = `# ${MobbIconMarkdown} ${issueType} fix is ready`;
7122
- const validFixParseRes = z27.object({
7020
+ const validFixParseRes = z25.object({
7123
7021
  patchAndQuestions: PatchAndQuestionsZ,
7124
- safeIssueLanguage: z27.nativeEnum(IssueLanguage_Enum),
7125
- severityText: z27.nativeEnum(Vulnerability_Severity_Enum),
7126
- safeIssueType: z27.nativeEnum(IssueType_Enum)
7022
+ safeIssueLanguage: z25.nativeEnum(IssueLanguage_Enum),
7023
+ severityText: z25.nativeEnum(Vulnerability_Severity_Enum),
7024
+ safeIssueType: z25.nativeEnum(IssueType_Enum)
7127
7025
  }).safeParse(fix);
7128
7026
  if (!validFixParseRes.success) {
7129
7027
  debug6(
@@ -7224,7 +7122,7 @@ async function postFixComment(params) {
7224
7122
  scanner
7225
7123
  } = params;
7226
7124
  const {
7227
- path: path9,
7125
+ path: path8,
7228
7126
  startLine,
7229
7127
  vulnerabilityReportIssue: { fixId }
7230
7128
  } = vulnerabilityReportIssueCodeNode;
@@ -7240,7 +7138,7 @@ async function postFixComment(params) {
7240
7138
  Refresh the page in order to see the changes.`,
7241
7139
  pull_number: pullRequest,
7242
7140
  commit_id: commitSha,
7243
- path: path9,
7141
+ path: path8,
7244
7142
  line: startLine
7245
7143
  });
7246
7144
  const commentId = commentRes.data.id;
@@ -7288,7 +7186,7 @@ ${summary.join("\n")}`;
7288
7186
  }
7289
7187
  async function getRelevantVulenrabilitiesFromDiff(params) {
7290
7188
  const { gqlClient, diff, vulnerabilityReportId } = params;
7291
- const parsedDiff = parseDiff2(diff);
7189
+ const parsedDiff = parseDiff(diff);
7292
7190
  const fileHunks = parsedDiff.map((file) => {
7293
7191
  const fileNumbers = file.chunks.flatMap((chunk) => chunk.changes).filter((change) => change.type === "add").map((_change) => {
7294
7192
  const change = _change;
@@ -7296,7 +7194,7 @@ async function getRelevantVulenrabilitiesFromDiff(params) {
7296
7194
  });
7297
7195
  const lineAddedRanges = calculateRanges(fileNumbers);
7298
7196
  const fileFilter = {
7299
- path: z28.string().parse(file.to),
7197
+ path: z26.string().parse(file.to),
7300
7198
  ranges: lineAddedRanges.map(([startLine, endLine]) => ({
7301
7199
  endLine,
7302
7200
  startLine
@@ -7648,30 +7546,30 @@ function subscribe(query, variables, callback, wsClientOptions) {
7648
7546
  }
7649
7547
 
7650
7548
  // src/features/analysis/graphql/types.ts
7651
- import { z as z29 } from "zod";
7652
- var VulnerabilityReportIssueCodeNodeZ = z29.object({
7653
- vulnerabilityReportIssueId: z29.string(),
7654
- path: z29.string(),
7655
- startLine: z29.number(),
7656
- vulnerabilityReportIssue: z29.object({
7657
- fixId: z29.string()
7549
+ import { z as z27 } from "zod";
7550
+ var VulnerabilityReportIssueCodeNodeZ = z27.object({
7551
+ vulnerabilityReportIssueId: z27.string(),
7552
+ path: z27.string(),
7553
+ startLine: z27.number(),
7554
+ vulnerabilityReportIssue: z27.object({
7555
+ fixId: z27.string()
7658
7556
  })
7659
7557
  });
7660
- var GetVulByNodesMetadataZ = z29.object({
7661
- vulnerabilityReportIssueCodeNodes: z29.array(VulnerabilityReportIssueCodeNodeZ),
7662
- nonFixablePrVuls: z29.object({
7663
- aggregate: z29.object({
7664
- count: z29.number()
7558
+ var GetVulByNodesMetadataZ = z27.object({
7559
+ vulnerabilityReportIssueCodeNodes: z27.array(VulnerabilityReportIssueCodeNodeZ),
7560
+ nonFixablePrVuls: z27.object({
7561
+ aggregate: z27.object({
7562
+ count: z27.number()
7665
7563
  })
7666
7564
  }),
7667
- fixablePrVuls: z29.object({
7668
- aggregate: z29.object({
7669
- count: z29.number()
7565
+ fixablePrVuls: z27.object({
7566
+ aggregate: z27.object({
7567
+ count: z27.number()
7670
7568
  })
7671
7569
  }),
7672
- totalScanVulnerabilities: z29.object({
7673
- aggregate: z29.object({
7674
- count: z29.number()
7570
+ totalScanVulnerabilities: z27.object({
7571
+ aggregate: z27.object({
7572
+ count: z27.number()
7675
7573
  })
7676
7574
  })
7677
7575
  });
@@ -7961,24 +7859,24 @@ var GQLClient = class {
7961
7859
  };
7962
7860
 
7963
7861
  // src/features/analysis/pack.ts
7964
- import fs3 from "node:fs";
7965
- import path5 from "node:path";
7862
+ import fs2 from "node:fs";
7863
+ import path4 from "node:path";
7966
7864
  import AdmZip from "adm-zip";
7967
7865
  import Debug12 from "debug";
7968
7866
  import { globby } from "globby";
7969
7867
  import { isBinary } from "istextorbinary";
7970
7868
  import { simpleGit as simpleGit3 } from "simple-git";
7971
7869
  import { parseStringPromise } from "xml2js";
7972
- import { z as z30 } from "zod";
7870
+ import { z as z28 } from "zod";
7973
7871
  var debug12 = Debug12("mobbdev:pack");
7974
7872
  var MAX_FILE_SIZE = 1024 * 1024 * 5;
7975
- var FPR_SOURCE_CODE_FILE_MAPPING_SCHEMA = z30.object({
7976
- properties: z30.object({
7977
- entry: z30.array(
7978
- z30.object({
7979
- _: z30.string(),
7980
- $: z30.object({
7981
- key: z30.string()
7873
+ var FPR_SOURCE_CODE_FILE_MAPPING_SCHEMA = z28.object({
7874
+ properties: z28.object({
7875
+ entry: z28.array(
7876
+ z28.object({
7877
+ _: z28.string(),
7878
+ $: z28.object({
7879
+ key: z28.string()
7982
7880
  })
7983
7881
  })
7984
7882
  )
@@ -8028,20 +7926,20 @@ async function pack(srcDirPath, vulnFiles) {
8028
7926
  const zip = new AdmZip();
8029
7927
  debug12("compressing files");
8030
7928
  for (const filepath of filepaths) {
8031
- const absFilepath = path5.join(srcDirPath, filepath.toString());
7929
+ const absFilepath = path4.join(srcDirPath, filepath.toString());
8032
7930
  vulnFiles = vulnFiles.concat(_get_manifest_files_suffixes());
8033
7931
  if (!endsWithAny(
8034
- absFilepath.toString().replaceAll(path5.win32.sep, path5.posix.sep),
7932
+ absFilepath.toString().replaceAll(path4.win32.sep, path4.posix.sep),
8035
7933
  vulnFiles
8036
7934
  )) {
8037
7935
  debug12("ignoring %s because it is not a vulnerability file", filepath);
8038
7936
  continue;
8039
7937
  }
8040
- if (fs3.lstatSync(absFilepath).size > MAX_FILE_SIZE) {
7938
+ if (fs2.lstatSync(absFilepath).size > MAX_FILE_SIZE) {
8041
7939
  debug12("ignoring %s because the size is > 5MB", filepath);
8042
7940
  continue;
8043
7941
  }
8044
- const data = git ? await git.showBuffer([`HEAD:./${filepath}`]) : fs3.readFileSync(absFilepath);
7942
+ const data = git ? await git.showBuffer([`HEAD:./${filepath}`]) : fs2.readFileSync(absFilepath);
8045
7943
  if (isBinary(null, data)) {
8046
7944
  debug12("ignoring %s because is seems to be a binary file", filepath);
8047
7945
  continue;
@@ -8198,7 +8096,7 @@ import Debug14 from "debug";
8198
8096
  import { existsSync } from "fs";
8199
8097
  import { createSpinner as createSpinner2 } from "nanospinner";
8200
8098
  import { type } from "os";
8201
- import path6 from "path";
8099
+ import path5 from "path";
8202
8100
  var debug13 = Debug14("mobbdev:checkmarx");
8203
8101
  var require2 = createRequire(import.meta.url);
8204
8102
  var getCheckmarxPath = () => {
@@ -8258,9 +8156,9 @@ async function getCheckmarxReport({ reportPath, repositoryRoot, branch, projectN
8258
8156
  await startCheckmarxConfigationPrompt();
8259
8157
  await validateCheckamxCredentials();
8260
8158
  }
8261
- const extension = path6.extname(reportPath);
8262
- const filePath = path6.dirname(reportPath);
8263
- const fileName = path6.basename(reportPath, extension);
8159
+ const extension = path5.extname(reportPath);
8160
+ const filePath = path5.dirname(reportPath);
8161
+ const fileName = path5.basename(reportPath, extension);
8264
8162
  const checkmarxCommandArgs = getCheckmarxCommandArgs({
8265
8163
  repoPath: repositoryRoot,
8266
8164
  branch,
@@ -8442,7 +8340,7 @@ async function downloadRepo({
8442
8340
  const { createSpinner: createSpinner5 } = Spinner2({ ci });
8443
8341
  const repoSpinner = createSpinner5("\u{1F4BE} Downloading Repo").start();
8444
8342
  debug16("download repo %s %s %s", repoUrl, dirname);
8445
- const zipFilePath = path7.join(dirname, "repo.zip");
8343
+ const zipFilePath = path6.join(dirname, "repo.zip");
8446
8344
  debug16("download URL: %s auth headers: %o", downloadUrl, authHeaders);
8447
8345
  const response = await fetch4(downloadUrl, {
8448
8346
  method: "GET",
@@ -8455,19 +8353,19 @@ async function downloadRepo({
8455
8353
  repoSpinner.error({ text: "\u{1F4BE} Repo download failed" });
8456
8354
  throw new Error(`Can't access ${chalk4.bold(repoUrl)}`);
8457
8355
  }
8458
- const fileWriterStream = fs4.createWriteStream(zipFilePath);
8356
+ const fileWriterStream = fs3.createWriteStream(zipFilePath);
8459
8357
  if (!response.body) {
8460
8358
  throw new Error("Response body is empty");
8461
8359
  }
8462
8360
  await pipeline(response.body, fileWriterStream);
8463
8361
  await extract(zipFilePath, { dir: dirname });
8464
- const repoRoot = fs4.readdirSync(dirname, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name)[0];
8362
+ const repoRoot = fs3.readdirSync(dirname, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name)[0];
8465
8363
  if (!repoRoot) {
8466
8364
  throw new Error("Repo root not found");
8467
8365
  }
8468
8366
  debug16("repo root %s", repoRoot);
8469
8367
  repoSpinner.success({ text: "\u{1F4BE} Repo downloaded successfully" });
8470
- return path7.join(dirname, repoRoot);
8368
+ return path6.join(dirname, repoRoot);
8471
8369
  }
8472
8370
  var getReportUrl = ({
8473
8371
  organizationId,
@@ -8478,7 +8376,7 @@ var debug16 = Debug17("mobbdev:index");
8478
8376
  var config2 = new Configstore(packageJson.name, { apiToken: "" });
8479
8377
  debug16("config %o", config2);
8480
8378
  async function runAnalysis(params, options) {
8481
- const tmpObj = tmp2.dirSync({
8379
+ const tmpObj = tmp.dirSync({
8482
8380
  unsafeCleanup: true
8483
8381
  });
8484
8382
  try {
@@ -8577,7 +8475,7 @@ async function getReport(params, { skipPrompts }) {
8577
8475
  authHeaders: scm.getAuthHeaders(),
8578
8476
  downloadUrl
8579
8477
  });
8580
- const reportPath = path7.join(dirname, "report.json");
8478
+ const reportPath = path6.join(dirname, "report.json");
8581
8479
  switch (scanner) {
8582
8480
  case "snyk":
8583
8481
  await getSnykReport(reportPath, repositoryRoot, { skipPrompts });
@@ -8737,7 +8635,7 @@ async function _scan(params, { skipPrompts = false } = {}) {
8737
8635
  spinner: mobbSpinner,
8738
8636
  submitVulnerabilityReportVariables: {
8739
8637
  fixReportId: reportUploadInfo.fixReportId,
8740
- repoUrl: z31.string().parse(repo),
8638
+ repoUrl: z29.string().parse(repo),
8741
8639
  reference,
8742
8640
  projectId,
8743
8641
  vulnerabilityReportFileName: "report.json",
@@ -8764,6 +8662,15 @@ async function _scan(params, { skipPrompts = false } = {}) {
8764
8662
  });
8765
8663
  }
8766
8664
  await askToOpenAnalysis();
8665
+ if (command === "review") {
8666
+ await waitForAnaysisAndReviewPr({
8667
+ repo,
8668
+ githubActionToken,
8669
+ analysisId: reportUploadInfo.fixReportId,
8670
+ scanner,
8671
+ gqlClient
8672
+ });
8673
+ }
8767
8674
  return reportUploadInfo.fixReportId;
8768
8675
  async function askToOpenAnalysis() {
8769
8676
  if (!repoUploadInfo || !reportUploadInfo) {
@@ -8856,7 +8763,7 @@ async function _scan(params, { skipPrompts = false } = {}) {
8856
8763
  const zippingSpinner = createSpinner5("\u{1F4E6} Zipping repo").start();
8857
8764
  let zipBuffer;
8858
8765
  let gitInfo = { success: false };
8859
- if (srcFileStatus.isFile() && path7.extname(srcPath).toLowerCase() === ".fpr") {
8766
+ if (srcFileStatus.isFile() && path6.extname(srcPath).toLowerCase() === ".fpr") {
8860
8767
  zipBuffer = await repackFpr(srcPath);
8861
8768
  } else {
8862
8769
  gitInfo = await getGitInfo(srcPath);
@@ -8892,34 +8799,12 @@ async function _scan(params, { skipPrompts = false } = {}) {
8892
8799
  }
8893
8800
  });
8894
8801
  if (command === "review") {
8895
- const params2 = z31.object({
8896
- repo: z31.string().url(),
8897
- githubActionToken: z31.string()
8898
- }).parse({ repo, githubActionToken });
8899
- const scm = await createScmLib(
8900
- {
8901
- url: params2.repo,
8902
- accessToken: params2.githubActionToken,
8903
- scmOrg: "",
8904
- scmType: "GITHUB" /* GITHUB */
8905
- },
8906
- {
8907
- propagateExceptions: true
8908
- }
8909
- );
8910
- await gqlClient.subscribeToAnalysis({
8911
- subscribeToAnalysisParams: {
8912
- analysisId: reportUploadInfo.fixReportId
8913
- },
8914
- callback: (analysisId) => {
8915
- return addFixCommentsForPr({
8916
- analysisId,
8917
- gqlClient,
8918
- scm,
8919
- scanner: z31.nativeEnum(SCANNERS).parse(scanner)
8920
- });
8921
- },
8922
- callbackStates: ["Finished" /* Finished */]
8802
+ await waitForAnaysisAndReviewPr({
8803
+ repo,
8804
+ githubActionToken,
8805
+ analysisId: reportUploadInfo.fixReportId,
8806
+ scanner,
8807
+ gqlClient
8923
8808
  });
8924
8809
  }
8925
8810
  } catch (e) {
@@ -8991,6 +8876,43 @@ async function _digestReport({
8991
8876
  throw e;
8992
8877
  }
8993
8878
  }
8879
+ async function waitForAnaysisAndReviewPr({
8880
+ repo,
8881
+ githubActionToken,
8882
+ analysisId,
8883
+ scanner,
8884
+ gqlClient
8885
+ }) {
8886
+ const params = z29.object({
8887
+ repo: z29.string().url(),
8888
+ githubActionToken: z29.string()
8889
+ }).parse({ repo, githubActionToken });
8890
+ const scm = await createScmLib(
8891
+ {
8892
+ url: params.repo,
8893
+ accessToken: params.githubActionToken,
8894
+ scmOrg: "",
8895
+ scmType: "GITHUB" /* GITHUB */
8896
+ },
8897
+ {
8898
+ propagateExceptions: true
8899
+ }
8900
+ );
8901
+ await gqlClient.subscribeToAnalysis({
8902
+ subscribeToAnalysisParams: {
8903
+ analysisId
8904
+ },
8905
+ callback: (analysisId2) => {
8906
+ return addFixCommentsForPr({
8907
+ analysisId: analysisId2,
8908
+ gqlClient,
8909
+ scm,
8910
+ scanner: z29.nativeEnum(SCANNERS).parse(scanner)
8911
+ });
8912
+ },
8913
+ callbackStates: ["Finished" /* Finished */]
8914
+ });
8915
+ }
8994
8916
 
8995
8917
  // src/commands/index.ts
8996
8918
  import chalk5 from "chalk";
@@ -9302,8 +9224,8 @@ var scmTokenOption = {
9302
9224
 
9303
9225
  // src/args/validation.ts
9304
9226
  import chalk7 from "chalk";
9305
- import path8 from "path";
9306
- import { z as z32 } from "zod";
9227
+ import path7 from "path";
9228
+ import { z as z30 } from "zod";
9307
9229
  function throwRepoUrlErrorMessage({
9308
9230
  error,
9309
9231
  repoUrl,
@@ -9320,11 +9242,11 @@ Example:
9320
9242
  )}`;
9321
9243
  throw new CliError(formattedErrorMessage);
9322
9244
  }
9323
- var UrlZ = z32.string({
9245
+ var UrlZ = z30.string({
9324
9246
  invalid_type_error: `is not a valid ${Object.values(ScmType).join("/ ")} URL`
9325
9247
  });
9326
9248
  function validateOrganizationId(organizationId) {
9327
- const orgIdValidation = z32.string().uuid().nullish().safeParse(organizationId);
9249
+ const orgIdValidation = z30.string().uuid().nullish().safeParse(organizationId);
9328
9250
  if (!orgIdValidation.success) {
9329
9251
  throw new CliError(`organizationId: ${organizationId} is not a valid UUID`);
9330
9252
  }
@@ -9346,7 +9268,7 @@ function validateRepoUrl(args) {
9346
9268
  }
9347
9269
  var supportExtensions = [".json", ".xml", ".fpr", ".sarif"];
9348
9270
  function validateReportFileFormat(reportFile) {
9349
- if (!supportExtensions.includes(path8.extname(reportFile))) {
9271
+ if (!supportExtensions.includes(path7.extname(reportFile))) {
9350
9272
  throw new CliError(
9351
9273
  `
9352
9274
  ${chalk7.bold(
@@ -9389,7 +9311,7 @@ function analyzeBuilder(yargs2) {
9389
9311
  ).help();
9390
9312
  }
9391
9313
  function validateAnalyzeOptions(argv) {
9392
- if (!fs5.existsSync(argv.f)) {
9314
+ if (!fs4.existsSync(argv.f)) {
9393
9315
  throw new CliError(`
9394
9316
  Can't access ${chalk8.bold(argv.f)}`);
9395
9317
  }
@@ -9421,7 +9343,7 @@ async function analyzeHandler(args) {
9421
9343
  }
9422
9344
 
9423
9345
  // src/args/commands/review.ts
9424
- import fs6 from "node:fs";
9346
+ import fs5 from "node:fs";
9425
9347
  import chalk9 from "chalk";
9426
9348
  function reviewBuilder(yargs2) {
9427
9349
  return yargs2.option("f", {
@@ -9451,14 +9373,14 @@ function reviewBuilder(yargs2) {
9451
9373
  "Path to the repository folder with the source code"
9452
9374
  ),
9453
9375
  type: "string",
9454
- demandOption: true
9376
+ demandOption: false
9455
9377
  }).example(
9456
9378
  "npx mobbdev@latest review -r https://github.com/WebGoat/WebGoat -f <your_vulnerability_report_path> --ch <pr_last_commit> --pr <pr_number> --ref <pr_branch_name> --api-key <api_key> --src-path <your_repo_path>",
9457
9379
  "add fixes to your pr"
9458
9380
  ).help();
9459
9381
  }
9460
9382
  function validateReviewOptions(argv) {
9461
- if (!fs6.existsSync(argv.f)) {
9383
+ if (!fs5.existsSync(argv.f)) {
9462
9384
  throw new CliError(`
9463
9385
  Can't access ${chalk9.bold(argv.f)}`);
9464
9386
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobbdev",
3
- "version": "1.0.53",
3
+ "version": "1.0.58",
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",