mobbdev 1.0.32 → 1.0.33
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/index.mjs +765 -649
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -37,7 +37,7 @@ import { fileURLToPath } from "node:url";
|
|
|
37
37
|
import chalk from "chalk";
|
|
38
38
|
import Debug from "debug";
|
|
39
39
|
import * as dotenv from "dotenv";
|
|
40
|
-
import { z as
|
|
40
|
+
import { z as z8 } from "zod";
|
|
41
41
|
|
|
42
42
|
// src/features/analysis/scm/generates/client_generates.ts
|
|
43
43
|
var FixQuestionInputType = /* @__PURE__ */ ((FixQuestionInputType2) => {
|
|
@@ -218,6 +218,14 @@ var Vulnerability_Report_Issue_State_Enum = /* @__PURE__ */ ((Vulnerability_Repo
|
|
|
218
218
|
Vulnerability_Report_Issue_State_Enum2["Unsupported"] = "Unsupported";
|
|
219
219
|
return Vulnerability_Report_Issue_State_Enum2;
|
|
220
220
|
})(Vulnerability_Report_Issue_State_Enum || {});
|
|
221
|
+
var Vulnerability_Report_Issue_Tag_Enum = /* @__PURE__ */ ((Vulnerability_Report_Issue_Tag_Enum2) => {
|
|
222
|
+
Vulnerability_Report_Issue_Tag_Enum2["AutogeneratedCode"] = "AUTOGENERATED_CODE";
|
|
223
|
+
Vulnerability_Report_Issue_Tag_Enum2["AuxiliaryCode"] = "AUXILIARY_CODE";
|
|
224
|
+
Vulnerability_Report_Issue_Tag_Enum2["FalsePositive"] = "FALSE_POSITIVE";
|
|
225
|
+
Vulnerability_Report_Issue_Tag_Enum2["TestCode"] = "TEST_CODE";
|
|
226
|
+
Vulnerability_Report_Issue_Tag_Enum2["VendorCode"] = "VENDOR_CODE";
|
|
227
|
+
return Vulnerability_Report_Issue_Tag_Enum2;
|
|
228
|
+
})(Vulnerability_Report_Issue_Tag_Enum || {});
|
|
221
229
|
var Vulnerability_Report_Vendor_Enum = /* @__PURE__ */ ((Vulnerability_Report_Vendor_Enum3) => {
|
|
222
230
|
Vulnerability_Report_Vendor_Enum3["Checkmarx"] = "checkmarx";
|
|
223
231
|
Vulnerability_Report_Vendor_Enum3["CheckmarxXml"] = "checkmarxXml";
|
|
@@ -685,14 +693,298 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
685
693
|
};
|
|
686
694
|
}
|
|
687
695
|
|
|
688
|
-
// src/features/analysis/scm/shared/src/types.ts
|
|
696
|
+
// src/features/analysis/scm/shared/src/types/fix.ts
|
|
697
|
+
import { z as z2 } from "zod";
|
|
698
|
+
|
|
699
|
+
// src/features/analysis/scm/shared/src/types/shared.ts
|
|
700
|
+
import { z } from "zod";
|
|
701
|
+
var ParsedSeverityZ = z.nativeEnum(Vulnerability_Severity_Enum).nullish().transform((i) => i ?? "low" /* Low */);
|
|
702
|
+
var ScmSubmitFixRequestsZ = z.array(
|
|
703
|
+
z.object({
|
|
704
|
+
scmSubmitFixRequest: z.object({
|
|
705
|
+
submitFixRequest: z.object({
|
|
706
|
+
createdByUser: z.object({
|
|
707
|
+
email: z.string()
|
|
708
|
+
}),
|
|
709
|
+
targetBranchName: z.string().default("")
|
|
710
|
+
}),
|
|
711
|
+
prUrl: z.string().nullable(),
|
|
712
|
+
prStatus: z.nativeEnum(Pr_Status_Enum).nullable(),
|
|
713
|
+
commitUrl: z.string().nullable(),
|
|
714
|
+
scmId: z.string()
|
|
715
|
+
})
|
|
716
|
+
})
|
|
717
|
+
);
|
|
718
|
+
|
|
719
|
+
// src/features/analysis/scm/shared/src/types/fix.ts
|
|
720
|
+
var PackageInfoZ = z2.object({
|
|
721
|
+
name: z2.string(),
|
|
722
|
+
version: z2.string(),
|
|
723
|
+
envName: z2.string().nullable()
|
|
724
|
+
});
|
|
725
|
+
var ManifestActionRequiredZ = z2.object({
|
|
726
|
+
action: z2.nativeEnum(ManifestAction),
|
|
727
|
+
language: z2.nativeEnum(Language),
|
|
728
|
+
lib: PackageInfoZ,
|
|
729
|
+
typesLib: PackageInfoZ.nullable()
|
|
730
|
+
});
|
|
731
|
+
var ExtraContextInternalZ = z2.object({
|
|
732
|
+
key: z2.string(),
|
|
733
|
+
value: z2.string().or(z2.boolean()).or(
|
|
734
|
+
z2.object({
|
|
735
|
+
int: z2.boolean(),
|
|
736
|
+
integer: z2.boolean(),
|
|
737
|
+
string: z2.boolean(),
|
|
738
|
+
date: z2.boolean()
|
|
739
|
+
})
|
|
740
|
+
)
|
|
741
|
+
});
|
|
742
|
+
var FixExtraContextZ = z2.object({
|
|
743
|
+
fixDescription: z2.string(),
|
|
744
|
+
manifestActionsRequired: z2.array(ManifestActionRequiredZ),
|
|
745
|
+
extraContext: z2.array(ExtraContextInternalZ)
|
|
746
|
+
});
|
|
747
|
+
var PatchAndQuestionsZ = z2.object({
|
|
748
|
+
__typename: z2.literal("FixData"),
|
|
749
|
+
patch: z2.string(),
|
|
750
|
+
patchOriginalEncodingBase64: z2.string(),
|
|
751
|
+
questions: z2.array(
|
|
752
|
+
z2.object({
|
|
753
|
+
name: z2.string(),
|
|
754
|
+
key: z2.string(),
|
|
755
|
+
index: z2.number(),
|
|
756
|
+
defaultValue: z2.string(),
|
|
757
|
+
value: z2.string().nullable(),
|
|
758
|
+
extraContext: z2.array(ExtraContextInternalZ),
|
|
759
|
+
inputType: z2.nativeEnum(FixQuestionInputType),
|
|
760
|
+
options: z2.array(z2.string())
|
|
761
|
+
})
|
|
762
|
+
),
|
|
763
|
+
extraContext: FixExtraContextZ
|
|
764
|
+
});
|
|
765
|
+
var FixRatingZ = z2.object({
|
|
766
|
+
voteScore: z2.number(),
|
|
767
|
+
fixRatingTag: z2.nativeEnum(Fix_Rating_Tag_Enum).nullable().default(null),
|
|
768
|
+
comment: z2.string().nullable().default(null),
|
|
769
|
+
updatedDate: z2.string().nullable(),
|
|
770
|
+
user: z2.object({
|
|
771
|
+
email: z2.string(),
|
|
772
|
+
name: z2.string()
|
|
773
|
+
})
|
|
774
|
+
});
|
|
775
|
+
var FixSharedStateZ = z2.object({
|
|
776
|
+
state: z2.nativeEnum(Fix_State_Enum),
|
|
777
|
+
isArchived: z2.boolean(),
|
|
778
|
+
scmSubmitFixRequests: ScmSubmitFixRequestsZ,
|
|
779
|
+
fixRatings: z2.array(FixRatingZ).default([])
|
|
780
|
+
}).nullish().transform(
|
|
781
|
+
(data) => data ? data : {
|
|
782
|
+
state: "Ready" /* Ready */,
|
|
783
|
+
isArchived: false,
|
|
784
|
+
scmSubmitFixRequests: [],
|
|
785
|
+
fixRatings: []
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
var FixQueryZ = z2.object({
|
|
789
|
+
__typename: z2.literal("fix").optional(),
|
|
790
|
+
id: z2.string().uuid(),
|
|
791
|
+
sharedState: FixSharedStateZ,
|
|
792
|
+
modifiedBy: z2.string().nullable(),
|
|
793
|
+
gitBlameLogin: z2.string().nullable(),
|
|
794
|
+
safeIssueLanguage: z2.string(),
|
|
795
|
+
safeIssueType: z2.string(),
|
|
796
|
+
confidence: z2.number(),
|
|
797
|
+
fixReportId: z2.string().uuid(),
|
|
798
|
+
isExpired: z2.boolean().default(false),
|
|
799
|
+
fixFiles: z2.array(
|
|
800
|
+
z2.object({
|
|
801
|
+
fileRepoRelativePath: z2.string()
|
|
802
|
+
})
|
|
803
|
+
),
|
|
804
|
+
numberOfVulnerabilityIssues: z2.number(),
|
|
805
|
+
severityText: z2.nativeEnum(Vulnerability_Severity_Enum),
|
|
806
|
+
vulnerabilityReportIssues: z2.array(
|
|
807
|
+
z2.object({
|
|
808
|
+
vendorIssueId: z2.string(),
|
|
809
|
+
issueLanguage: z2.string(),
|
|
810
|
+
parsedSeverity: ParsedSeverityZ
|
|
811
|
+
})
|
|
812
|
+
),
|
|
813
|
+
patchAndQuestions: PatchAndQuestionsZ,
|
|
814
|
+
effortToApplyFix: z2.nativeEnum(Effort_To_Apply_Fix_Enum).nullable()
|
|
815
|
+
});
|
|
816
|
+
var FixPartsForFixScreenZ = FixQueryZ.merge(
|
|
817
|
+
z2.object({
|
|
818
|
+
vulnerabilityReportIssues: z2.array(
|
|
819
|
+
z2.object({
|
|
820
|
+
vendorIssueId: z2.string(),
|
|
821
|
+
issueType: z2.string(),
|
|
822
|
+
issueLanguage: z2.string()
|
|
823
|
+
})
|
|
824
|
+
)
|
|
825
|
+
})
|
|
826
|
+
);
|
|
827
|
+
|
|
828
|
+
// src/features/analysis/scm/shared/src/types/issue.ts
|
|
829
|
+
import { z as z4 } from "zod";
|
|
830
|
+
|
|
831
|
+
// src/features/analysis/scm/shared/src/types/analysis.ts
|
|
689
832
|
import { z as z3 } from "zod";
|
|
833
|
+
var FixPageFixReportZ = z3.object({
|
|
834
|
+
id: z3.string().uuid(),
|
|
835
|
+
analysisUrl: z3.string(),
|
|
836
|
+
expirationOn: z3.string(),
|
|
837
|
+
createdOn: z3.string(),
|
|
838
|
+
state: z3.nativeEnum(Fix_Report_State_Enum),
|
|
839
|
+
fixes_aggregate: z3.object({
|
|
840
|
+
aggregate: z3.object({
|
|
841
|
+
count: z3.number()
|
|
842
|
+
})
|
|
843
|
+
}),
|
|
844
|
+
repo: z3.object({
|
|
845
|
+
name: z3.string().nullable(),
|
|
846
|
+
originalUrl: z3.string(),
|
|
847
|
+
reference: z3.string(),
|
|
848
|
+
commitSha: z3.string()
|
|
849
|
+
}),
|
|
850
|
+
vulnerabilityReport: z3.object({
|
|
851
|
+
vendor: z3.nativeEnum(Vulnerability_Report_Vendor_Enum),
|
|
852
|
+
vendorReportId: z3.string().uuid().nullable(),
|
|
853
|
+
projectId: z3.string().uuid(),
|
|
854
|
+
project: z3.object({
|
|
855
|
+
organizationId: z3.string().uuid()
|
|
856
|
+
}),
|
|
857
|
+
file: z3.object({
|
|
858
|
+
id: z3.string().uuid(),
|
|
859
|
+
path: z3.string()
|
|
860
|
+
}),
|
|
861
|
+
pending: z3.object({
|
|
862
|
+
aggregate: z3.object({
|
|
863
|
+
count: z3.number()
|
|
864
|
+
})
|
|
865
|
+
}),
|
|
866
|
+
supported: z3.object({
|
|
867
|
+
aggregate: z3.object({
|
|
868
|
+
count: z3.number()
|
|
869
|
+
})
|
|
870
|
+
}),
|
|
871
|
+
all: z3.object({
|
|
872
|
+
aggregate: z3.object({
|
|
873
|
+
count: z3.number()
|
|
874
|
+
})
|
|
875
|
+
}),
|
|
876
|
+
fixable: z3.object({
|
|
877
|
+
aggregate: z3.object({
|
|
878
|
+
count: z3.number()
|
|
879
|
+
})
|
|
880
|
+
}),
|
|
881
|
+
errors: z3.object({
|
|
882
|
+
aggregate: z3.object({
|
|
883
|
+
count: z3.number()
|
|
884
|
+
})
|
|
885
|
+
}),
|
|
886
|
+
vulnerabilityReportIssues: z3.object({
|
|
887
|
+
extraData: z3.object({
|
|
888
|
+
missing_files: z3.string().array().nullish(),
|
|
889
|
+
large_files: z3.string().array().nullish(),
|
|
890
|
+
error_files: z3.string().array().nullish()
|
|
891
|
+
})
|
|
892
|
+
}).array()
|
|
893
|
+
})
|
|
894
|
+
});
|
|
895
|
+
|
|
896
|
+
// src/features/analysis/scm/shared/src/types/issue.ts
|
|
897
|
+
var category = {
|
|
898
|
+
NoFix: "NoFix",
|
|
899
|
+
Unsupported: "Unsupported",
|
|
900
|
+
Irrelevant: "Irrelevant",
|
|
901
|
+
FalsePositive: "FalsePositive",
|
|
902
|
+
Fixable: "Fixable"
|
|
903
|
+
};
|
|
904
|
+
var ValidCategoriesZ = z4.union([
|
|
905
|
+
z4.literal(category.NoFix),
|
|
906
|
+
z4.literal(category.Unsupported),
|
|
907
|
+
z4.literal(category.Irrelevant),
|
|
908
|
+
z4.literal(category.FalsePositive),
|
|
909
|
+
z4.literal(category.Fixable)
|
|
910
|
+
]);
|
|
911
|
+
var BaseIssuePartsZ = z4.object({
|
|
912
|
+
id: z4.string().uuid(),
|
|
913
|
+
safeIssueType: z4.string(),
|
|
914
|
+
safeIssueLanguage: z4.string(),
|
|
915
|
+
createdAt: z4.string(),
|
|
916
|
+
parsedSeverity: ParsedSeverityZ,
|
|
917
|
+
category: ValidCategoriesZ,
|
|
918
|
+
vulnerabilityReportIssueTags: z4.array(
|
|
919
|
+
z4.object({
|
|
920
|
+
tag: z4.nativeEnum(Vulnerability_Report_Issue_Tag_Enum)
|
|
921
|
+
})
|
|
922
|
+
),
|
|
923
|
+
codeNodes: z4.array(
|
|
924
|
+
z4.object({
|
|
925
|
+
path: z4.string(),
|
|
926
|
+
line: z4.number(),
|
|
927
|
+
index: z4.number()
|
|
928
|
+
})
|
|
929
|
+
).transform((nodes) => nodes.sort((a, b) => b.index - a.index)),
|
|
930
|
+
fix: FixPartsForFixScreenZ.nullish()
|
|
931
|
+
});
|
|
932
|
+
var FalsePositivePartsZ = z4.object({
|
|
933
|
+
extraContext: z4.array(z4.object({ key: z4.string(), value: z4.string() })),
|
|
934
|
+
fixDescription: z4.string()
|
|
935
|
+
});
|
|
936
|
+
var IssuePartsWithFixZ = BaseIssuePartsZ.merge(
|
|
937
|
+
z4.object({
|
|
938
|
+
category: z4.literal(category.Irrelevant),
|
|
939
|
+
fix: FixPartsForFixScreenZ.nullish()
|
|
940
|
+
})
|
|
941
|
+
);
|
|
942
|
+
var IssuePartsFpZ = BaseIssuePartsZ.merge(
|
|
943
|
+
z4.object({
|
|
944
|
+
category: z4.literal(category.FalsePositive),
|
|
945
|
+
fpId: z4.string().uuid(),
|
|
946
|
+
getFalsePositive: FalsePositivePartsZ
|
|
947
|
+
})
|
|
948
|
+
);
|
|
949
|
+
var GeneralIssueZ = BaseIssuePartsZ.merge(
|
|
950
|
+
z4.object({
|
|
951
|
+
category: z4.union([
|
|
952
|
+
z4.literal(category.NoFix),
|
|
953
|
+
z4.literal(category.Unsupported),
|
|
954
|
+
z4.literal(category.Fixable)
|
|
955
|
+
])
|
|
956
|
+
})
|
|
957
|
+
);
|
|
958
|
+
var IssuePartsZ = z4.union([
|
|
959
|
+
IssuePartsFpZ,
|
|
960
|
+
IssuePartsWithFixZ,
|
|
961
|
+
GeneralIssueZ
|
|
962
|
+
]);
|
|
963
|
+
var GetIssueIndexesZ = z4.object({
|
|
964
|
+
currentIndex: z4.number(),
|
|
965
|
+
totalIssues: z4.number(),
|
|
966
|
+
nextIssue: z4.object({
|
|
967
|
+
id: z4.string().uuid()
|
|
968
|
+
}).nullish(),
|
|
969
|
+
prevIssue: z4.object({
|
|
970
|
+
id: z4.string().uuid()
|
|
971
|
+
}).nullish()
|
|
972
|
+
});
|
|
973
|
+
var GetIssueScreenDataZ = z4.object({
|
|
974
|
+
fixReport_by_pk: FixPageFixReportZ,
|
|
975
|
+
vulnerability_report_issue_by_pk: IssuePartsZ,
|
|
976
|
+
issueIndexes: GetIssueIndexesZ
|
|
977
|
+
});
|
|
978
|
+
var IssueBucketZ = z4.enum(["fixable", "irrelevant", "remaining"]);
|
|
979
|
+
|
|
980
|
+
// src/features/analysis/scm/shared/src/types/types.ts
|
|
981
|
+
import { z as z7 } from "zod";
|
|
690
982
|
|
|
691
983
|
// src/features/analysis/scm/shared/src/validations.ts
|
|
692
|
-
import { z as
|
|
984
|
+
import { z as z6 } from "zod";
|
|
693
985
|
|
|
694
986
|
// src/features/analysis/scm/shared/src/getIssueType.ts
|
|
695
|
-
import { z } from "zod";
|
|
987
|
+
import { z as z5 } from "zod";
|
|
696
988
|
var issueTypeMap = {
|
|
697
989
|
["NO_LIMITS_OR_THROTTLING" /* NoLimitsOrThrottling */]: "Missing Rate Limiting",
|
|
698
990
|
["SQL_Injection" /* SqlInjection */]: "SQL Injection",
|
|
@@ -777,7 +1069,7 @@ var issueTypeMap = {
|
|
|
777
1069
|
["REGEX_MISSING_TIMEOUT" /* RegexMissingTimeout */]: "Regex Missing Timeout",
|
|
778
1070
|
["FRAMEABLE_LOGIN_PAGE" /* FrameableLoginPage */]: "Frameable Login Page"
|
|
779
1071
|
};
|
|
780
|
-
var issueTypeZ =
|
|
1072
|
+
var issueTypeZ = z5.nativeEnum(IssueType_Enum);
|
|
781
1073
|
var getIssueTypeFriendlyString = (issueType) => {
|
|
782
1074
|
const issueTypeZParseRes = issueTypeZ.safeParse(issueType);
|
|
783
1075
|
if (!issueTypeZParseRes.success) {
|
|
@@ -787,12 +1079,12 @@ var getIssueTypeFriendlyString = (issueType) => {
|
|
|
787
1079
|
};
|
|
788
1080
|
|
|
789
1081
|
// src/features/analysis/scm/shared/src/validations.ts
|
|
790
|
-
var IssueTypeSettingZ =
|
|
791
|
-
autoPrEnabled:
|
|
792
|
-
enabled:
|
|
793
|
-
issueType:
|
|
1082
|
+
var IssueTypeSettingZ = z6.object({
|
|
1083
|
+
autoPrEnabled: z6.boolean(),
|
|
1084
|
+
enabled: z6.boolean(),
|
|
1085
|
+
issueType: z6.nativeEnum(IssueType_Enum)
|
|
794
1086
|
});
|
|
795
|
-
var IssueTypeSettingsZ =
|
|
1087
|
+
var IssueTypeSettingsZ = z6.array(IssueTypeSettingZ).transform((issueTypeSettings) => {
|
|
796
1088
|
return Object.values(IssueType_Enum).map((issueTypeEnum) => {
|
|
797
1089
|
const existingIssueTypeSetting = issueTypeSettings.find(
|
|
798
1090
|
({ issueType: dbIssueType }) => dbIssueType === issueTypeEnum
|
|
@@ -812,550 +1104,374 @@ var IssueTypeSettingsZ = z2.array(IssueTypeSettingZ).transform((issueTypeSetting
|
|
|
812
1104
|
});
|
|
813
1105
|
});
|
|
814
1106
|
|
|
815
|
-
// src/features/analysis/scm/shared/src/types.ts
|
|
816
|
-
var
|
|
817
|
-
|
|
818
|
-
scmSubmitFixRequest: z3.object({
|
|
819
|
-
submitFixRequest: z3.object({
|
|
820
|
-
createdByUser: z3.object({
|
|
821
|
-
email: z3.string()
|
|
822
|
-
}),
|
|
823
|
-
targetBranchName: z3.string().default("")
|
|
824
|
-
}),
|
|
825
|
-
prUrl: z3.string().nullable(),
|
|
826
|
-
prStatus: z3.nativeEnum(Pr_Status_Enum).nullable(),
|
|
827
|
-
commitUrl: z3.string().nullable(),
|
|
828
|
-
scmId: z3.string()
|
|
829
|
-
})
|
|
830
|
-
})
|
|
831
|
-
);
|
|
832
|
-
var FixRatingZ = z3.object({
|
|
833
|
-
voteScore: z3.number(),
|
|
834
|
-
fixRatingTag: z3.nativeEnum(Fix_Rating_Tag_Enum).nullable().default(null),
|
|
835
|
-
comment: z3.string().nullable().default(null),
|
|
836
|
-
updatedDate: z3.string().nullable(),
|
|
837
|
-
user: z3.object({
|
|
838
|
-
email: z3.string(),
|
|
839
|
-
name: z3.string()
|
|
840
|
-
})
|
|
1107
|
+
// src/features/analysis/scm/shared/src/types/types.ts
|
|
1108
|
+
var OrganizationScreenQueryParamsZ = z7.object({
|
|
1109
|
+
organizationId: z7.string().uuid()
|
|
841
1110
|
});
|
|
842
|
-
var
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
scmSubmitFixRequests: ScmSubmitFixRequestsZ,
|
|
846
|
-
fixRatings: z3.array(FixRatingZ).default([])
|
|
847
|
-
}).nullish().transform(
|
|
848
|
-
(data) => data ? data : {
|
|
849
|
-
state: "Ready" /* Ready */,
|
|
850
|
-
isArchived: false,
|
|
851
|
-
scmSubmitFixRequests: [],
|
|
852
|
-
fixRatings: []
|
|
853
|
-
}
|
|
854
|
-
);
|
|
855
|
-
var OrganizationScreenQueryParamsZ = z3.object({
|
|
856
|
-
organizationId: z3.string().uuid()
|
|
857
|
-
});
|
|
858
|
-
var ParsedSeverityZ = z3.nativeEnum(Vulnerability_Severity_Enum).nullish().transform((i) => i ?? "low" /* Low */);
|
|
859
|
-
var ProjectPageQueryParamsZ = z3.object({
|
|
860
|
-
organizationId: z3.string().uuid(),
|
|
861
|
-
projectId: z3.string().uuid()
|
|
1111
|
+
var ProjectPageQueryParamsZ = z7.object({
|
|
1112
|
+
organizationId: z7.string().uuid(),
|
|
1113
|
+
projectId: z7.string().uuid()
|
|
862
1114
|
});
|
|
863
1115
|
var AnalysisPageQueryParamsZ = ProjectPageQueryParamsZ.extend({
|
|
864
|
-
reportId:
|
|
1116
|
+
reportId: z7.string().uuid()
|
|
865
1117
|
});
|
|
866
1118
|
var FixPageQueryParamsZ = AnalysisPageQueryParamsZ.extend({
|
|
867
|
-
fixId:
|
|
1119
|
+
fixId: z7.string().uuid()
|
|
868
1120
|
});
|
|
869
1121
|
var IssuePageQueryParamsZ = AnalysisPageQueryParamsZ.extend({
|
|
870
|
-
issueId:
|
|
1122
|
+
issueId: z7.string().uuid()
|
|
871
1123
|
});
|
|
872
|
-
var CliLoginPageQueryParamsZ =
|
|
873
|
-
loginId:
|
|
1124
|
+
var CliLoginPageQueryParamsZ = z7.object({
|
|
1125
|
+
loginId: z7.string().uuid()
|
|
874
1126
|
});
|
|
875
|
-
var AnalysisReportDigestedZ =
|
|
876
|
-
id:
|
|
877
|
-
state:
|
|
878
|
-
vulnerabilityReport:
|
|
879
|
-
reportSummaryUrl:
|
|
880
|
-
scanDate:
|
|
881
|
-
supported:
|
|
882
|
-
aggregate:
|
|
883
|
-
count:
|
|
1127
|
+
var AnalysisReportDigestedZ = z7.object({
|
|
1128
|
+
id: z7.string().uuid(),
|
|
1129
|
+
state: z7.nativeEnum(Fix_Report_State_Enum),
|
|
1130
|
+
vulnerabilityReport: z7.object({
|
|
1131
|
+
reportSummaryUrl: z7.string().url().nullish(),
|
|
1132
|
+
scanDate: z7.string().nullable(),
|
|
1133
|
+
supported: z7.object({
|
|
1134
|
+
aggregate: z7.object({
|
|
1135
|
+
count: z7.number()
|
|
884
1136
|
})
|
|
885
1137
|
}),
|
|
886
|
-
all:
|
|
887
|
-
aggregate:
|
|
888
|
-
count:
|
|
1138
|
+
all: z7.object({
|
|
1139
|
+
aggregate: z7.object({
|
|
1140
|
+
count: z7.number()
|
|
889
1141
|
})
|
|
890
1142
|
}),
|
|
891
|
-
vendor:
|
|
892
|
-
project:
|
|
893
|
-
organizationId:
|
|
1143
|
+
vendor: z7.nativeEnum(Vulnerability_Report_Vendor_Enum),
|
|
1144
|
+
project: z7.object({
|
|
1145
|
+
organizationId: z7.string().uuid()
|
|
894
1146
|
})
|
|
895
1147
|
})
|
|
896
1148
|
});
|
|
897
|
-
var ReportQueryResultZ =
|
|
898
|
-
fixReport_by_pk:
|
|
899
|
-
id:
|
|
900
|
-
analysisUrl:
|
|
901
|
-
fixesCommitted:
|
|
902
|
-
aggregate:
|
|
1149
|
+
var ReportQueryResultZ = z7.object({
|
|
1150
|
+
fixReport_by_pk: z7.object({
|
|
1151
|
+
id: z7.string().uuid(),
|
|
1152
|
+
analysisUrl: z7.string(),
|
|
1153
|
+
fixesCommitted: z7.object({
|
|
1154
|
+
aggregate: z7.object({ count: z7.number() })
|
|
903
1155
|
}),
|
|
904
|
-
fixesDownloaded:
|
|
905
|
-
aggregate:
|
|
1156
|
+
fixesDownloaded: z7.object({
|
|
1157
|
+
aggregate: z7.object({ count: z7.number() })
|
|
906
1158
|
}),
|
|
907
|
-
fixesDoneCount:
|
|
908
|
-
fixesInprogressCount:
|
|
909
|
-
fixesReadyCount:
|
|
910
|
-
issueTypes:
|
|
911
|
-
issueLanguages:
|
|
912
|
-
fixesCountByEffort:
|
|
913
|
-
vulnerabilitySeverities:
|
|
914
|
-
createdOn:
|
|
915
|
-
expirationOn:
|
|
916
|
-
state:
|
|
917
|
-
fixes_aggregate:
|
|
918
|
-
aggregate:
|
|
919
|
-
count:
|
|
1159
|
+
fixesDoneCount: z7.number(),
|
|
1160
|
+
fixesInprogressCount: z7.number(),
|
|
1161
|
+
fixesReadyCount: z7.number(),
|
|
1162
|
+
issueTypes: z7.record(z7.string(), z7.number()).nullable(),
|
|
1163
|
+
issueLanguages: z7.record(z7.string(), z7.number()).nullable(),
|
|
1164
|
+
fixesCountByEffort: z7.record(z7.string(), z7.number()).nullable(),
|
|
1165
|
+
vulnerabilitySeverities: z7.record(z7.string(), z7.number()).nullable(),
|
|
1166
|
+
createdOn: z7.string(),
|
|
1167
|
+
expirationOn: z7.string().nullable(),
|
|
1168
|
+
state: z7.nativeEnum(Fix_Report_State_Enum),
|
|
1169
|
+
fixes_aggregate: z7.object({
|
|
1170
|
+
aggregate: z7.object({
|
|
1171
|
+
count: z7.number()
|
|
920
1172
|
})
|
|
921
1173
|
}),
|
|
922
|
-
fixes:
|
|
923
|
-
|
|
924
|
-
id:
|
|
925
|
-
safeIssueLanguage:
|
|
926
|
-
safeIssueType:
|
|
927
|
-
confidence:
|
|
928
|
-
effortToApplyFix:
|
|
929
|
-
modifiedBy:
|
|
930
|
-
gitBlameLogin:
|
|
931
|
-
fixReportId:
|
|
932
|
-
filePaths:
|
|
933
|
-
|
|
934
|
-
fileRepoRelativePath:
|
|
1174
|
+
fixes: z7.array(
|
|
1175
|
+
z7.object({
|
|
1176
|
+
id: z7.string().uuid(),
|
|
1177
|
+
safeIssueLanguage: z7.string(),
|
|
1178
|
+
safeIssueType: z7.string(),
|
|
1179
|
+
confidence: z7.number(),
|
|
1180
|
+
effortToApplyFix: z7.nativeEnum(Effort_To_Apply_Fix_Enum).nullable(),
|
|
1181
|
+
modifiedBy: z7.string().nullable(),
|
|
1182
|
+
gitBlameLogin: z7.string().nullable(),
|
|
1183
|
+
fixReportId: z7.string().uuid(),
|
|
1184
|
+
filePaths: z7.array(
|
|
1185
|
+
z7.object({
|
|
1186
|
+
fileRepoRelativePath: z7.string()
|
|
935
1187
|
})
|
|
936
1188
|
),
|
|
937
1189
|
sharedState: FixSharedStateZ,
|
|
938
|
-
numberOfVulnerabilityIssues:
|
|
939
|
-
severityText:
|
|
940
|
-
vulnerabilityReportIssues:
|
|
941
|
-
|
|
942
|
-
id:
|
|
943
|
-
issueType:
|
|
944
|
-
issueLanguage:
|
|
1190
|
+
numberOfVulnerabilityIssues: z7.number(),
|
|
1191
|
+
severityText: z7.nativeEnum(Vulnerability_Severity_Enum),
|
|
1192
|
+
vulnerabilityReportIssues: z7.array(
|
|
1193
|
+
z7.object({
|
|
1194
|
+
id: z7.string().uuid(),
|
|
1195
|
+
issueType: z7.string(),
|
|
1196
|
+
issueLanguage: z7.string()
|
|
945
1197
|
})
|
|
946
1198
|
)
|
|
947
1199
|
// scmSubmitFixRequests: ScmSubmitFixRequestsZ,
|
|
948
1200
|
})
|
|
949
1201
|
),
|
|
950
|
-
repo:
|
|
951
|
-
name:
|
|
952
|
-
originalUrl:
|
|
953
|
-
reference:
|
|
954
|
-
commitSha:
|
|
955
|
-
isKnownBranch:
|
|
1202
|
+
repo: z7.object({
|
|
1203
|
+
name: z7.string().nullable(),
|
|
1204
|
+
originalUrl: z7.string(),
|
|
1205
|
+
reference: z7.string(),
|
|
1206
|
+
commitSha: z7.string(),
|
|
1207
|
+
isKnownBranch: z7.boolean().nullish().default(true)
|
|
956
1208
|
}),
|
|
957
|
-
vulnerabilityReport:
|
|
958
|
-
reportSummaryUrl:
|
|
959
|
-
vendor:
|
|
960
|
-
issuesWithKnownLanguage:
|
|
961
|
-
scanDate:
|
|
962
|
-
vendorReportId:
|
|
963
|
-
projectId:
|
|
964
|
-
project:
|
|
965
|
-
organizationId:
|
|
1209
|
+
vulnerabilityReport: z7.object({
|
|
1210
|
+
reportSummaryUrl: z7.string().url().nullish(),
|
|
1211
|
+
vendor: z7.nativeEnum(Vulnerability_Report_Vendor_Enum).nullable(),
|
|
1212
|
+
issuesWithKnownLanguage: z7.number().nullable(),
|
|
1213
|
+
scanDate: z7.string().nullable(),
|
|
1214
|
+
vendorReportId: z7.string().uuid().nullable(),
|
|
1215
|
+
projectId: z7.string().uuid(),
|
|
1216
|
+
project: z7.object({
|
|
1217
|
+
organizationId: z7.string().uuid()
|
|
1218
|
+
}),
|
|
1219
|
+
file: z7.object({
|
|
1220
|
+
id: z7.string().uuid(),
|
|
1221
|
+
path: z7.string()
|
|
1222
|
+
}),
|
|
1223
|
+
pending: z7.object({
|
|
1224
|
+
aggregate: z7.object({
|
|
1225
|
+
count: z7.number()
|
|
1226
|
+
})
|
|
966
1227
|
}),
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
1228
|
+
irrelevant: z7.object({
|
|
1229
|
+
aggregate: z7.object({
|
|
1230
|
+
count: z7.number()
|
|
1231
|
+
})
|
|
970
1232
|
}),
|
|
971
|
-
|
|
972
|
-
aggregate:
|
|
973
|
-
count:
|
|
1233
|
+
remaining: z7.object({
|
|
1234
|
+
aggregate: z7.object({
|
|
1235
|
+
count: z7.number()
|
|
974
1236
|
})
|
|
975
1237
|
}),
|
|
976
|
-
|
|
977
|
-
aggregate:
|
|
978
|
-
count:
|
|
1238
|
+
digested: z7.object({
|
|
1239
|
+
aggregate: z7.object({
|
|
1240
|
+
count: z7.number()
|
|
979
1241
|
})
|
|
980
1242
|
}),
|
|
981
|
-
|
|
982
|
-
aggregate:
|
|
983
|
-
count:
|
|
1243
|
+
supported: z7.object({
|
|
1244
|
+
aggregate: z7.object({
|
|
1245
|
+
count: z7.number()
|
|
984
1246
|
})
|
|
985
1247
|
}),
|
|
986
|
-
all:
|
|
987
|
-
aggregate:
|
|
988
|
-
count:
|
|
1248
|
+
all: z7.object({
|
|
1249
|
+
aggregate: z7.object({
|
|
1250
|
+
count: z7.number()
|
|
989
1251
|
})
|
|
990
1252
|
}),
|
|
991
|
-
fixable:
|
|
992
|
-
aggregate:
|
|
993
|
-
count:
|
|
1253
|
+
fixable: z7.object({
|
|
1254
|
+
aggregate: z7.object({
|
|
1255
|
+
count: z7.number()
|
|
994
1256
|
})
|
|
995
1257
|
}),
|
|
996
|
-
errors:
|
|
997
|
-
aggregate:
|
|
998
|
-
count:
|
|
1258
|
+
errors: z7.object({
|
|
1259
|
+
aggregate: z7.object({
|
|
1260
|
+
count: z7.number()
|
|
999
1261
|
})
|
|
1000
1262
|
}),
|
|
1001
|
-
vulnerabilityReportIssues:
|
|
1002
|
-
id:
|
|
1003
|
-
extraData:
|
|
1004
|
-
missing_files:
|
|
1005
|
-
large_files:
|
|
1006
|
-
error_files:
|
|
1263
|
+
vulnerabilityReportIssues: z7.object({
|
|
1264
|
+
id: z7.string().uuid(),
|
|
1265
|
+
extraData: z7.object({
|
|
1266
|
+
missing_files: z7.string().array().nullish(),
|
|
1267
|
+
large_files: z7.string().array().nullish(),
|
|
1268
|
+
error_files: z7.string().array().nullish()
|
|
1007
1269
|
})
|
|
1008
1270
|
}).array()
|
|
1009
1271
|
})
|
|
1010
1272
|
})
|
|
1011
1273
|
});
|
|
1012
|
-
var ReportFixesQueryFixZ =
|
|
1013
|
-
id:
|
|
1274
|
+
var ReportFixesQueryFixZ = z7.object({
|
|
1275
|
+
id: z7.string().uuid(),
|
|
1014
1276
|
sharedState: FixSharedStateZ,
|
|
1015
|
-
confidence:
|
|
1016
|
-
gitBlameLogin:
|
|
1017
|
-
effortToApplyFix:
|
|
1018
|
-
safeIssueLanguage:
|
|
1019
|
-
safeIssueType:
|
|
1020
|
-
fixReportId:
|
|
1021
|
-
filePaths:
|
|
1022
|
-
|
|
1023
|
-
fileRepoRelativePath:
|
|
1277
|
+
confidence: z7.number(),
|
|
1278
|
+
gitBlameLogin: z7.string().nullable(),
|
|
1279
|
+
effortToApplyFix: z7.nativeEnum(Effort_To_Apply_Fix_Enum).nullable(),
|
|
1280
|
+
safeIssueLanguage: z7.string(),
|
|
1281
|
+
safeIssueType: z7.string(),
|
|
1282
|
+
fixReportId: z7.string().uuid(),
|
|
1283
|
+
filePaths: z7.array(
|
|
1284
|
+
z7.object({
|
|
1285
|
+
fileRepoRelativePath: z7.string()
|
|
1024
1286
|
})
|
|
1025
1287
|
),
|
|
1026
|
-
numberOfVulnerabilityIssues:
|
|
1027
|
-
severityText:
|
|
1028
|
-
vulnerabilityReportIssues:
|
|
1029
|
-
|
|
1030
|
-
issueType:
|
|
1031
|
-
issueLanguage:
|
|
1288
|
+
numberOfVulnerabilityIssues: z7.number(),
|
|
1289
|
+
severityText: z7.nativeEnum(Vulnerability_Severity_Enum),
|
|
1290
|
+
vulnerabilityReportIssues: z7.array(
|
|
1291
|
+
z7.object({
|
|
1292
|
+
issueType: z7.string(),
|
|
1293
|
+
issueLanguage: z7.string()
|
|
1032
1294
|
})
|
|
1033
1295
|
).min(1)
|
|
1034
1296
|
});
|
|
1035
|
-
var
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1297
|
+
var VulnerabilityReportIssueZ = z7.object({
|
|
1298
|
+
id: z7.string().uuid(),
|
|
1299
|
+
createdAt: z7.string(),
|
|
1300
|
+
state: z7.nativeEnum(Vulnerability_Report_Issue_State_Enum),
|
|
1301
|
+
safeIssueType: z7.string(),
|
|
1302
|
+
safeIssueLanguage: z7.string(),
|
|
1303
|
+
extraData: z7.object({
|
|
1304
|
+
missing_files: z7.string().array().nullish(),
|
|
1305
|
+
large_files: z7.string().array().nullish(),
|
|
1306
|
+
error_files: z7.string().array().nullish()
|
|
1307
|
+
}),
|
|
1308
|
+
fix: ReportFixesQueryFixZ.nullable(),
|
|
1309
|
+
falsePositive: z7.object({
|
|
1310
|
+
id: z7.string().uuid()
|
|
1311
|
+
}).nullable(),
|
|
1312
|
+
parsedSeverity: ParsedSeverityZ,
|
|
1313
|
+
severity: z7.string(),
|
|
1314
|
+
severityValue: z7.number(),
|
|
1315
|
+
codeNodes: z7.array(z7.object({ path: z7.string() })),
|
|
1316
|
+
vulnerabilityReportIssueTags: z7.array(
|
|
1317
|
+
z7.object({
|
|
1318
|
+
vulnerability_report_issue_tag_value: z7.string()
|
|
1043
1319
|
})
|
|
1044
1320
|
)
|
|
1045
1321
|
});
|
|
1046
|
-
var
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
language: z3.nativeEnum(Language),
|
|
1054
|
-
lib: PackageInfoZ,
|
|
1055
|
-
typesLib: PackageInfoZ.nullable()
|
|
1056
|
-
});
|
|
1057
|
-
var FixExtraContextZ = z3.object({
|
|
1058
|
-
fixDescription: z3.string(),
|
|
1059
|
-
manifestActionsRequired: z3.array(ManifestActionRequiredZ),
|
|
1060
|
-
extraContext: z3.array(ExtraContextInternalZ)
|
|
1061
|
-
});
|
|
1062
|
-
var PatchAndQuestionsZ = z3.object({
|
|
1063
|
-
__typename: z3.literal("FixData"),
|
|
1064
|
-
patch: z3.string(),
|
|
1065
|
-
patchOriginalEncodingBase64: z3.string(),
|
|
1066
|
-
questions: z3.array(
|
|
1067
|
-
z3.object({
|
|
1068
|
-
name: z3.string(),
|
|
1069
|
-
key: z3.string(),
|
|
1070
|
-
index: z3.number(),
|
|
1071
|
-
defaultValue: z3.string(),
|
|
1072
|
-
value: z3.string().nullable(),
|
|
1073
|
-
extraContext: z3.array(ExtraContextInternalZ),
|
|
1074
|
-
inputType: z3.nativeEnum(FixQuestionInputType),
|
|
1075
|
-
options: z3.array(z3.string())
|
|
1076
|
-
})
|
|
1077
|
-
),
|
|
1078
|
-
extraContext: FixExtraContextZ
|
|
1079
|
-
});
|
|
1080
|
-
var FixQueryZ = z3.object({
|
|
1081
|
-
__typename: z3.literal("fix").optional(),
|
|
1082
|
-
id: z3.string().uuid(),
|
|
1083
|
-
sharedState: FixSharedStateZ,
|
|
1084
|
-
modifiedBy: z3.string().nullable(),
|
|
1085
|
-
gitBlameLogin: z3.string().nullable(),
|
|
1086
|
-
safeIssueLanguage: z3.string(),
|
|
1087
|
-
safeIssueType: z3.string(),
|
|
1088
|
-
confidence: z3.number(),
|
|
1089
|
-
fixReportId: z3.string().uuid(),
|
|
1090
|
-
isExpired: z3.boolean().default(false),
|
|
1091
|
-
fixFiles: z3.array(
|
|
1092
|
-
z3.object({
|
|
1093
|
-
fileRepoRelativePath: z3.string()
|
|
1094
|
-
})
|
|
1095
|
-
),
|
|
1096
|
-
numberOfVulnerabilityIssues: z3.number(),
|
|
1097
|
-
severityText: z3.nativeEnum(Vulnerability_Severity_Enum),
|
|
1098
|
-
vulnerabilityReportIssues: z3.array(
|
|
1099
|
-
z3.object({
|
|
1100
|
-
vendorIssueId: z3.string(),
|
|
1101
|
-
issueLanguage: z3.string()
|
|
1102
|
-
})
|
|
1103
|
-
),
|
|
1104
|
-
patchAndQuestions: PatchAndQuestionsZ,
|
|
1105
|
-
effortToApplyFix: z3.nativeEnum(Effort_To_Apply_Fix_Enum).nullable()
|
|
1106
|
-
});
|
|
1107
|
-
var GetReportIssuesQueryZ = z3.object({
|
|
1108
|
-
fixReport: z3.object({
|
|
1109
|
-
vulnerabilityReport: z3.object({
|
|
1110
|
-
id: z3.string().uuid(),
|
|
1111
|
-
lastIssueUpdatedAt: z3.string(),
|
|
1112
|
-
vulnerabilityReportIssues_aggregate: z3.object({
|
|
1113
|
-
aggregate: z3.object({ count: z3.number() })
|
|
1322
|
+
var GetReportIssuesQueryZ = z7.object({
|
|
1323
|
+
fixReport: z7.object({
|
|
1324
|
+
vulnerabilityReport: z7.object({
|
|
1325
|
+
id: z7.string().uuid(),
|
|
1326
|
+
lastIssueUpdatedAt: z7.string(),
|
|
1327
|
+
vulnerabilityReportIssues_aggregate: z7.object({
|
|
1328
|
+
aggregate: z7.object({ count: z7.number() })
|
|
1114
1329
|
}),
|
|
1115
|
-
vulnerabilityReportIssues:
|
|
1116
|
-
z3.object({
|
|
1117
|
-
id: z3.string().uuid(),
|
|
1118
|
-
createdAt: z3.string(),
|
|
1119
|
-
issueType: z3.string(),
|
|
1120
|
-
issueLanguage: z3.string(),
|
|
1121
|
-
state: z3.nativeEnum(Vulnerability_Report_Issue_State_Enum),
|
|
1122
|
-
extraData: z3.object({
|
|
1123
|
-
missing_files: z3.string().array().nullish(),
|
|
1124
|
-
large_files: z3.string().array().nullish(),
|
|
1125
|
-
error_files: z3.string().array().nullish()
|
|
1126
|
-
}),
|
|
1127
|
-
fix: ReportFixesQueryFixZ.nullable(),
|
|
1128
|
-
falsePositive: z3.object({
|
|
1129
|
-
id: z3.string().uuid()
|
|
1130
|
-
}).nullable(),
|
|
1131
|
-
parsedIssueType: z3.nativeEnum(IssueType_Enum),
|
|
1132
|
-
parsedIssueLanguage: z3.nativeEnum(IssueLanguage_Enum),
|
|
1133
|
-
parsedSeverity: z3.nativeEnum(Vulnerability_Severity_Enum),
|
|
1134
|
-
severity: z3.string(),
|
|
1135
|
-
severityValue: z3.number(),
|
|
1136
|
-
vulnerabilityReportIssueTags: z3.array(
|
|
1137
|
-
z3.object({
|
|
1138
|
-
vulnerability_report_issue_tag_value: z3.string()
|
|
1139
|
-
})
|
|
1140
|
-
)
|
|
1141
|
-
})
|
|
1142
|
-
)
|
|
1330
|
+
vulnerabilityReportIssues: z7.array(VulnerabilityReportIssueZ)
|
|
1143
1331
|
})
|
|
1144
1332
|
}).array()
|
|
1145
1333
|
}).nullish();
|
|
1146
|
-
var
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
state: z3.nativeEnum(Fix_Report_State_Enum),
|
|
1152
|
-
fixes_aggregate: z3.object({
|
|
1153
|
-
aggregate: z3.object({
|
|
1154
|
-
count: z3.number()
|
|
1155
|
-
})
|
|
1156
|
-
}),
|
|
1157
|
-
repo: z3.object({
|
|
1158
|
-
name: z3.string().nullable(),
|
|
1159
|
-
originalUrl: z3.string(),
|
|
1160
|
-
reference: z3.string(),
|
|
1161
|
-
commitSha: z3.string()
|
|
1162
|
-
}),
|
|
1163
|
-
vulnerabilityReport: z3.object({
|
|
1164
|
-
vendor: z3.nativeEnum(Vulnerability_Report_Vendor_Enum),
|
|
1165
|
-
vendorReportId: z3.string().uuid().nullable(),
|
|
1166
|
-
projectId: z3.string().uuid(),
|
|
1167
|
-
project: z3.object({
|
|
1168
|
-
organizationId: z3.string().uuid()
|
|
1169
|
-
}),
|
|
1170
|
-
file: z3.object({
|
|
1171
|
-
id: z3.string().uuid(),
|
|
1172
|
-
path: z3.string()
|
|
1173
|
-
}),
|
|
1174
|
-
pending: z3.object({
|
|
1175
|
-
aggregate: z3.object({
|
|
1176
|
-
count: z3.number()
|
|
1177
|
-
})
|
|
1178
|
-
}),
|
|
1179
|
-
supported: z3.object({
|
|
1180
|
-
aggregate: z3.object({
|
|
1181
|
-
count: z3.number()
|
|
1182
|
-
})
|
|
1183
|
-
}),
|
|
1184
|
-
all: z3.object({
|
|
1185
|
-
aggregate: z3.object({
|
|
1186
|
-
count: z3.number()
|
|
1187
|
-
})
|
|
1188
|
-
}),
|
|
1189
|
-
fixable: z3.object({
|
|
1190
|
-
aggregate: z3.object({
|
|
1191
|
-
count: z3.number()
|
|
1192
|
-
})
|
|
1193
|
-
}),
|
|
1194
|
-
errors: z3.object({
|
|
1195
|
-
aggregate: z3.object({
|
|
1196
|
-
count: z3.number()
|
|
1197
|
-
})
|
|
1198
|
-
}),
|
|
1199
|
-
vulnerabilityReportIssues: z3.object({
|
|
1200
|
-
extraData: z3.object({
|
|
1201
|
-
missing_files: z3.string().array().nullish(),
|
|
1202
|
-
large_files: z3.string().array().nullish(),
|
|
1203
|
-
error_files: z3.string().array().nullish()
|
|
1334
|
+
var FixReportByProjectZ = z7.object({
|
|
1335
|
+
project_by_pk: z7.object({
|
|
1336
|
+
vulnerabilityReports: z7.array(
|
|
1337
|
+
z7.object({
|
|
1338
|
+
fixReport: z7.object({ id: z7.string().uuid() }).nullable()
|
|
1204
1339
|
})
|
|
1205
|
-
|
|
1340
|
+
)
|
|
1206
1341
|
})
|
|
1207
1342
|
});
|
|
1208
|
-
var FixScreenQueryResultZ =
|
|
1343
|
+
var FixScreenQueryResultZ = z7.object({
|
|
1209
1344
|
fixReport_by_pk: FixPageFixReportZ,
|
|
1210
|
-
fix_by_pk:
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
vendorIssueId: z3.string(),
|
|
1216
|
-
issueType: z3.string(),
|
|
1217
|
-
issueLanguage: z3.string()
|
|
1218
|
-
})
|
|
1219
|
-
)
|
|
1345
|
+
fix_by_pk: FixPartsForFixScreenZ,
|
|
1346
|
+
fixesWithSameIssueType: z7.array(
|
|
1347
|
+
z7.object({
|
|
1348
|
+
id: z7.string().uuid(),
|
|
1349
|
+
sharedState: z7.object({ state: z7.nativeEnum(Fix_State_Enum) }).nullable().default({ state: "Ready" /* Ready */ })
|
|
1220
1350
|
})
|
|
1221
1351
|
),
|
|
1222
|
-
|
|
1223
|
-
z3.object({
|
|
1224
|
-
id: z3.string().uuid(),
|
|
1225
|
-
sharedState: z3.object({ state: z3.nativeEnum(Fix_State_Enum) }).nullable().default({ state: "Ready" /* Ready */ })
|
|
1226
|
-
})
|
|
1227
|
-
)
|
|
1228
|
-
});
|
|
1229
|
-
var FixReportByProjectZ = z3.object({
|
|
1230
|
-
project_by_pk: z3.object({
|
|
1231
|
-
vulnerabilityReports: z3.array(
|
|
1232
|
-
z3.object({
|
|
1233
|
-
fixReport: z3.object({ id: z3.string().uuid() }).nullable()
|
|
1234
|
-
})
|
|
1235
|
-
)
|
|
1236
|
-
})
|
|
1352
|
+
relevantIssue: IssuePartsZ.nullish()
|
|
1237
1353
|
});
|
|
1238
|
-
var FixPageQueryZ =
|
|
1354
|
+
var FixPageQueryZ = z7.object({
|
|
1239
1355
|
data: FixScreenQueryResultZ
|
|
1240
1356
|
});
|
|
1241
|
-
var GetReportFixesQueryZ =
|
|
1242
|
-
fixReport:
|
|
1243
|
-
|
|
1244
|
-
fixes:
|
|
1245
|
-
fixes_aggregate:
|
|
1246
|
-
aggregate:
|
|
1357
|
+
var GetReportFixesQueryZ = z7.object({
|
|
1358
|
+
fixReport: z7.array(
|
|
1359
|
+
z7.object({
|
|
1360
|
+
fixes: z7.array(ReportFixesQueryFixZ),
|
|
1361
|
+
fixes_aggregate: z7.object({
|
|
1362
|
+
aggregate: z7.object({ count: z7.number() })
|
|
1247
1363
|
}),
|
|
1248
|
-
vulnerabilityReportIssuesTotalCount:
|
|
1249
|
-
vulnerabilityReportIssues_aggregate:
|
|
1250
|
-
aggregate:
|
|
1364
|
+
vulnerabilityReportIssuesTotalCount: z7.object({
|
|
1365
|
+
vulnerabilityReportIssues_aggregate: z7.object({
|
|
1366
|
+
aggregate: z7.object({ count: z7.number() })
|
|
1251
1367
|
})
|
|
1252
1368
|
}),
|
|
1253
|
-
vulnerabilityReportIssuesFixedCount:
|
|
1254
|
-
vulnerabilityReportIssues_aggregate:
|
|
1255
|
-
aggregate:
|
|
1369
|
+
vulnerabilityReportIssuesFixedCount: z7.object({
|
|
1370
|
+
vulnerabilityReportIssues_aggregate: z7.object({
|
|
1371
|
+
aggregate: z7.object({ count: z7.number() })
|
|
1256
1372
|
})
|
|
1257
1373
|
}),
|
|
1258
|
-
vulnerabilityReportIssuesIrrelevantCount:
|
|
1259
|
-
vulnerabilityReportIssues_aggregate:
|
|
1260
|
-
aggregate:
|
|
1374
|
+
vulnerabilityReportIssuesIrrelevantCount: z7.object({
|
|
1375
|
+
vulnerabilityReportIssues_aggregate: z7.object({
|
|
1376
|
+
aggregate: z7.object({ count: z7.number() })
|
|
1261
1377
|
})
|
|
1262
1378
|
}),
|
|
1263
|
-
vulnerabilityReportIssuesRemainingCount:
|
|
1264
|
-
vulnerabilityReportIssues_aggregate:
|
|
1265
|
-
aggregate:
|
|
1379
|
+
vulnerabilityReportIssuesRemainingCount: z7.object({
|
|
1380
|
+
vulnerabilityReportIssues_aggregate: z7.object({
|
|
1381
|
+
aggregate: z7.object({ count: z7.number() })
|
|
1266
1382
|
})
|
|
1267
1383
|
})
|
|
1268
1384
|
})
|
|
1269
1385
|
)
|
|
1270
1386
|
}).nullish();
|
|
1271
|
-
var ProjectVulnerabilityReport =
|
|
1272
|
-
id:
|
|
1273
|
-
name:
|
|
1274
|
-
vendor:
|
|
1275
|
-
fixReport:
|
|
1276
|
-
id:
|
|
1277
|
-
createdOn:
|
|
1278
|
-
fixes_aggregate:
|
|
1279
|
-
aggregate:
|
|
1280
|
-
count:
|
|
1387
|
+
var ProjectVulnerabilityReport = z7.object({
|
|
1388
|
+
id: z7.string().uuid(),
|
|
1389
|
+
name: z7.string().nullable(),
|
|
1390
|
+
vendor: z7.nativeEnum(Vulnerability_Report_Vendor_Enum).nullable(),
|
|
1391
|
+
fixReport: z7.object({
|
|
1392
|
+
id: z7.string().uuid(),
|
|
1393
|
+
createdOn: z7.string(),
|
|
1394
|
+
fixes_aggregate: z7.object({
|
|
1395
|
+
aggregate: z7.object({
|
|
1396
|
+
count: z7.number()
|
|
1281
1397
|
})
|
|
1282
1398
|
}),
|
|
1283
|
-
issueTypes:
|
|
1284
|
-
issueLanguages:
|
|
1285
|
-
fixesCountByEffort:
|
|
1286
|
-
vulnerabilitySeverities:
|
|
1287
|
-
fixesDoneCount:
|
|
1288
|
-
fixesInprogressCount:
|
|
1289
|
-
fixesReadyCount:
|
|
1290
|
-
repo:
|
|
1291
|
-
originalUrl:
|
|
1292
|
-
reference:
|
|
1293
|
-
name:
|
|
1399
|
+
issueTypes: z7.record(z7.string(), z7.number()).nullable(),
|
|
1400
|
+
issueLanguages: z7.record(z7.nativeEnum(IssueLanguage_Enum), z7.number()).nullable(),
|
|
1401
|
+
fixesCountByEffort: z7.record(z7.nativeEnum(Effort_To_Apply_Fix_Enum), z7.number()).nullable(),
|
|
1402
|
+
vulnerabilitySeverities: z7.record(z7.nativeEnum(Vulnerability_Severity_Enum), z7.number()).nullable(),
|
|
1403
|
+
fixesDoneCount: z7.number(),
|
|
1404
|
+
fixesInprogressCount: z7.number(),
|
|
1405
|
+
fixesReadyCount: z7.number(),
|
|
1406
|
+
repo: z7.object({
|
|
1407
|
+
originalUrl: z7.string(),
|
|
1408
|
+
reference: z7.string(),
|
|
1409
|
+
name: z7.string()
|
|
1294
1410
|
}),
|
|
1295
|
-
createdByUser:
|
|
1296
|
-
email:
|
|
1411
|
+
createdByUser: z7.object({
|
|
1412
|
+
email: z7.string()
|
|
1297
1413
|
}).nullable(),
|
|
1298
|
-
state:
|
|
1299
|
-
expirationOn:
|
|
1414
|
+
state: z7.nativeEnum(Fix_Report_State_Enum),
|
|
1415
|
+
expirationOn: z7.string()
|
|
1300
1416
|
})
|
|
1301
1417
|
});
|
|
1302
|
-
var ProjectGetProjectZ =
|
|
1303
|
-
id:
|
|
1304
|
-
name:
|
|
1305
|
-
vulnerabilityReports:
|
|
1306
|
-
vendor:
|
|
1307
|
-
fixReport:
|
|
1308
|
-
issueLanguages:
|
|
1309
|
-
state:
|
|
1310
|
-
fixes_aggregate:
|
|
1311
|
-
aggregate:
|
|
1312
|
-
count:
|
|
1418
|
+
var ProjectGetProjectZ = z7.object({
|
|
1419
|
+
id: z7.string().uuid(),
|
|
1420
|
+
name: z7.string(),
|
|
1421
|
+
vulnerabilityReports: z7.object({
|
|
1422
|
+
vendor: z7.nativeEnum(Vulnerability_Report_Vendor_Enum).nullable(),
|
|
1423
|
+
fixReport: z7.object({
|
|
1424
|
+
issueLanguages: z7.record(z7.nativeEnum(IssueLanguage_Enum), z7.number()).nullable(),
|
|
1425
|
+
state: z7.nativeEnum(Fix_Report_State_Enum),
|
|
1426
|
+
fixes_aggregate: z7.object({
|
|
1427
|
+
aggregate: z7.object({
|
|
1428
|
+
count: z7.number()
|
|
1313
1429
|
})
|
|
1314
1430
|
}),
|
|
1315
|
-
repo:
|
|
1316
|
-
originalUrl:
|
|
1317
|
-
reference:
|
|
1431
|
+
repo: z7.object({
|
|
1432
|
+
originalUrl: z7.string(),
|
|
1433
|
+
reference: z7.string()
|
|
1318
1434
|
}),
|
|
1319
|
-
expirationOn:
|
|
1435
|
+
expirationOn: z7.string()
|
|
1320
1436
|
})
|
|
1321
1437
|
}).array()
|
|
1322
1438
|
});
|
|
1323
|
-
var GetProjectsQueryZ =
|
|
1324
|
-
var ProjectPageQueryResultZ =
|
|
1325
|
-
name:
|
|
1326
|
-
id:
|
|
1327
|
-
isDefault:
|
|
1328
|
-
organizationId:
|
|
1329
|
-
vulnerabilityReports:
|
|
1330
|
-
projectIssueTypeSettings:
|
|
1331
|
-
IssueTypeSettingZ.merge(
|
|
1439
|
+
var GetProjectsQueryZ = z7.array(ProjectGetProjectZ);
|
|
1440
|
+
var ProjectPageQueryResultZ = z7.object({
|
|
1441
|
+
name: z7.string(),
|
|
1442
|
+
id: z7.string().uuid(),
|
|
1443
|
+
isDefault: z7.boolean().default(false),
|
|
1444
|
+
organizationId: z7.string().uuid(),
|
|
1445
|
+
vulnerabilityReports: z7.array(ProjectVulnerabilityReport),
|
|
1446
|
+
projectIssueTypeSettings: z7.array(
|
|
1447
|
+
IssueTypeSettingZ.merge(z7.object({ id: z7.string() }))
|
|
1332
1448
|
)
|
|
1333
1449
|
});
|
|
1334
|
-
var GetProjectMembersDataZ =
|
|
1335
|
-
project_by_pk:
|
|
1336
|
-
name:
|
|
1337
|
-
id:
|
|
1338
|
-
projectUsers:
|
|
1339
|
-
|
|
1340
|
-
projectToRole:
|
|
1341
|
-
projectRole:
|
|
1342
|
-
type:
|
|
1450
|
+
var GetProjectMembersDataZ = z7.object({
|
|
1451
|
+
project_by_pk: z7.object({
|
|
1452
|
+
name: z7.string(),
|
|
1453
|
+
id: z7.string(),
|
|
1454
|
+
projectUsers: z7.array(
|
|
1455
|
+
z7.object({
|
|
1456
|
+
projectToRole: z7.object({
|
|
1457
|
+
projectRole: z7.object({
|
|
1458
|
+
type: z7.nativeEnum(Project_Role_Type_Enum)
|
|
1343
1459
|
})
|
|
1344
1460
|
}),
|
|
1345
|
-
user:
|
|
1346
|
-
id:
|
|
1347
|
-
picture:
|
|
1348
|
-
name:
|
|
1349
|
-
email:
|
|
1461
|
+
user: z7.object({
|
|
1462
|
+
id: z7.string().uuid(),
|
|
1463
|
+
picture: z7.string().optional(),
|
|
1464
|
+
name: z7.string().nullish(),
|
|
1465
|
+
email: z7.string().email()
|
|
1350
1466
|
})
|
|
1351
1467
|
})
|
|
1352
1468
|
)
|
|
1353
1469
|
})
|
|
1354
1470
|
});
|
|
1355
|
-
var RepoArgsZ =
|
|
1356
|
-
originalUrl:
|
|
1357
|
-
branch:
|
|
1358
|
-
commitSha:
|
|
1471
|
+
var RepoArgsZ = z7.object({
|
|
1472
|
+
originalUrl: z7.string().url(),
|
|
1473
|
+
branch: z7.string(),
|
|
1474
|
+
commitSha: z7.string()
|
|
1359
1475
|
});
|
|
1360
1476
|
var scmCloudUrl = {
|
|
1361
1477
|
GitLab: "https://gitlab.com",
|
|
@@ -1397,12 +1513,12 @@ var scannerToVulnerability_Report_Vendor_Enum = {
|
|
|
1397
1513
|
[SCANNERS.Fortify]: "fortify" /* Fortify */,
|
|
1398
1514
|
[SCANNERS.Semgrep]: "semgrep" /* Semgrep */
|
|
1399
1515
|
};
|
|
1400
|
-
var SupportedScannersZ =
|
|
1401
|
-
var envVariablesSchema =
|
|
1402
|
-
WEB_APP_URL:
|
|
1403
|
-
API_URL:
|
|
1404
|
-
HASURA_ACCESS_KEY:
|
|
1405
|
-
LOCAL_GRAPHQL_ENDPOINT:
|
|
1516
|
+
var SupportedScannersZ = z8.enum([SCANNERS.Checkmarx, SCANNERS.Snyk]);
|
|
1517
|
+
var envVariablesSchema = z8.object({
|
|
1518
|
+
WEB_APP_URL: z8.string(),
|
|
1519
|
+
API_URL: z8.string(),
|
|
1520
|
+
HASURA_ACCESS_KEY: z8.string(),
|
|
1521
|
+
LOCAL_GRAPHQL_ENDPOINT: z8.string()
|
|
1406
1522
|
}).required();
|
|
1407
1523
|
var envVariables = envVariablesSchema.parse(process.env);
|
|
1408
1524
|
debug("config %o", envVariables);
|
|
@@ -1554,7 +1670,7 @@ import { createSpinner as createSpinner4 } from "nanospinner";
|
|
|
1554
1670
|
import fetch4 from "node-fetch";
|
|
1555
1671
|
import open2 from "open";
|
|
1556
1672
|
import tmp2 from "tmp";
|
|
1557
|
-
import { z as
|
|
1673
|
+
import { z as z30 } from "zod";
|
|
1558
1674
|
|
|
1559
1675
|
// src/features/analysis/add_fix_comments_for_pr/add_fix_comments_for_pr.ts
|
|
1560
1676
|
import Debug8 from "debug";
|
|
@@ -1595,10 +1711,10 @@ var RepoNoTokenAccessError = class extends Error {
|
|
|
1595
1711
|
};
|
|
1596
1712
|
|
|
1597
1713
|
// src/features/analysis/scm/types.ts
|
|
1598
|
-
import { z as
|
|
1714
|
+
import { z as z14 } from "zod";
|
|
1599
1715
|
|
|
1600
1716
|
// src/features/analysis/scm/shared/src/commitDescriptionMarkup.ts
|
|
1601
|
-
import { z as
|
|
1717
|
+
import { z as z9 } from "zod";
|
|
1602
1718
|
|
|
1603
1719
|
// src/features/analysis/scm/shared/src/fixDetailsData.ts
|
|
1604
1720
|
var fixDetailsData = {
|
|
@@ -1862,7 +1978,7 @@ var getCommitDescription = ({
|
|
|
1862
1978
|
)}**.
|
|
1863
1979
|
|
|
1864
1980
|
`;
|
|
1865
|
-
const parseIssueTypeRes =
|
|
1981
|
+
const parseIssueTypeRes = z9.nativeEnum(IssueType_Enum).safeParse(issueType);
|
|
1866
1982
|
if (issueType && parseIssueTypeRes.success) {
|
|
1867
1983
|
const staticData = fixDetailsData[parseIssueTypeRes.data];
|
|
1868
1984
|
if (staticData) {
|
|
@@ -1887,10 +2003,10 @@ ${guidances.map(({ guidance }) => `## Additional actions required
|
|
|
1887
2003
|
};
|
|
1888
2004
|
|
|
1889
2005
|
// src/features/analysis/scm/shared/src/guidances.ts
|
|
1890
|
-
import { z as
|
|
2006
|
+
import { z as z12 } from "zod";
|
|
1891
2007
|
|
|
1892
2008
|
// src/features/analysis/scm/shared/src/storedFixData/index.ts
|
|
1893
|
-
import { z as
|
|
2009
|
+
import { z as z10 } from "zod";
|
|
1894
2010
|
|
|
1895
2011
|
// src/features/analysis/scm/shared/src/storedFixData/passwordInComment.ts
|
|
1896
2012
|
var passwordInComment = {
|
|
@@ -2066,8 +2182,8 @@ var vulnerabilities8 = {
|
|
|
2066
2182
|
var xml_default = vulnerabilities8;
|
|
2067
2183
|
|
|
2068
2184
|
// src/features/analysis/scm/shared/src/storedFixData/index.ts
|
|
2069
|
-
var StoredFixDataItemZ =
|
|
2070
|
-
guidance:
|
|
2185
|
+
var StoredFixDataItemZ = z10.object({
|
|
2186
|
+
guidance: z10.function().returns(z10.string())
|
|
2071
2187
|
});
|
|
2072
2188
|
var languages = {
|
|
2073
2189
|
["Java" /* Java */]: java_default,
|
|
@@ -2081,7 +2197,7 @@ var languages = {
|
|
|
2081
2197
|
};
|
|
2082
2198
|
|
|
2083
2199
|
// src/features/analysis/scm/shared/src/storedQuestionData/index.ts
|
|
2084
|
-
import { z as
|
|
2200
|
+
import { z as z11 } from "zod";
|
|
2085
2201
|
|
|
2086
2202
|
// src/features/analysis/scm/shared/src/storedQuestionData/csharp/httpOnlyCookie.ts
|
|
2087
2203
|
var httpOnlyCookie = {
|
|
@@ -3250,10 +3366,10 @@ var vulnerabilities14 = {
|
|
|
3250
3366
|
var xml_default2 = vulnerabilities14;
|
|
3251
3367
|
|
|
3252
3368
|
// src/features/analysis/scm/shared/src/storedQuestionData/index.ts
|
|
3253
|
-
var StoredQuestionDataItemZ =
|
|
3254
|
-
content:
|
|
3255
|
-
description:
|
|
3256
|
-
guidance:
|
|
3369
|
+
var StoredQuestionDataItemZ = z11.object({
|
|
3370
|
+
content: z11.function().args(z11.any()).returns(z11.string()),
|
|
3371
|
+
description: z11.function().args(z11.any()).returns(z11.string()),
|
|
3372
|
+
guidance: z11.function().args(z11.any()).returns(z11.string())
|
|
3257
3373
|
});
|
|
3258
3374
|
var languages2 = {
|
|
3259
3375
|
["Java" /* Java */]: java_default2,
|
|
@@ -3348,9 +3464,9 @@ function getFixGuidances({
|
|
|
3348
3464
|
const fixGuidance = storeFixResult.success ? [storeFixResult.data.guidance({ questions, ...extraContext })] : [];
|
|
3349
3465
|
return libGuidances.concat(fixGuidance).filter((guidance) => !!guidance);
|
|
3350
3466
|
}
|
|
3351
|
-
var IssueTypeAndLanguageZ =
|
|
3352
|
-
issueType:
|
|
3353
|
-
issueLanguage:
|
|
3467
|
+
var IssueTypeAndLanguageZ = z12.object({
|
|
3468
|
+
issueType: z12.nativeEnum(IssueType_Enum),
|
|
3469
|
+
issueLanguage: z12.nativeEnum(IssueLanguage_Enum)
|
|
3354
3470
|
});
|
|
3355
3471
|
function getGuidances(args) {
|
|
3356
3472
|
const safeIssueTypeAndLanguage = IssueTypeAndLanguageZ.safeParse({
|
|
@@ -3388,7 +3504,7 @@ function getGuidances(args) {
|
|
|
3388
3504
|
}
|
|
3389
3505
|
|
|
3390
3506
|
// src/features/analysis/scm/shared/src/urlParser/urlParser.ts
|
|
3391
|
-
import { z as
|
|
3507
|
+
import { z as z13 } from "zod";
|
|
3392
3508
|
var ADO_PREFIX_PATH = "tfs";
|
|
3393
3509
|
var NAME_REGEX = /[a-z0-9\-_.+]+/i;
|
|
3394
3510
|
function detectAdoUrl(args) {
|
|
@@ -3405,7 +3521,7 @@ function detectAdoUrl(args) {
|
|
|
3405
3521
|
scmType: "Ado" /* Ado */,
|
|
3406
3522
|
organization,
|
|
3407
3523
|
// project has single repo - repoName === projectName
|
|
3408
|
-
projectName:
|
|
3524
|
+
projectName: z13.string().parse(projectName),
|
|
3409
3525
|
repoName: projectName,
|
|
3410
3526
|
prefixPath
|
|
3411
3527
|
};
|
|
@@ -3416,7 +3532,7 @@ function detectAdoUrl(args) {
|
|
|
3416
3532
|
return {
|
|
3417
3533
|
scmType: "Ado" /* Ado */,
|
|
3418
3534
|
organization,
|
|
3419
|
-
projectName:
|
|
3535
|
+
projectName: z13.string().parse(projectName),
|
|
3420
3536
|
repoName,
|
|
3421
3537
|
prefixPath
|
|
3422
3538
|
};
|
|
@@ -3430,7 +3546,7 @@ function detectAdoUrl(args) {
|
|
|
3430
3546
|
scmType: "Ado" /* Ado */,
|
|
3431
3547
|
organization,
|
|
3432
3548
|
// project has only one repo - repoName === projectName
|
|
3433
|
-
projectName:
|
|
3549
|
+
projectName: z13.string().parse(repoName),
|
|
3434
3550
|
repoName,
|
|
3435
3551
|
prefixPath
|
|
3436
3552
|
};
|
|
@@ -3440,7 +3556,7 @@ function detectAdoUrl(args) {
|
|
|
3440
3556
|
return {
|
|
3441
3557
|
scmType: "Ado" /* Ado */,
|
|
3442
3558
|
organization,
|
|
3443
|
-
projectName:
|
|
3559
|
+
projectName: z13.string().parse(projectName),
|
|
3444
3560
|
repoName,
|
|
3445
3561
|
prefixPath
|
|
3446
3562
|
};
|
|
@@ -3591,10 +3707,10 @@ var scmTypeToScmLibScmType = {
|
|
|
3591
3707
|
["Ado" /* Ado */]: "ADO" /* ADO */,
|
|
3592
3708
|
["Bitbucket" /* Bitbucket */]: "BITBUCKET" /* BITBUCKET */
|
|
3593
3709
|
};
|
|
3594
|
-
var GetRefererenceResultZ =
|
|
3595
|
-
date:
|
|
3596
|
-
sha:
|
|
3597
|
-
type:
|
|
3710
|
+
var GetRefererenceResultZ = z14.object({
|
|
3711
|
+
date: z14.date().optional(),
|
|
3712
|
+
sha: z14.string(),
|
|
3713
|
+
type: z14.nativeEnum(ReferenceType)
|
|
3598
3714
|
});
|
|
3599
3715
|
|
|
3600
3716
|
// src/features/analysis/scm/github/consts.ts
|
|
@@ -3670,19 +3786,19 @@ var DEFUALT_ADO_ORIGIN = scmCloudUrl.Ado;
|
|
|
3670
3786
|
import querystring from "node:querystring";
|
|
3671
3787
|
import * as api from "azure-devops-node-api";
|
|
3672
3788
|
import Debug2 from "debug";
|
|
3673
|
-
import { z as
|
|
3789
|
+
import { z as z18 } from "zod";
|
|
3674
3790
|
|
|
3675
3791
|
// src/features/analysis/scm/env.ts
|
|
3676
|
-
import { z as
|
|
3677
|
-
var EnvVariablesZod =
|
|
3678
|
-
GITLAB_API_TOKEN:
|
|
3679
|
-
GITHUB_API_TOKEN:
|
|
3680
|
-
GIT_PROXY_HOST:
|
|
3792
|
+
import { z as z15 } from "zod";
|
|
3793
|
+
var EnvVariablesZod = z15.object({
|
|
3794
|
+
GITLAB_API_TOKEN: z15.string().optional(),
|
|
3795
|
+
GITHUB_API_TOKEN: z15.string().optional(),
|
|
3796
|
+
GIT_PROXY_HOST: z15.string()
|
|
3681
3797
|
});
|
|
3682
3798
|
var { GITLAB_API_TOKEN, GITHUB_API_TOKEN, GIT_PROXY_HOST } = EnvVariablesZod.parse(process.env);
|
|
3683
3799
|
|
|
3684
3800
|
// src/features/analysis/scm/utils/index.ts
|
|
3685
|
-
import { z as
|
|
3801
|
+
import { z as z16 } from "zod";
|
|
3686
3802
|
function getFixUrlWithRedirect(params) {
|
|
3687
3803
|
const {
|
|
3688
3804
|
fixId,
|
|
@@ -3751,7 +3867,7 @@ function shouldValidateUrl(repoUrl) {
|
|
|
3751
3867
|
return repoUrl && isUrlHasPath(repoUrl);
|
|
3752
3868
|
}
|
|
3753
3869
|
function isBrokerUrl(url) {
|
|
3754
|
-
return
|
|
3870
|
+
return z16.string().uuid().safeParse(new URL(url).host).success;
|
|
3755
3871
|
}
|
|
3756
3872
|
function buildAuthorizedRepoUrl(args) {
|
|
3757
3873
|
const { url, username, password } = args;
|
|
@@ -3787,7 +3903,7 @@ function getCloudScmLibTypeFromUrl(url) {
|
|
|
3787
3903
|
return void 0;
|
|
3788
3904
|
}
|
|
3789
3905
|
function getScmLibTypeFromScmType(scmType) {
|
|
3790
|
-
const parsedScmType =
|
|
3906
|
+
const parsedScmType = z16.nativeEnum(ScmType).parse(scmType);
|
|
3791
3907
|
return scmTypeToScmLibScmType[parsedScmType];
|
|
3792
3908
|
}
|
|
3793
3909
|
function getScmConfig({
|
|
@@ -3854,36 +3970,36 @@ function getScmConfig({
|
|
|
3854
3970
|
}
|
|
3855
3971
|
|
|
3856
3972
|
// src/features/analysis/scm/ado/validation.ts
|
|
3857
|
-
import { z as
|
|
3858
|
-
var ValidPullRequestStatusZ =
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3973
|
+
import { z as z17 } from "zod";
|
|
3974
|
+
var ValidPullRequestStatusZ = z17.union([
|
|
3975
|
+
z17.literal(1 /* Active */),
|
|
3976
|
+
z17.literal(2 /* Abandoned */),
|
|
3977
|
+
z17.literal(3 /* Completed */)
|
|
3862
3978
|
]);
|
|
3863
|
-
var AdoAuthResultZ =
|
|
3864
|
-
access_token:
|
|
3865
|
-
token_type:
|
|
3866
|
-
refresh_token:
|
|
3979
|
+
var AdoAuthResultZ = z17.object({
|
|
3980
|
+
access_token: z17.string().min(1),
|
|
3981
|
+
token_type: z17.string().min(1),
|
|
3982
|
+
refresh_token: z17.string().min(1)
|
|
3867
3983
|
});
|
|
3868
3984
|
var AdoAuthResultWithOrgsZ = AdoAuthResultZ.extend({
|
|
3869
|
-
scmOrgs:
|
|
3985
|
+
scmOrgs: z17.array(z17.string())
|
|
3870
3986
|
});
|
|
3871
|
-
var profileZ =
|
|
3872
|
-
displayName:
|
|
3873
|
-
publicAlias:
|
|
3874
|
-
emailAddress:
|
|
3875
|
-
coreRevision:
|
|
3876
|
-
timeStamp:
|
|
3877
|
-
id:
|
|
3878
|
-
revision:
|
|
3987
|
+
var profileZ = z17.object({
|
|
3988
|
+
displayName: z17.string(),
|
|
3989
|
+
publicAlias: z17.string().min(1),
|
|
3990
|
+
emailAddress: z17.string(),
|
|
3991
|
+
coreRevision: z17.number(),
|
|
3992
|
+
timeStamp: z17.string(),
|
|
3993
|
+
id: z17.string(),
|
|
3994
|
+
revision: z17.number()
|
|
3879
3995
|
});
|
|
3880
|
-
var accountsZ =
|
|
3881
|
-
count:
|
|
3882
|
-
value:
|
|
3883
|
-
|
|
3884
|
-
accountId:
|
|
3885
|
-
accountUri:
|
|
3886
|
-
accountName:
|
|
3996
|
+
var accountsZ = z17.object({
|
|
3997
|
+
count: z17.number(),
|
|
3998
|
+
value: z17.array(
|
|
3999
|
+
z17.object({
|
|
4000
|
+
accountId: z17.string(),
|
|
4001
|
+
accountUri: z17.string(),
|
|
4002
|
+
accountName: z17.string()
|
|
3887
4003
|
})
|
|
3888
4004
|
)
|
|
3889
4005
|
});
|
|
@@ -3968,7 +4084,7 @@ async function getAdoConnectData({
|
|
|
3968
4084
|
oauthToken: adoTokenInfo.accessToken
|
|
3969
4085
|
});
|
|
3970
4086
|
return {
|
|
3971
|
-
org:
|
|
4087
|
+
org: z18.string().parse(org),
|
|
3972
4088
|
origin: DEFUALT_ADO_ORIGIN
|
|
3973
4089
|
};
|
|
3974
4090
|
}
|
|
@@ -4054,7 +4170,7 @@ async function getAdoClientParams(params) {
|
|
|
4054
4170
|
return {
|
|
4055
4171
|
tokenType: "PAT" /* PAT */,
|
|
4056
4172
|
accessToken: adoTokenInfo.accessToken,
|
|
4057
|
-
patTokenOrg:
|
|
4173
|
+
patTokenOrg: z18.string().parse(tokenOrg).toLowerCase(),
|
|
4058
4174
|
origin: origin2,
|
|
4059
4175
|
orgName: org.toLowerCase()
|
|
4060
4176
|
};
|
|
@@ -4450,100 +4566,100 @@ import parseDiff from "parse-diff";
|
|
|
4450
4566
|
import path4 from "path";
|
|
4451
4567
|
import { simpleGit } from "simple-git";
|
|
4452
4568
|
import tmp from "tmp";
|
|
4453
|
-
import { z as
|
|
4569
|
+
import { z as z20 } from "zod";
|
|
4454
4570
|
|
|
4455
4571
|
// src/features/analysis/scm/scmSubmit/types.ts
|
|
4456
|
-
import { z as
|
|
4457
|
-
var BaseSubmitToScmMessageZ =
|
|
4458
|
-
submitFixRequestId:
|
|
4459
|
-
fixes:
|
|
4460
|
-
|
|
4461
|
-
fixId:
|
|
4462
|
-
patchesOriginalEncodingBase64:
|
|
4463
|
-
patches:
|
|
4572
|
+
import { z as z19 } from "zod";
|
|
4573
|
+
var BaseSubmitToScmMessageZ = z19.object({
|
|
4574
|
+
submitFixRequestId: z19.string().uuid(),
|
|
4575
|
+
fixes: z19.array(
|
|
4576
|
+
z19.object({
|
|
4577
|
+
fixId: z19.string().uuid(),
|
|
4578
|
+
patchesOriginalEncodingBase64: z19.array(z19.string()),
|
|
4579
|
+
patches: z19.array(z19.string())
|
|
4464
4580
|
})
|
|
4465
4581
|
),
|
|
4466
|
-
commitHash:
|
|
4467
|
-
repoUrl:
|
|
4468
|
-
mobbUserEmail:
|
|
4469
|
-
extraHeaders:
|
|
4582
|
+
commitHash: z19.string(),
|
|
4583
|
+
repoUrl: z19.string(),
|
|
4584
|
+
mobbUserEmail: z19.string(),
|
|
4585
|
+
extraHeaders: z19.record(z19.string(), z19.string()).default({})
|
|
4470
4586
|
});
|
|
4471
4587
|
var submitToScmMessageType = {
|
|
4472
4588
|
commitToSameBranch: "commitToSameBranch",
|
|
4473
4589
|
submitFixesForDifferentBranch: "submitFixesForDifferentBranch"
|
|
4474
4590
|
};
|
|
4475
4591
|
var CommitToSameBranchParamsZ = BaseSubmitToScmMessageZ.merge(
|
|
4476
|
-
|
|
4477
|
-
type:
|
|
4478
|
-
branch:
|
|
4479
|
-
commitMessages:
|
|
4480
|
-
commitDescriptions:
|
|
4481
|
-
githubCommentId:
|
|
4592
|
+
z19.object({
|
|
4593
|
+
type: z19.literal(submitToScmMessageType.commitToSameBranch),
|
|
4594
|
+
branch: z19.string(),
|
|
4595
|
+
commitMessages: z19.array(z19.string()),
|
|
4596
|
+
commitDescriptions: z19.array(z19.string().nullish()),
|
|
4597
|
+
githubCommentId: z19.number().nullish()
|
|
4482
4598
|
})
|
|
4483
4599
|
);
|
|
4484
|
-
var SubmitFixesToDifferentBranchParamsZ =
|
|
4485
|
-
type:
|
|
4486
|
-
submitBranch:
|
|
4487
|
-
baseBranch:
|
|
4600
|
+
var SubmitFixesToDifferentBranchParamsZ = z19.object({
|
|
4601
|
+
type: z19.literal(submitToScmMessageType.submitFixesForDifferentBranch),
|
|
4602
|
+
submitBranch: z19.string(),
|
|
4603
|
+
baseBranch: z19.string()
|
|
4488
4604
|
}).merge(BaseSubmitToScmMessageZ);
|
|
4489
|
-
var SubmitFixesMessageZ =
|
|
4605
|
+
var SubmitFixesMessageZ = z19.union([
|
|
4490
4606
|
CommitToSameBranchParamsZ,
|
|
4491
4607
|
SubmitFixesToDifferentBranchParamsZ
|
|
4492
4608
|
]);
|
|
4493
|
-
var FixResponseArrayZ =
|
|
4494
|
-
|
|
4495
|
-
fixId:
|
|
4609
|
+
var FixResponseArrayZ = z19.array(
|
|
4610
|
+
z19.object({
|
|
4611
|
+
fixId: z19.string().uuid()
|
|
4496
4612
|
})
|
|
4497
4613
|
);
|
|
4498
|
-
var SubmitFixesBaseResponseMessageZ =
|
|
4499
|
-
mobbUserEmail:
|
|
4500
|
-
submitFixRequestId:
|
|
4501
|
-
submitBranches:
|
|
4502
|
-
|
|
4503
|
-
branchName:
|
|
4614
|
+
var SubmitFixesBaseResponseMessageZ = z19.object({
|
|
4615
|
+
mobbUserEmail: z19.string(),
|
|
4616
|
+
submitFixRequestId: z19.string().uuid(),
|
|
4617
|
+
submitBranches: z19.array(
|
|
4618
|
+
z19.object({
|
|
4619
|
+
branchName: z19.string(),
|
|
4504
4620
|
fixes: FixResponseArrayZ
|
|
4505
4621
|
})
|
|
4506
4622
|
),
|
|
4507
|
-
error:
|
|
4508
|
-
type:
|
|
4623
|
+
error: z19.object({
|
|
4624
|
+
type: z19.enum([
|
|
4509
4625
|
"InitialRepoAccessError",
|
|
4510
4626
|
"PushBranchError",
|
|
4511
4627
|
"AllFixesConflictWithTargetBranchError",
|
|
4512
4628
|
"InternalFixConflictError",
|
|
4513
4629
|
"UnknownError"
|
|
4514
4630
|
]),
|
|
4515
|
-
info:
|
|
4516
|
-
message:
|
|
4517
|
-
pushBranchName:
|
|
4631
|
+
info: z19.object({
|
|
4632
|
+
message: z19.string(),
|
|
4633
|
+
pushBranchName: z19.string().optional()
|
|
4518
4634
|
})
|
|
4519
4635
|
}).optional()
|
|
4520
4636
|
});
|
|
4521
|
-
var authorSchemaZ =
|
|
4522
|
-
email:
|
|
4523
|
-
name:
|
|
4637
|
+
var authorSchemaZ = z19.object({
|
|
4638
|
+
email: z19.string(),
|
|
4639
|
+
name: z19.string()
|
|
4524
4640
|
}).nullable();
|
|
4525
|
-
var summarySchemaZ =
|
|
4526
|
-
changes:
|
|
4527
|
-
insertions:
|
|
4528
|
-
deletions:
|
|
4641
|
+
var summarySchemaZ = z19.object({
|
|
4642
|
+
changes: z19.number(),
|
|
4643
|
+
insertions: z19.number(),
|
|
4644
|
+
deletions: z19.number()
|
|
4529
4645
|
});
|
|
4530
|
-
var GitCommitZ =
|
|
4646
|
+
var GitCommitZ = z19.object({
|
|
4531
4647
|
author: authorSchemaZ,
|
|
4532
|
-
branch:
|
|
4533
|
-
commit:
|
|
4534
|
-
root:
|
|
4648
|
+
branch: z19.string(),
|
|
4649
|
+
commit: z19.string(),
|
|
4650
|
+
root: z19.boolean(),
|
|
4535
4651
|
summary: summarySchemaZ
|
|
4536
4652
|
});
|
|
4537
|
-
var SubmitFixesToSameBranchResponseMessageZ =
|
|
4538
|
-
type:
|
|
4539
|
-
githubCommentId:
|
|
4540
|
-
commits:
|
|
4653
|
+
var SubmitFixesToSameBranchResponseMessageZ = z19.object({
|
|
4654
|
+
type: z19.literal(submitToScmMessageType.commitToSameBranch),
|
|
4655
|
+
githubCommentId: z19.number().nullish(),
|
|
4656
|
+
commits: z19.array(GitCommitZ)
|
|
4541
4657
|
}).merge(SubmitFixesBaseResponseMessageZ);
|
|
4542
|
-
var SubmitFixesToDifferentBranchResponseMessageZ =
|
|
4543
|
-
type:
|
|
4544
|
-
githubCommentId:
|
|
4658
|
+
var SubmitFixesToDifferentBranchResponseMessageZ = z19.object({
|
|
4659
|
+
type: z19.literal(submitToScmMessageType.submitFixesForDifferentBranch),
|
|
4660
|
+
githubCommentId: z19.number().optional()
|
|
4545
4661
|
}).merge(SubmitFixesBaseResponseMessageZ);
|
|
4546
|
-
var SubmitFixesResponseMessageZ =
|
|
4662
|
+
var SubmitFixesResponseMessageZ = z19.discriminatedUnion("type", [
|
|
4547
4663
|
SubmitFixesToSameBranchResponseMessageZ,
|
|
4548
4664
|
SubmitFixesToDifferentBranchResponseMessageZ
|
|
4549
4665
|
]);
|
|
@@ -4561,10 +4677,10 @@ var isValidBranchName = async (branchName) => {
|
|
|
4561
4677
|
return false;
|
|
4562
4678
|
}
|
|
4563
4679
|
};
|
|
4564
|
-
var FixesZ =
|
|
4565
|
-
|
|
4566
|
-
fixId:
|
|
4567
|
-
patchesOriginalEncodingBase64:
|
|
4680
|
+
var FixesZ = z20.array(
|
|
4681
|
+
z20.object({
|
|
4682
|
+
fixId: z20.string(),
|
|
4683
|
+
patchesOriginalEncodingBase64: z20.array(z20.string())
|
|
4568
4684
|
})
|
|
4569
4685
|
).nonempty();
|
|
4570
4686
|
|
|
@@ -4819,33 +4935,33 @@ import querystring2 from "node:querystring";
|
|
|
4819
4935
|
import * as bitbucketPkgNode from "bitbucket";
|
|
4820
4936
|
import bitbucketPkg from "bitbucket";
|
|
4821
4937
|
import Debug3 from "debug";
|
|
4822
|
-
import { z as
|
|
4938
|
+
import { z as z22 } from "zod";
|
|
4823
4939
|
|
|
4824
4940
|
// src/features/analysis/scm/bitbucket/validation.ts
|
|
4825
|
-
import { z as
|
|
4826
|
-
var BitbucketAuthResultZ =
|
|
4827
|
-
access_token:
|
|
4828
|
-
token_type:
|
|
4829
|
-
refresh_token:
|
|
4941
|
+
import { z as z21 } from "zod";
|
|
4942
|
+
var BitbucketAuthResultZ = z21.object({
|
|
4943
|
+
access_token: z21.string(),
|
|
4944
|
+
token_type: z21.string(),
|
|
4945
|
+
refresh_token: z21.string()
|
|
4830
4946
|
});
|
|
4831
4947
|
|
|
4832
4948
|
// src/features/analysis/scm/bitbucket/bitbucket.ts
|
|
4833
4949
|
var debug3 = Debug3("scm:bitbucket");
|
|
4834
4950
|
var BITBUCKET_HOSTNAME = "bitbucket.org";
|
|
4835
|
-
var TokenExpiredErrorZ =
|
|
4836
|
-
status:
|
|
4837
|
-
error:
|
|
4838
|
-
type:
|
|
4839
|
-
error:
|
|
4840
|
-
message:
|
|
4951
|
+
var TokenExpiredErrorZ = z22.object({
|
|
4952
|
+
status: z22.number(),
|
|
4953
|
+
error: z22.object({
|
|
4954
|
+
type: z22.string(),
|
|
4955
|
+
error: z22.object({
|
|
4956
|
+
message: z22.string()
|
|
4841
4957
|
})
|
|
4842
4958
|
})
|
|
4843
4959
|
});
|
|
4844
4960
|
var BITBUCKET_ACCESS_TOKEN_URL = `https://${BITBUCKET_HOSTNAME}/site/oauth2/access_token`;
|
|
4845
|
-
var BitbucketParseResultZ =
|
|
4846
|
-
organization:
|
|
4847
|
-
repoName:
|
|
4848
|
-
hostname:
|
|
4961
|
+
var BitbucketParseResultZ = z22.object({
|
|
4962
|
+
organization: z22.string(),
|
|
4963
|
+
repoName: z22.string(),
|
|
4964
|
+
hostname: z22.literal(BITBUCKET_HOSTNAME)
|
|
4849
4965
|
});
|
|
4850
4966
|
function parseBitbucketOrganizationAndRepo(bitbucketUrl) {
|
|
4851
4967
|
const parsedGitHubUrl = normalizeUrl(bitbucketUrl);
|
|
@@ -4906,7 +5022,7 @@ function getBitbucketSdk(params) {
|
|
|
4906
5022
|
if (!res.data.values) {
|
|
4907
5023
|
return [];
|
|
4908
5024
|
}
|
|
4909
|
-
return res.data.values.filter((branch) => !!branch.name).map((branch) =>
|
|
5025
|
+
return res.data.values.filter((branch) => !!branch.name).map((branch) => z22.string().parse(branch.name));
|
|
4910
5026
|
},
|
|
4911
5027
|
async getIsUserCollaborator(params2) {
|
|
4912
5028
|
const { repoUrl } = params2;
|
|
@@ -5021,7 +5137,7 @@ function getBitbucketSdk(params) {
|
|
|
5021
5137
|
return GetRefererenceResultZ.parse({
|
|
5022
5138
|
sha: tagRes.data.target?.hash,
|
|
5023
5139
|
type: "TAG" /* TAG */,
|
|
5024
|
-
date: new Date(
|
|
5140
|
+
date: new Date(z22.string().parse(tagRes.data.target?.date))
|
|
5025
5141
|
});
|
|
5026
5142
|
},
|
|
5027
5143
|
async getBranchRef(params2) {
|
|
@@ -5029,7 +5145,7 @@ function getBitbucketSdk(params) {
|
|
|
5029
5145
|
return GetRefererenceResultZ.parse({
|
|
5030
5146
|
sha: getBranchRes.target?.hash,
|
|
5031
5147
|
type: "BRANCH" /* BRANCH */,
|
|
5032
|
-
date: new Date(
|
|
5148
|
+
date: new Date(z22.string().parse(getBranchRes.target?.date))
|
|
5033
5149
|
});
|
|
5034
5150
|
},
|
|
5035
5151
|
async getCommitRef(params2) {
|
|
@@ -5037,13 +5153,13 @@ function getBitbucketSdk(params) {
|
|
|
5037
5153
|
return GetRefererenceResultZ.parse({
|
|
5038
5154
|
sha: getCommitRes.hash,
|
|
5039
5155
|
type: "COMMIT" /* COMMIT */,
|
|
5040
|
-
date: new Date(
|
|
5156
|
+
date: new Date(z22.string().parse(getCommitRes.date))
|
|
5041
5157
|
});
|
|
5042
5158
|
},
|
|
5043
5159
|
async getDownloadUrl({ url, sha }) {
|
|
5044
5160
|
this.getReferenceData({ ref: sha, url });
|
|
5045
5161
|
const repoRes = await this.getRepo({ repoUrl: url });
|
|
5046
|
-
const parsedRepoUrl =
|
|
5162
|
+
const parsedRepoUrl = z22.string().url().parse(repoRes.links?.html?.href);
|
|
5047
5163
|
return `${parsedRepoUrl}/get/${sha}.zip`;
|
|
5048
5164
|
},
|
|
5049
5165
|
async getPullRequest(params2) {
|
|
@@ -5089,7 +5205,7 @@ async function validateBitbucketParams(params) {
|
|
|
5089
5205
|
}
|
|
5090
5206
|
async function getUsersworkspacesSlugs(bitbucketClient) {
|
|
5091
5207
|
const res = await bitbucketClient.workspaces.getWorkspaces({});
|
|
5092
|
-
return res.data.values?.map((v) =>
|
|
5208
|
+
return res.data.values?.map((v) => z22.string().parse(v.slug));
|
|
5093
5209
|
}
|
|
5094
5210
|
async function getllUsersrepositories(bitbucketClient) {
|
|
5095
5211
|
const userWorspacesSlugs = await getUsersworkspacesSlugs(bitbucketClient);
|
|
@@ -5117,10 +5233,10 @@ async function getRepositoriesByWorkspace(bitbucketClient, { workspaceSlug }) {
|
|
|
5117
5233
|
|
|
5118
5234
|
// src/features/analysis/scm/bitbucket/BitbucketSCMLib.ts
|
|
5119
5235
|
import { setTimeout as setTimeout3 } from "node:timers/promises";
|
|
5120
|
-
import { z as
|
|
5236
|
+
import { z as z23 } from "zod";
|
|
5121
5237
|
function getUserAndPassword(token) {
|
|
5122
5238
|
const [username, password] = token.split(":");
|
|
5123
|
-
const safePasswordAndUsername =
|
|
5239
|
+
const safePasswordAndUsername = z23.object({ username: z23.string(), password: z23.string() }).parse({ username, password });
|
|
5124
5240
|
return {
|
|
5125
5241
|
username: safePasswordAndUsername.username,
|
|
5126
5242
|
password: safePasswordAndUsername.password
|
|
@@ -5192,7 +5308,7 @@ var BitbucketSCMLib = class extends SCMLib {
|
|
|
5192
5308
|
return { username, password, authType };
|
|
5193
5309
|
}
|
|
5194
5310
|
case "token": {
|
|
5195
|
-
return { authType, token:
|
|
5311
|
+
return { authType, token: z23.string().parse(this.accessToken) };
|
|
5196
5312
|
}
|
|
5197
5313
|
case "public":
|
|
5198
5314
|
return { authType };
|
|
@@ -5206,7 +5322,7 @@ var BitbucketSCMLib = class extends SCMLib {
|
|
|
5206
5322
|
...params,
|
|
5207
5323
|
repoUrl: this.url
|
|
5208
5324
|
});
|
|
5209
|
-
return String(
|
|
5325
|
+
return String(z23.number().parse(pullRequestRes.id));
|
|
5210
5326
|
} catch (e) {
|
|
5211
5327
|
console.warn(
|
|
5212
5328
|
`error creating pull request for BB. Try number ${i + 1}`,
|
|
@@ -5291,7 +5407,7 @@ var BitbucketSCMLib = class extends SCMLib {
|
|
|
5291
5407
|
async getUsername() {
|
|
5292
5408
|
this._validateAccessToken();
|
|
5293
5409
|
const res = await this.bitbucketSdk.getUser();
|
|
5294
|
-
return
|
|
5410
|
+
return z23.string().parse(res.username);
|
|
5295
5411
|
}
|
|
5296
5412
|
async getSubmitRequestStatus(_scmSubmitRequestId) {
|
|
5297
5413
|
this._validateAccessTokenAndUrl();
|
|
@@ -5320,7 +5436,7 @@ var BitbucketSCMLib = class extends SCMLib {
|
|
|
5320
5436
|
async getRepoDefaultBranch() {
|
|
5321
5437
|
this._validateUrl();
|
|
5322
5438
|
const repoRes = await this.bitbucketSdk.getRepo({ repoUrl: this.url });
|
|
5323
|
-
return
|
|
5439
|
+
return z23.string().parse(repoRes.mainbranch?.name);
|
|
5324
5440
|
}
|
|
5325
5441
|
getPrUrl(prNumber) {
|
|
5326
5442
|
this._validateUrl();
|
|
@@ -5343,7 +5459,7 @@ var BitbucketSCMLib = class extends SCMLib {
|
|
|
5343
5459
|
};
|
|
5344
5460
|
|
|
5345
5461
|
// src/features/analysis/scm/github/GithubSCMLib.ts
|
|
5346
|
-
import { z as
|
|
5462
|
+
import { z as z24 } from "zod";
|
|
5347
5463
|
var GithubSCMLib = class extends SCMLib {
|
|
5348
5464
|
// we don't always need a url, what's important is that we have an access token
|
|
5349
5465
|
constructor(url, accessToken, scmOrg) {
|
|
@@ -5444,7 +5560,7 @@ var GithubSCMLib = class extends SCMLib {
|
|
|
5444
5560
|
owner,
|
|
5445
5561
|
repo
|
|
5446
5562
|
});
|
|
5447
|
-
return
|
|
5563
|
+
return z24.string().parse(prRes.data);
|
|
5448
5564
|
}
|
|
5449
5565
|
async getRepoList(_scmOrg) {
|
|
5450
5566
|
this._validateAccessToken();
|
|
@@ -5599,11 +5715,11 @@ import {
|
|
|
5599
5715
|
} from "undici";
|
|
5600
5716
|
|
|
5601
5717
|
// src/features/analysis/scm/gitlab/types.ts
|
|
5602
|
-
import { z as
|
|
5603
|
-
var GitlabAuthResultZ =
|
|
5604
|
-
access_token:
|
|
5605
|
-
token_type:
|
|
5606
|
-
refresh_token:
|
|
5718
|
+
import { z as z25 } from "zod";
|
|
5719
|
+
var GitlabAuthResultZ = z25.object({
|
|
5720
|
+
access_token: z25.string(),
|
|
5721
|
+
token_type: z25.string(),
|
|
5722
|
+
refresh_token: z25.string()
|
|
5607
5723
|
});
|
|
5608
5724
|
|
|
5609
5725
|
// src/features/analysis/scm/gitlab/gitlab.ts
|
|
@@ -6119,7 +6235,7 @@ var GitlabSCMLib = class extends SCMLib {
|
|
|
6119
6235
|
};
|
|
6120
6236
|
|
|
6121
6237
|
// src/features/analysis/scm/scmFactory.ts
|
|
6122
|
-
import { z as
|
|
6238
|
+
import { z as z26 } from "zod";
|
|
6123
6239
|
|
|
6124
6240
|
// src/features/analysis/scm/StubSCMLib.ts
|
|
6125
6241
|
var StubSCMLib = class extends SCMLib {
|
|
@@ -6238,7 +6354,7 @@ async function createScmLib({ url, accessToken, scmType, scmOrg }, { propagateEx
|
|
|
6238
6354
|
if (e instanceof InvalidRepoUrlError && url) {
|
|
6239
6355
|
throw new RepoNoTokenAccessError(
|
|
6240
6356
|
"no access to repo",
|
|
6241
|
-
scmLibScmTypeToScmType[
|
|
6357
|
+
scmLibScmTypeToScmType[z26.nativeEnum(ScmLibScmType).parse(scmType)]
|
|
6242
6358
|
);
|
|
6243
6359
|
}
|
|
6244
6360
|
console.error(`error validating scm: ${scmType} `, e);
|
|
@@ -6694,7 +6810,7 @@ function getGithubSdk(params = {}) {
|
|
|
6694
6810
|
// src/features/analysis/add_fix_comments_for_pr/utils/utils.ts
|
|
6695
6811
|
import Debug7 from "debug";
|
|
6696
6812
|
import parseDiff2 from "parse-diff";
|
|
6697
|
-
import { z as
|
|
6813
|
+
import { z as z28 } from "zod";
|
|
6698
6814
|
|
|
6699
6815
|
// src/features/analysis/utils/by_key.ts
|
|
6700
6816
|
function keyBy(array, keyBy2) {
|
|
@@ -6766,7 +6882,7 @@ var scannerToFriendlyString = {
|
|
|
6766
6882
|
|
|
6767
6883
|
// src/features/analysis/add_fix_comments_for_pr/utils/buildCommentBody.ts
|
|
6768
6884
|
import Debug6 from "debug";
|
|
6769
|
-
import { z as
|
|
6885
|
+
import { z as z27 } from "zod";
|
|
6770
6886
|
var debug6 = Debug6("mobbdev:handle-finished-analysis");
|
|
6771
6887
|
var getCommitFixButton = (commitUrl) => `<a href="${commitUrl}"><img src=${COMMIT_FIX_SVG}></a>`;
|
|
6772
6888
|
function buildCommentBody({
|
|
@@ -6800,11 +6916,11 @@ function buildCommentBody({
|
|
|
6800
6916
|
});
|
|
6801
6917
|
const issueType = getIssueTypeFriendlyString(fix.safeIssueType);
|
|
6802
6918
|
const title = `# ${MobbIconMarkdown} ${issueType} fix is ready`;
|
|
6803
|
-
const validFixParseRes =
|
|
6919
|
+
const validFixParseRes = z27.object({
|
|
6804
6920
|
patchAndQuestions: PatchAndQuestionsZ,
|
|
6805
|
-
safeIssueLanguage:
|
|
6806
|
-
severityText:
|
|
6807
|
-
safeIssueType:
|
|
6921
|
+
safeIssueLanguage: z27.nativeEnum(IssueLanguage_Enum),
|
|
6922
|
+
severityText: z27.nativeEnum(Vulnerability_Severity_Enum),
|
|
6923
|
+
safeIssueType: z27.nativeEnum(IssueType_Enum)
|
|
6808
6924
|
}).safeParse(fix);
|
|
6809
6925
|
if (!validFixParseRes.success) {
|
|
6810
6926
|
debug6(
|
|
@@ -6977,7 +7093,7 @@ async function getRelevantVulenrabilitiesFromDiff(params) {
|
|
|
6977
7093
|
});
|
|
6978
7094
|
const lineAddedRanges = calculateRanges(fileNumbers);
|
|
6979
7095
|
const fileFilter = {
|
|
6980
|
-
path:
|
|
7096
|
+
path: z28.string().parse(file.to),
|
|
6981
7097
|
ranges: lineAddedRanges.map(([startLine, endLine]) => ({
|
|
6982
7098
|
endLine,
|
|
6983
7099
|
startLine
|
|
@@ -7328,30 +7444,30 @@ function subscribe(query, variables, callback, wsClientOptions) {
|
|
|
7328
7444
|
}
|
|
7329
7445
|
|
|
7330
7446
|
// src/features/analysis/graphql/types.ts
|
|
7331
|
-
import { z as
|
|
7332
|
-
var VulnerabilityReportIssueCodeNodeZ =
|
|
7333
|
-
vulnerabilityReportIssueId:
|
|
7334
|
-
path:
|
|
7335
|
-
startLine:
|
|
7336
|
-
vulnerabilityReportIssue:
|
|
7337
|
-
fixId:
|
|
7447
|
+
import { z as z29 } from "zod";
|
|
7448
|
+
var VulnerabilityReportIssueCodeNodeZ = z29.object({
|
|
7449
|
+
vulnerabilityReportIssueId: z29.string(),
|
|
7450
|
+
path: z29.string(),
|
|
7451
|
+
startLine: z29.number(),
|
|
7452
|
+
vulnerabilityReportIssue: z29.object({
|
|
7453
|
+
fixId: z29.string()
|
|
7338
7454
|
})
|
|
7339
7455
|
});
|
|
7340
|
-
var GetVulByNodesMetadataZ =
|
|
7341
|
-
vulnerabilityReportIssueCodeNodes:
|
|
7342
|
-
nonFixablePrVuls:
|
|
7343
|
-
aggregate:
|
|
7344
|
-
count:
|
|
7456
|
+
var GetVulByNodesMetadataZ = z29.object({
|
|
7457
|
+
vulnerabilityReportIssueCodeNodes: z29.array(VulnerabilityReportIssueCodeNodeZ),
|
|
7458
|
+
nonFixablePrVuls: z29.object({
|
|
7459
|
+
aggregate: z29.object({
|
|
7460
|
+
count: z29.number()
|
|
7345
7461
|
})
|
|
7346
7462
|
}),
|
|
7347
|
-
fixablePrVuls:
|
|
7348
|
-
aggregate:
|
|
7349
|
-
count:
|
|
7463
|
+
fixablePrVuls: z29.object({
|
|
7464
|
+
aggregate: z29.object({
|
|
7465
|
+
count: z29.number()
|
|
7350
7466
|
})
|
|
7351
7467
|
}),
|
|
7352
|
-
totalScanVulnerabilities:
|
|
7353
|
-
aggregate:
|
|
7354
|
-
count:
|
|
7468
|
+
totalScanVulnerabilities: z29.object({
|
|
7469
|
+
aggregate: z29.object({
|
|
7470
|
+
count: z29.number()
|
|
7355
7471
|
})
|
|
7356
7472
|
})
|
|
7357
7473
|
});
|
|
@@ -8364,7 +8480,7 @@ async function _scan(params, { skipPrompts = false } = {}) {
|
|
|
8364
8480
|
spinner: mobbSpinner,
|
|
8365
8481
|
submitVulnerabilityReportVariables: {
|
|
8366
8482
|
fixReportId: reportUploadInfo.fixReportId,
|
|
8367
|
-
repoUrl:
|
|
8483
|
+
repoUrl: z30.string().parse(repo),
|
|
8368
8484
|
reference,
|
|
8369
8485
|
projectId,
|
|
8370
8486
|
vulnerabilityReportFileName: "report.json",
|
|
@@ -8510,9 +8626,9 @@ async function _scan(params, { skipPrompts = false } = {}) {
|
|
|
8510
8626
|
}
|
|
8511
8627
|
});
|
|
8512
8628
|
if (command === "review") {
|
|
8513
|
-
const params2 =
|
|
8514
|
-
repo:
|
|
8515
|
-
githubActionToken:
|
|
8629
|
+
const params2 = z30.object({
|
|
8630
|
+
repo: z30.string().url(),
|
|
8631
|
+
githubActionToken: z30.string()
|
|
8516
8632
|
}).parse({ repo, githubActionToken });
|
|
8517
8633
|
const scm = await createScmLib(
|
|
8518
8634
|
{
|
|
@@ -8534,7 +8650,7 @@ async function _scan(params, { skipPrompts = false } = {}) {
|
|
|
8534
8650
|
analysisId,
|
|
8535
8651
|
gqlClient,
|
|
8536
8652
|
scm,
|
|
8537
|
-
scanner:
|
|
8653
|
+
scanner: z30.nativeEnum(SCANNERS).parse(scanner)
|
|
8538
8654
|
});
|
|
8539
8655
|
},
|
|
8540
8656
|
callbackStates: ["Finished" /* Finished */]
|
|
@@ -8913,7 +9029,7 @@ var scmTokenOption = {
|
|
|
8913
9029
|
// src/args/validation.ts
|
|
8914
9030
|
import chalk7 from "chalk";
|
|
8915
9031
|
import path8 from "path";
|
|
8916
|
-
import { z as
|
|
9032
|
+
import { z as z31 } from "zod";
|
|
8917
9033
|
function throwRepoUrlErrorMessage({
|
|
8918
9034
|
error,
|
|
8919
9035
|
repoUrl,
|
|
@@ -8930,11 +9046,11 @@ Example:
|
|
|
8930
9046
|
)}`;
|
|
8931
9047
|
throw new CliError(formattedErrorMessage);
|
|
8932
9048
|
}
|
|
8933
|
-
var UrlZ =
|
|
9049
|
+
var UrlZ = z31.string({
|
|
8934
9050
|
invalid_type_error: `is not a valid ${Object.values(ScmType).join("/ ")} URL`
|
|
8935
9051
|
});
|
|
8936
9052
|
function validateOrganizationId(organizationId) {
|
|
8937
|
-
const orgIdValidation =
|
|
9053
|
+
const orgIdValidation = z31.string().uuid().nullish().safeParse(organizationId);
|
|
8938
9054
|
if (!orgIdValidation.success) {
|
|
8939
9055
|
throw new CliError(`organizationId: ${organizationId} is not a valid UUID`);
|
|
8940
9056
|
}
|