mobbdev 0.0.163 → 0.0.164
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/.env +2 -2
- package/dist/index.mjs +299 -295
- package/package.json +1 -1
package/.env
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# production@
|
|
1
|
+
# production@v19
|
|
2
2
|
WEB_LOGIN_URL="https://app.mobb.ai/cli-login"
|
|
3
3
|
API_URL="https://api.mobb.ai/v1/graphql"
|
|
4
4
|
WEB_APP_URL="https://app.mobb.ai"
|
|
@@ -7,4 +7,4 @@ GITHUB_API_TOKEN=""
|
|
|
7
7
|
ADO_TEST_ACCESS_TOKEN=""
|
|
8
8
|
HASURA_ACCESS_KEY=""
|
|
9
9
|
LOCAL_GRAPHQL_ENDPOINT=""
|
|
10
|
-
GIT_PROXY_HOST=""
|
|
10
|
+
GIT_PROXY_HOST="http://tinyproxy:8888"
|
package/dist/index.mjs
CHANGED
|
@@ -32,12 +32,12 @@ import fs4 from "node:fs";
|
|
|
32
32
|
import path7 from "node:path";
|
|
33
33
|
|
|
34
34
|
// src/constants.ts
|
|
35
|
-
import
|
|
35
|
+
import path from "node:path";
|
|
36
36
|
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
|
|
40
|
+
import { z } from "zod";
|
|
41
41
|
|
|
42
42
|
// src/features/analysis/scm/shared/src/types.ts
|
|
43
43
|
var scmCloudUrl = {
|
|
@@ -54,34 +54,199 @@ var ScmType = /* @__PURE__ */ ((ScmType2) => {
|
|
|
54
54
|
return ScmType2;
|
|
55
55
|
})(ScmType || {});
|
|
56
56
|
|
|
57
|
+
// src/constants.ts
|
|
58
|
+
var debug = Debug("mobbdev:constants");
|
|
59
|
+
var __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
60
|
+
dotenv.config({ path: path.join(__dirname, "../.env") });
|
|
61
|
+
var scmFriendlyText = {
|
|
62
|
+
["Ado" /* Ado */]: "Azure DevOps",
|
|
63
|
+
["Bitbucket" /* Bitbucket */]: "Bitbucket",
|
|
64
|
+
["GitHub" /* GitHub */]: "GitGub",
|
|
65
|
+
["GitLab" /* GitLab */]: "GitLab"
|
|
66
|
+
};
|
|
67
|
+
var SCANNERS = {
|
|
68
|
+
Checkmarx: "checkmarx",
|
|
69
|
+
Codeql: "codeql",
|
|
70
|
+
Fortify: "fortify",
|
|
71
|
+
Snyk: "snyk",
|
|
72
|
+
Sonarqube: "sonarqube"
|
|
73
|
+
};
|
|
74
|
+
var SupportedScannersZ = z.enum([SCANNERS.Checkmarx, SCANNERS.Snyk]);
|
|
75
|
+
var envVariablesSchema = z.object({
|
|
76
|
+
WEB_APP_URL: z.string(),
|
|
77
|
+
API_URL: z.string(),
|
|
78
|
+
HASURA_ACCESS_KEY: z.string(),
|
|
79
|
+
LOCAL_GRAPHQL_ENDPOINT: z.string()
|
|
80
|
+
}).required();
|
|
81
|
+
var envVariables = envVariablesSchema.parse(process.env);
|
|
82
|
+
debug("config %o", envVariables);
|
|
83
|
+
var mobbAscii = `
|
|
84
|
+
..
|
|
85
|
+
..........
|
|
86
|
+
.................
|
|
87
|
+
...........................
|
|
88
|
+
..............................
|
|
89
|
+
................................
|
|
90
|
+
..................................
|
|
91
|
+
....................................
|
|
92
|
+
.....................................
|
|
93
|
+
.............................................
|
|
94
|
+
.................................................
|
|
95
|
+
............................... .................
|
|
96
|
+
.................................. ............
|
|
97
|
+
.................. ............. ..........
|
|
98
|
+
......... ........ ......... ......
|
|
99
|
+
............... ....
|
|
100
|
+
.... ..
|
|
101
|
+
|
|
102
|
+
. ...
|
|
103
|
+
..............
|
|
104
|
+
......................
|
|
105
|
+
...........................
|
|
106
|
+
................................
|
|
107
|
+
......................................
|
|
108
|
+
...............................
|
|
109
|
+
.................
|
|
110
|
+
`;
|
|
111
|
+
var PROJECT_DEFAULT_NAME = "My first project";
|
|
112
|
+
var WEB_APP_URL = envVariables.WEB_APP_URL;
|
|
113
|
+
var API_URL = envVariables.API_URL;
|
|
114
|
+
var HASURA_ACCESS_KEY = envVariables.HASURA_ACCESS_KEY;
|
|
115
|
+
var LOCAL_GRAPHQL_ENDPOINT = envVariables.LOCAL_GRAPHQL_ENDPOINT;
|
|
116
|
+
var errorMessages = {
|
|
117
|
+
missingCxProjectName: `project name ${chalk.bold(
|
|
118
|
+
"(--cx-project-name)"
|
|
119
|
+
)} is needed if you're using checkmarx`,
|
|
120
|
+
missingUrl: `url ${chalk.bold(
|
|
121
|
+
"(--url)"
|
|
122
|
+
)} is needed if you're adding an SCM token`,
|
|
123
|
+
invalidScmType: `SCM type ${chalk.bold(
|
|
124
|
+
"(--scm-type)"
|
|
125
|
+
)} is invalid, please use one of: ${Object.values(ScmType).join(", ")}`,
|
|
126
|
+
missingToken: `SCM token ${chalk.bold(
|
|
127
|
+
"(--token)"
|
|
128
|
+
)} is needed if you're adding an SCM token`
|
|
129
|
+
};
|
|
130
|
+
var progressMassages = {
|
|
131
|
+
processingVulnerabilityReportSuccess: "\u2699\uFE0F Vulnerability report proccessed successfully",
|
|
132
|
+
processingVulnerabilityReport: "\u2699\uFE0F Proccessing vulnerability report",
|
|
133
|
+
processingVulnerabilityReportFailed: "\u2699\uFE0F Error Proccessing vulnerability report"
|
|
134
|
+
};
|
|
135
|
+
var VUL_REPORT_DIGEST_TIMEOUT_MS = 1e3 * 60 * 20;
|
|
136
|
+
|
|
137
|
+
// src/features/analysis/index.ts
|
|
138
|
+
import crypto from "node:crypto";
|
|
139
|
+
import fs3 from "node:fs";
|
|
140
|
+
import os from "node:os";
|
|
141
|
+
import path6 from "node:path";
|
|
142
|
+
import { pipeline } from "node:stream/promises";
|
|
143
|
+
|
|
144
|
+
// src/utils/index.ts
|
|
145
|
+
var utils_exports = {};
|
|
146
|
+
__export(utils_exports, {
|
|
147
|
+
CliError: () => CliError,
|
|
148
|
+
Spinner: () => Spinner,
|
|
149
|
+
getDirName: () => getDirName,
|
|
150
|
+
getTopLevelDirName: () => getTopLevelDirName,
|
|
151
|
+
keypress: () => keypress,
|
|
152
|
+
sleep: () => sleep
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
// src/utils/dirname.ts
|
|
156
|
+
import path2 from "node:path";
|
|
157
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
158
|
+
function getDirName() {
|
|
159
|
+
return path2.dirname(fileURLToPath2(import.meta.url));
|
|
160
|
+
}
|
|
161
|
+
function getTopLevelDirName(fullPath) {
|
|
162
|
+
return path2.parse(fullPath).name;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// src/utils/keypress.ts
|
|
166
|
+
import readline from "node:readline";
|
|
167
|
+
async function keypress() {
|
|
168
|
+
const rl = readline.createInterface({
|
|
169
|
+
input: process.stdin,
|
|
170
|
+
output: process.stdout
|
|
171
|
+
});
|
|
172
|
+
return new Promise((resolve) => {
|
|
173
|
+
rl.question("", (answer) => {
|
|
174
|
+
rl.close();
|
|
175
|
+
process.stderr.moveCursor(0, -1);
|
|
176
|
+
process.stderr.clearLine(1);
|
|
177
|
+
resolve(answer);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// src/utils/spinner.ts
|
|
183
|
+
import {
|
|
184
|
+
createSpinner as _createSpinner
|
|
185
|
+
} from "nanospinner";
|
|
186
|
+
var mockSpinner = {
|
|
187
|
+
success: () => mockSpinner,
|
|
188
|
+
error: () => mockSpinner,
|
|
189
|
+
warn: () => mockSpinner,
|
|
190
|
+
stop: () => mockSpinner,
|
|
191
|
+
start: () => mockSpinner,
|
|
192
|
+
update: () => mockSpinner,
|
|
193
|
+
reset: () => mockSpinner,
|
|
194
|
+
clear: () => mockSpinner,
|
|
195
|
+
spin: () => mockSpinner
|
|
196
|
+
};
|
|
197
|
+
function Spinner({ ci = false } = {}) {
|
|
198
|
+
return {
|
|
199
|
+
createSpinner: (text, options) => ci ? mockSpinner : _createSpinner(text, options)
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// src/utils/index.ts
|
|
204
|
+
var sleep = (ms = 2e3) => new Promise((r) => setTimeout(r, ms));
|
|
205
|
+
var CliError = class extends Error {
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
// src/features/analysis/index.ts
|
|
209
|
+
import chalk4 from "chalk";
|
|
210
|
+
import Configstore from "configstore";
|
|
211
|
+
import Debug13 from "debug";
|
|
212
|
+
import extract from "extract-zip";
|
|
213
|
+
import fetch4 from "node-fetch";
|
|
214
|
+
import open2 from "open";
|
|
215
|
+
import semver from "semver";
|
|
216
|
+
import tmp2 from "tmp";
|
|
217
|
+
import { z as z14 } from "zod";
|
|
218
|
+
|
|
219
|
+
// src/features/analysis/add_fix_comments_for_pr/add_fix_comments_for_pr.ts
|
|
220
|
+
import Debug4 from "debug";
|
|
221
|
+
|
|
57
222
|
// src/features/analysis/scm/ado/constants.ts
|
|
58
223
|
var DEFUALT_ADO_ORIGIN = scmCloudUrl.Ado;
|
|
59
224
|
|
|
60
225
|
// src/features/analysis/scm/ado/utils.ts
|
|
61
226
|
import querystring3 from "node:querystring";
|
|
62
227
|
import * as api from "azure-devops-node-api";
|
|
63
|
-
import { z as
|
|
228
|
+
import { z as z11 } from "zod";
|
|
64
229
|
|
|
65
230
|
// src/features/analysis/scm/env.ts
|
|
66
|
-
import { z } from "zod";
|
|
67
|
-
var EnvVariablesZod =
|
|
68
|
-
GITLAB_API_TOKEN:
|
|
69
|
-
GITHUB_API_TOKEN:
|
|
70
|
-
GIT_PROXY_HOST:
|
|
231
|
+
import { z as z2 } from "zod";
|
|
232
|
+
var EnvVariablesZod = z2.object({
|
|
233
|
+
GITLAB_API_TOKEN: z2.string().optional(),
|
|
234
|
+
GITHUB_API_TOKEN: z2.string().optional(),
|
|
235
|
+
GIT_PROXY_HOST: z2.string()
|
|
71
236
|
});
|
|
72
237
|
var { GITLAB_API_TOKEN, GITHUB_API_TOKEN, GIT_PROXY_HOST } = EnvVariablesZod.parse(process.env);
|
|
73
238
|
|
|
74
239
|
// src/features/analysis/scm/scm.ts
|
|
75
|
-
import { z as
|
|
240
|
+
import { z as z9 } from "zod";
|
|
76
241
|
|
|
77
242
|
// src/features/analysis/scm/bitbucket/bitbucket.ts
|
|
78
243
|
import querystring from "node:querystring";
|
|
79
244
|
import bitbucketPkg from "bitbucket";
|
|
80
245
|
import * as bitbucketPkgNode from "bitbucket";
|
|
81
|
-
import { z as
|
|
246
|
+
import { z as z5 } from "zod";
|
|
82
247
|
|
|
83
248
|
// src/features/analysis/scm/shared/src/get_issue_type.ts
|
|
84
|
-
import { z as
|
|
249
|
+
import { z as z3 } from "zod";
|
|
85
250
|
|
|
86
251
|
// src/features/analysis/scm/generates/client_generates.ts
|
|
87
252
|
var IssueType_Enum = /* @__PURE__ */ ((IssueType_Enum2) => {
|
|
@@ -416,6 +581,10 @@ var CreateCommunityUserDocument = `
|
|
|
416
581
|
error
|
|
417
582
|
status
|
|
418
583
|
}
|
|
584
|
+
... on UserHasNoPermissionInProjectError {
|
|
585
|
+
error
|
|
586
|
+
status
|
|
587
|
+
}
|
|
419
588
|
}
|
|
420
589
|
}
|
|
421
590
|
`;
|
|
@@ -635,7 +804,7 @@ var issueTypeMap = {
|
|
|
635
804
|
["UNVALIDATED_PUBLIC_METHOD_ARGUMENT" /* UnvalidatedPublicMethodArgument */]: "Unvalidated Public Method Argument",
|
|
636
805
|
["AUTO_ESCAPE_FALSE" /* AutoEscapeFalse */]: "Auto-escape False"
|
|
637
806
|
};
|
|
638
|
-
var issueTypeZ =
|
|
807
|
+
var issueTypeZ = z3.nativeEnum(IssueType_Enum);
|
|
639
808
|
var getIssueType = (issueType) => {
|
|
640
809
|
const issueTypeZParseRes = issueTypeZ.safeParse(issueType);
|
|
641
810
|
if (!issueTypeZParseRes.success) {
|
|
@@ -645,7 +814,7 @@ var getIssueType = (issueType) => {
|
|
|
645
814
|
};
|
|
646
815
|
|
|
647
816
|
// src/features/analysis/scm/shared/src/urlParser/urlParser.ts
|
|
648
|
-
import { z as
|
|
817
|
+
import { z as z4 } from "zod";
|
|
649
818
|
function detectAdoUrl(args) {
|
|
650
819
|
const { pathname, hostname, scmType } = args;
|
|
651
820
|
const hostnameParts = hostname.split(".");
|
|
@@ -660,7 +829,7 @@ function detectAdoUrl(args) {
|
|
|
660
829
|
scmType: "Ado" /* Ado */,
|
|
661
830
|
organization,
|
|
662
831
|
// project has single repo - repoName === projectName
|
|
663
|
-
projectName:
|
|
832
|
+
projectName: z4.string().parse(projectName),
|
|
664
833
|
repoName: projectName,
|
|
665
834
|
prefixPath
|
|
666
835
|
};
|
|
@@ -671,7 +840,7 @@ function detectAdoUrl(args) {
|
|
|
671
840
|
return {
|
|
672
841
|
scmType: "Ado" /* Ado */,
|
|
673
842
|
organization,
|
|
674
|
-
projectName:
|
|
843
|
+
projectName: z4.string().parse(projectName),
|
|
675
844
|
repoName,
|
|
676
845
|
prefixPath
|
|
677
846
|
};
|
|
@@ -685,7 +854,7 @@ function detectAdoUrl(args) {
|
|
|
685
854
|
scmType: "Ado" /* Ado */,
|
|
686
855
|
organization,
|
|
687
856
|
// project has only one repo - repoName === projectName
|
|
688
|
-
projectName:
|
|
857
|
+
projectName: z4.string().parse(repoName),
|
|
689
858
|
repoName,
|
|
690
859
|
prefixPath
|
|
691
860
|
};
|
|
@@ -695,7 +864,7 @@ function detectAdoUrl(args) {
|
|
|
695
864
|
return {
|
|
696
865
|
scmType: "Ado" /* Ado */,
|
|
697
866
|
organization,
|
|
698
|
-
projectName:
|
|
867
|
+
projectName: z4.string().parse(projectName),
|
|
699
868
|
repoName,
|
|
700
869
|
prefixPath
|
|
701
870
|
};
|
|
@@ -918,25 +1087,25 @@ var sanityRepoURL = (scmURL) => {
|
|
|
918
1087
|
|
|
919
1088
|
// src/features/analysis/scm/bitbucket/bitbucket.ts
|
|
920
1089
|
var BITBUCKET_HOSTNAME = "bitbucket.org";
|
|
921
|
-
var TokenExpiredErrorZ =
|
|
922
|
-
status:
|
|
923
|
-
error:
|
|
924
|
-
type:
|
|
925
|
-
error:
|
|
926
|
-
message:
|
|
1090
|
+
var TokenExpiredErrorZ = z5.object({
|
|
1091
|
+
status: z5.number(),
|
|
1092
|
+
error: z5.object({
|
|
1093
|
+
type: z5.string(),
|
|
1094
|
+
error: z5.object({
|
|
1095
|
+
message: z5.string()
|
|
927
1096
|
})
|
|
928
1097
|
})
|
|
929
1098
|
});
|
|
930
1099
|
var BITBUCKET_ACCESS_TOKEN_URL = `https://${BITBUCKET_HOSTNAME}/site/oauth2/access_token`;
|
|
931
|
-
var BitbucketAuthResultZ =
|
|
932
|
-
access_token:
|
|
933
|
-
token_type:
|
|
934
|
-
refresh_token:
|
|
1100
|
+
var BitbucketAuthResultZ = z5.object({
|
|
1101
|
+
access_token: z5.string(),
|
|
1102
|
+
token_type: z5.string(),
|
|
1103
|
+
refresh_token: z5.string()
|
|
935
1104
|
});
|
|
936
|
-
var BitbucketParseResultZ =
|
|
937
|
-
organization:
|
|
938
|
-
repoName:
|
|
939
|
-
hostname:
|
|
1105
|
+
var BitbucketParseResultZ = z5.object({
|
|
1106
|
+
organization: z5.string(),
|
|
1107
|
+
repoName: z5.string(),
|
|
1108
|
+
hostname: z5.literal(BITBUCKET_HOSTNAME)
|
|
940
1109
|
});
|
|
941
1110
|
function parseBitbucketOrganizationAndRepo(bitbucketUrl) {
|
|
942
1111
|
const parsedGitHubUrl = normalizeUrl(bitbucketUrl);
|
|
@@ -1015,7 +1184,7 @@ function getBitbucketSdk(params) {
|
|
|
1015
1184
|
if (!res.data.values) {
|
|
1016
1185
|
return [];
|
|
1017
1186
|
}
|
|
1018
|
-
return res.data.values.filter((branch) => !!branch.name).map((branch) =>
|
|
1187
|
+
return res.data.values.filter((branch) => !!branch.name).map((branch) => z5.string().parse(branch.name));
|
|
1019
1188
|
},
|
|
1020
1189
|
async getIsUserCollaborator(params2) {
|
|
1021
1190
|
const { repoUrl } = params2;
|
|
@@ -1130,7 +1299,7 @@ function getBitbucketSdk(params) {
|
|
|
1130
1299
|
return GetRefererenceResultZ.parse({
|
|
1131
1300
|
sha: tagRes.data.target?.hash,
|
|
1132
1301
|
type: "TAG" /* TAG */,
|
|
1133
|
-
date: new Date(
|
|
1302
|
+
date: new Date(z5.string().parse(tagRes.data.target?.date))
|
|
1134
1303
|
});
|
|
1135
1304
|
},
|
|
1136
1305
|
async getBranchRef(params2) {
|
|
@@ -1138,7 +1307,7 @@ function getBitbucketSdk(params) {
|
|
|
1138
1307
|
return GetRefererenceResultZ.parse({
|
|
1139
1308
|
sha: getBranchRes.target?.hash,
|
|
1140
1309
|
type: "BRANCH" /* BRANCH */,
|
|
1141
|
-
date: new Date(
|
|
1310
|
+
date: new Date(z5.string().parse(getBranchRes.target?.date))
|
|
1142
1311
|
});
|
|
1143
1312
|
},
|
|
1144
1313
|
async getCommitRef(params2) {
|
|
@@ -1146,13 +1315,13 @@ function getBitbucketSdk(params) {
|
|
|
1146
1315
|
return GetRefererenceResultZ.parse({
|
|
1147
1316
|
sha: getCommitRes.hash,
|
|
1148
1317
|
type: "COMMIT" /* COMMIT */,
|
|
1149
|
-
date: new Date(
|
|
1318
|
+
date: new Date(z5.string().parse(getCommitRes.date))
|
|
1150
1319
|
});
|
|
1151
1320
|
},
|
|
1152
1321
|
async getDownloadUrl({ url, sha }) {
|
|
1153
1322
|
this.getReferenceData({ ref: sha, url });
|
|
1154
1323
|
const repoRes = await this.getRepo({ repoUrl: url });
|
|
1155
|
-
const parsedRepoUrl =
|
|
1324
|
+
const parsedRepoUrl = z5.string().url().parse(repoRes.links?.html?.href);
|
|
1156
1325
|
return `${parsedRepoUrl}/get/${sha}.zip`;
|
|
1157
1326
|
},
|
|
1158
1327
|
async getPullRequest(params2) {
|
|
@@ -1195,7 +1364,7 @@ async function validateBitbucketParams(params) {
|
|
|
1195
1364
|
}
|
|
1196
1365
|
async function getUsersworkspacesSlugs(bitbucketClient) {
|
|
1197
1366
|
const res = await bitbucketClient.workspaces.getWorkspaces({});
|
|
1198
|
-
return res.data.values?.map((v) =>
|
|
1367
|
+
return res.data.values?.map((v) => z5.string().parse(v.slug));
|
|
1199
1368
|
}
|
|
1200
1369
|
async function getllUsersrepositories(bitbucketClient) {
|
|
1201
1370
|
const userWorspacesSlugs = await getUsersworkspacesSlugs(bitbucketClient);
|
|
@@ -1735,11 +1904,11 @@ import {
|
|
|
1735
1904
|
import { ProxyAgent as ProxyAgent2 } from "undici";
|
|
1736
1905
|
|
|
1737
1906
|
// src/features/analysis/scm/gitlab/types.ts
|
|
1738
|
-
import { z as
|
|
1739
|
-
var GitlabAuthResultZ =
|
|
1740
|
-
access_token:
|
|
1741
|
-
token_type:
|
|
1742
|
-
refresh_token:
|
|
1907
|
+
import { z as z6 } from "zod";
|
|
1908
|
+
var GitlabAuthResultZ = z6.object({
|
|
1909
|
+
access_token: z6.string(),
|
|
1910
|
+
token_type: z6.string(),
|
|
1911
|
+
refresh_token: z6.string()
|
|
1743
1912
|
});
|
|
1744
1913
|
|
|
1745
1914
|
// src/features/analysis/scm/gitlab/gitlab.ts
|
|
@@ -2032,83 +2201,83 @@ initGitlabFetchMock();
|
|
|
2032
2201
|
// src/features/analysis/scm/scmSubmit/index.ts
|
|
2033
2202
|
import fs from "node:fs/promises";
|
|
2034
2203
|
import parseDiff from "parse-diff";
|
|
2035
|
-
import
|
|
2204
|
+
import path3 from "path";
|
|
2036
2205
|
import { simpleGit } from "simple-git";
|
|
2037
2206
|
import tmp from "tmp";
|
|
2038
|
-
import { z as
|
|
2207
|
+
import { z as z8 } from "zod";
|
|
2039
2208
|
|
|
2040
2209
|
// src/features/analysis/scm/scmSubmit/types.ts
|
|
2041
|
-
import { z as
|
|
2042
|
-
var BaseSubmitToScmMessageZ =
|
|
2043
|
-
submitFixRequestId:
|
|
2044
|
-
fixes:
|
|
2045
|
-
|
|
2046
|
-
fixId:
|
|
2047
|
-
patches:
|
|
2210
|
+
import { z as z7 } from "zod";
|
|
2211
|
+
var BaseSubmitToScmMessageZ = z7.object({
|
|
2212
|
+
submitFixRequestId: z7.string().uuid(),
|
|
2213
|
+
fixes: z7.array(
|
|
2214
|
+
z7.object({
|
|
2215
|
+
fixId: z7.string().uuid(),
|
|
2216
|
+
patches: z7.array(z7.string())
|
|
2048
2217
|
})
|
|
2049
2218
|
),
|
|
2050
|
-
commitHash:
|
|
2051
|
-
repoUrl:
|
|
2052
|
-
mobbUserEmail:
|
|
2053
|
-
extraHeaders:
|
|
2219
|
+
commitHash: z7.string(),
|
|
2220
|
+
repoUrl: z7.string(),
|
|
2221
|
+
mobbUserEmail: z7.string(),
|
|
2222
|
+
extraHeaders: z7.record(z7.string(), z7.string()).default({})
|
|
2054
2223
|
});
|
|
2055
2224
|
var submitToScmMessageType = {
|
|
2056
2225
|
commitToSameBranch: "commitToSameBranch",
|
|
2057
2226
|
submitFixesForDifferentBranch: "submitFixesForDifferentBranch"
|
|
2058
2227
|
};
|
|
2059
2228
|
var CommitToSameBranchParamsZ = BaseSubmitToScmMessageZ.merge(
|
|
2060
|
-
|
|
2061
|
-
type:
|
|
2062
|
-
branch:
|
|
2063
|
-
commitMessage:
|
|
2064
|
-
commitDescription:
|
|
2065
|
-
githubCommentId:
|
|
2229
|
+
z7.object({
|
|
2230
|
+
type: z7.literal(submitToScmMessageType.commitToSameBranch),
|
|
2231
|
+
branch: z7.string(),
|
|
2232
|
+
commitMessage: z7.string(),
|
|
2233
|
+
commitDescription: z7.string().nullish(),
|
|
2234
|
+
githubCommentId: z7.number().nullish()
|
|
2066
2235
|
})
|
|
2067
2236
|
);
|
|
2068
|
-
var SubmitFixesToDifferentBranchParamsZ =
|
|
2069
|
-
type:
|
|
2070
|
-
submitBranch:
|
|
2071
|
-
baseBranch:
|
|
2237
|
+
var SubmitFixesToDifferentBranchParamsZ = z7.object({
|
|
2238
|
+
type: z7.literal(submitToScmMessageType.submitFixesForDifferentBranch),
|
|
2239
|
+
submitBranch: z7.string(),
|
|
2240
|
+
baseBranch: z7.string()
|
|
2072
2241
|
}).merge(BaseSubmitToScmMessageZ);
|
|
2073
|
-
var SubmitFixesMessageZ =
|
|
2242
|
+
var SubmitFixesMessageZ = z7.union([
|
|
2074
2243
|
CommitToSameBranchParamsZ,
|
|
2075
2244
|
SubmitFixesToDifferentBranchParamsZ
|
|
2076
2245
|
]);
|
|
2077
|
-
var FixResponseArrayZ =
|
|
2078
|
-
|
|
2079
|
-
fixId:
|
|
2246
|
+
var FixResponseArrayZ = z7.array(
|
|
2247
|
+
z7.object({
|
|
2248
|
+
fixId: z7.string().uuid()
|
|
2080
2249
|
})
|
|
2081
2250
|
);
|
|
2082
|
-
var SubmitFixesBaseResponseMessageZ =
|
|
2083
|
-
mobbUserEmail:
|
|
2084
|
-
submitFixRequestId:
|
|
2085
|
-
submitBranches:
|
|
2086
|
-
|
|
2087
|
-
branchName:
|
|
2251
|
+
var SubmitFixesBaseResponseMessageZ = z7.object({
|
|
2252
|
+
mobbUserEmail: z7.string(),
|
|
2253
|
+
submitFixRequestId: z7.string().uuid(),
|
|
2254
|
+
submitBranches: z7.array(
|
|
2255
|
+
z7.object({
|
|
2256
|
+
branchName: z7.string(),
|
|
2088
2257
|
fixes: FixResponseArrayZ
|
|
2089
2258
|
})
|
|
2090
2259
|
),
|
|
2091
|
-
error:
|
|
2092
|
-
type:
|
|
2260
|
+
error: z7.object({
|
|
2261
|
+
type: z7.enum([
|
|
2093
2262
|
"InitialRepoAccessError",
|
|
2094
2263
|
"PushBranchError",
|
|
2095
2264
|
"UnknownError"
|
|
2096
2265
|
]),
|
|
2097
|
-
info:
|
|
2098
|
-
message:
|
|
2099
|
-
pushBranchName:
|
|
2266
|
+
info: z7.object({
|
|
2267
|
+
message: z7.string(),
|
|
2268
|
+
pushBranchName: z7.string().optional()
|
|
2100
2269
|
})
|
|
2101
2270
|
}).optional()
|
|
2102
2271
|
});
|
|
2103
|
-
var SubmitFixesToSameBranchResponseMessageZ =
|
|
2104
|
-
type:
|
|
2105
|
-
githubCommentId:
|
|
2272
|
+
var SubmitFixesToSameBranchResponseMessageZ = z7.object({
|
|
2273
|
+
type: z7.literal(submitToScmMessageType.commitToSameBranch),
|
|
2274
|
+
githubCommentId: z7.number().nullish()
|
|
2106
2275
|
}).merge(SubmitFixesBaseResponseMessageZ);
|
|
2107
|
-
var SubmitFixesToDifferentBranchResponseMessageZ =
|
|
2108
|
-
type:
|
|
2109
|
-
githubCommentId:
|
|
2276
|
+
var SubmitFixesToDifferentBranchResponseMessageZ = z7.object({
|
|
2277
|
+
type: z7.literal(submitToScmMessageType.submitFixesForDifferentBranch),
|
|
2278
|
+
githubCommentId: z7.number().optional()
|
|
2110
2279
|
}).merge(SubmitFixesBaseResponseMessageZ);
|
|
2111
|
-
var SubmitFixesResponseMessageZ =
|
|
2280
|
+
var SubmitFixesResponseMessageZ = z7.discriminatedUnion("type", [
|
|
2112
2281
|
SubmitFixesToSameBranchResponseMessageZ,
|
|
2113
2282
|
SubmitFixesToDifferentBranchResponseMessageZ
|
|
2114
2283
|
]);
|
|
@@ -2126,21 +2295,21 @@ var isValidBranchName = async (branchName) => {
|
|
|
2126
2295
|
return false;
|
|
2127
2296
|
}
|
|
2128
2297
|
};
|
|
2129
|
-
var FixesZ =
|
|
2130
|
-
|
|
2131
|
-
fixId:
|
|
2132
|
-
patches:
|
|
2298
|
+
var FixesZ = z8.array(
|
|
2299
|
+
z8.object({
|
|
2300
|
+
fixId: z8.string(),
|
|
2301
|
+
patches: z8.array(z8.string())
|
|
2133
2302
|
})
|
|
2134
2303
|
).nonempty();
|
|
2135
2304
|
|
|
2136
2305
|
// src/features/analysis/scm/scm.ts
|
|
2137
2306
|
function isBrokerUrl(url) {
|
|
2138
|
-
return
|
|
2307
|
+
return z9.string().uuid().safeParse(new URL(url).host).success;
|
|
2139
2308
|
}
|
|
2140
|
-
var GetRefererenceResultZ =
|
|
2141
|
-
date:
|
|
2142
|
-
sha:
|
|
2143
|
-
type:
|
|
2309
|
+
var GetRefererenceResultZ = z9.object({
|
|
2310
|
+
date: z9.date().optional(),
|
|
2311
|
+
sha: z9.string(),
|
|
2312
|
+
type: z9.nativeEnum(ReferenceType)
|
|
2144
2313
|
});
|
|
2145
2314
|
function getCloudScmLibTypeFromUrl(url) {
|
|
2146
2315
|
if (!url) {
|
|
@@ -2181,7 +2350,7 @@ var scmTypeToScmLibScmType = {
|
|
|
2181
2350
|
["Bitbucket" /* Bitbucket */]: "BITBUCKET" /* BITBUCKET */
|
|
2182
2351
|
};
|
|
2183
2352
|
function getScmLibTypeFromScmType(scmType) {
|
|
2184
|
-
const parsedScmType =
|
|
2353
|
+
const parsedScmType = z9.nativeEnum(ScmType).parse(scmType);
|
|
2185
2354
|
return scmTypeToScmLibScmType[parsedScmType];
|
|
2186
2355
|
}
|
|
2187
2356
|
function getScmConfig({
|
|
@@ -2395,7 +2564,7 @@ var SCMLib = class {
|
|
|
2395
2564
|
if (e instanceof InvalidRepoUrlError && url) {
|
|
2396
2565
|
throw new RepoNoTokenAccessError(
|
|
2397
2566
|
"no access to repo",
|
|
2398
|
-
scmLibScmTypeToScmType[
|
|
2567
|
+
scmLibScmTypeToScmType[z9.nativeEnum(ScmLibScmType).parse(scmType)]
|
|
2399
2568
|
);
|
|
2400
2569
|
}
|
|
2401
2570
|
console.error(`error validating scm: ${scmType} `, e);
|
|
@@ -2806,7 +2975,7 @@ var GithubSCMLib = class extends SCMLib {
|
|
|
2806
2975
|
owner,
|
|
2807
2976
|
repo
|
|
2808
2977
|
});
|
|
2809
|
-
return
|
|
2978
|
+
return z9.string().parse(prRes.data);
|
|
2810
2979
|
}
|
|
2811
2980
|
async getRepoList(_scmOrg) {
|
|
2812
2981
|
this._validateAccessToken();
|
|
@@ -2997,7 +3166,7 @@ var StubSCMLib = class extends SCMLib {
|
|
|
2997
3166
|
};
|
|
2998
3167
|
function getUserAndPassword(token) {
|
|
2999
3168
|
const [username, password] = token.split(":");
|
|
3000
|
-
const safePasswordAndUsername =
|
|
3169
|
+
const safePasswordAndUsername = z9.object({ username: z9.string(), password: z9.string() }).parse({ username, password });
|
|
3001
3170
|
return {
|
|
3002
3171
|
username: safePasswordAndUsername.username,
|
|
3003
3172
|
password: safePasswordAndUsername.password
|
|
@@ -3033,7 +3202,7 @@ var BitbucketSCMLib = class extends SCMLib {
|
|
|
3033
3202
|
return { username, password, authType };
|
|
3034
3203
|
}
|
|
3035
3204
|
case "token": {
|
|
3036
|
-
return { authType, token:
|
|
3205
|
+
return { authType, token: z9.string().parse(this.accessToken) };
|
|
3037
3206
|
}
|
|
3038
3207
|
case "public":
|
|
3039
3208
|
return { authType };
|
|
@@ -3045,7 +3214,7 @@ var BitbucketSCMLib = class extends SCMLib {
|
|
|
3045
3214
|
...params,
|
|
3046
3215
|
repoUrl: this.url
|
|
3047
3216
|
});
|
|
3048
|
-
return String(
|
|
3217
|
+
return String(z9.number().parse(pullRequestRes.id));
|
|
3049
3218
|
}
|
|
3050
3219
|
async validateParams() {
|
|
3051
3220
|
return validateBitbucketParams({
|
|
@@ -3117,7 +3286,7 @@ var BitbucketSCMLib = class extends SCMLib {
|
|
|
3117
3286
|
async getUsername() {
|
|
3118
3287
|
this._validateAccessToken();
|
|
3119
3288
|
const res = await this.bitbucketSdk.getUser();
|
|
3120
|
-
return
|
|
3289
|
+
return z9.string().parse(res.username);
|
|
3121
3290
|
}
|
|
3122
3291
|
async getSubmitRequestStatus(_scmSubmitRequestId) {
|
|
3123
3292
|
this._validateAccessTokenAndUrl();
|
|
@@ -3146,7 +3315,7 @@ var BitbucketSCMLib = class extends SCMLib {
|
|
|
3146
3315
|
async getRepoDefaultBranch() {
|
|
3147
3316
|
this._validateUrl();
|
|
3148
3317
|
const repoRes = await this.bitbucketSdk.getRepo({ repoUrl: this.url });
|
|
3149
|
-
return
|
|
3318
|
+
return z9.string().parse(repoRes.mainbranch?.name);
|
|
3150
3319
|
}
|
|
3151
3320
|
getPrUrl(prNumber) {
|
|
3152
3321
|
this._validateUrl();
|
|
@@ -3168,33 +3337,33 @@ var BitbucketSCMLib = class extends SCMLib {
|
|
|
3168
3337
|
};
|
|
3169
3338
|
|
|
3170
3339
|
// src/features/analysis/scm/ado/validation.ts
|
|
3171
|
-
import { z as
|
|
3172
|
-
var ValidPullRequestStatusZ =
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3340
|
+
import { z as z10 } from "zod";
|
|
3341
|
+
var ValidPullRequestStatusZ = z10.union([
|
|
3342
|
+
z10.literal(1 /* Active */),
|
|
3343
|
+
z10.literal(2 /* Abandoned */),
|
|
3344
|
+
z10.literal(3 /* Completed */)
|
|
3176
3345
|
]);
|
|
3177
|
-
var AdoAuthResultZ =
|
|
3178
|
-
access_token:
|
|
3179
|
-
token_type:
|
|
3180
|
-
refresh_token:
|
|
3346
|
+
var AdoAuthResultZ = z10.object({
|
|
3347
|
+
access_token: z10.string().min(1),
|
|
3348
|
+
token_type: z10.string().min(1),
|
|
3349
|
+
refresh_token: z10.string().min(1)
|
|
3181
3350
|
});
|
|
3182
|
-
var profileZ =
|
|
3183
|
-
displayName:
|
|
3184
|
-
publicAlias:
|
|
3185
|
-
emailAddress:
|
|
3186
|
-
coreRevision:
|
|
3187
|
-
timeStamp:
|
|
3188
|
-
id:
|
|
3189
|
-
revision:
|
|
3351
|
+
var profileZ = z10.object({
|
|
3352
|
+
displayName: z10.string(),
|
|
3353
|
+
publicAlias: z10.string().min(1),
|
|
3354
|
+
emailAddress: z10.string(),
|
|
3355
|
+
coreRevision: z10.number(),
|
|
3356
|
+
timeStamp: z10.string(),
|
|
3357
|
+
id: z10.string(),
|
|
3358
|
+
revision: z10.number()
|
|
3190
3359
|
});
|
|
3191
|
-
var accountsZ =
|
|
3192
|
-
count:
|
|
3193
|
-
value:
|
|
3194
|
-
|
|
3195
|
-
accountId:
|
|
3196
|
-
accountUri:
|
|
3197
|
-
accountName:
|
|
3360
|
+
var accountsZ = z10.object({
|
|
3361
|
+
count: z10.number(),
|
|
3362
|
+
value: z10.array(
|
|
3363
|
+
z10.object({
|
|
3364
|
+
accountId: z10.string(),
|
|
3365
|
+
accountUri: z10.string(),
|
|
3366
|
+
accountName: z10.string()
|
|
3198
3367
|
})
|
|
3199
3368
|
)
|
|
3200
3369
|
});
|
|
@@ -3267,7 +3436,7 @@ async function getAdoConnectData({
|
|
|
3267
3436
|
oauthToken: adoTokenInfo.accessToken
|
|
3268
3437
|
});
|
|
3269
3438
|
return {
|
|
3270
|
-
org:
|
|
3439
|
+
org: z11.string().parse(org),
|
|
3271
3440
|
origin: DEFUALT_ADO_ORIGIN
|
|
3272
3441
|
};
|
|
3273
3442
|
}
|
|
@@ -3353,7 +3522,7 @@ async function getAdoClientParams(params) {
|
|
|
3353
3522
|
return {
|
|
3354
3523
|
tokenType: "PAT" /* PAT */,
|
|
3355
3524
|
accessToken: adoTokenInfo.accessToken,
|
|
3356
|
-
patTokenOrg:
|
|
3525
|
+
patTokenOrg: z11.string().parse(tokenOrg).toLowerCase(),
|
|
3357
3526
|
origin: origin2,
|
|
3358
3527
|
orgName: org.toLowerCase()
|
|
3359
3528
|
};
|
|
@@ -3707,171 +3876,6 @@ async function getAdoRepoList({
|
|
|
3707
3876
|
// src/features/analysis/scm/constants.ts
|
|
3708
3877
|
var MOBB_ICON_IMG = "https://app.mobb.ai/gh-action/Logo_Rounded_Icon.svg";
|
|
3709
3878
|
|
|
3710
|
-
// src/constants.ts
|
|
3711
|
-
var debug = Debug("mobbdev:constants");
|
|
3712
|
-
var __dirname = path2.dirname(fileURLToPath(import.meta.url));
|
|
3713
|
-
dotenv.config({ path: path2.join(__dirname, "../.env") });
|
|
3714
|
-
var scmFriendlyText = {
|
|
3715
|
-
["Ado" /* Ado */]: "Azure DevOps",
|
|
3716
|
-
["Bitbucket" /* Bitbucket */]: "Bitbucket",
|
|
3717
|
-
["GitHub" /* GitHub */]: "GitGub",
|
|
3718
|
-
["GitLab" /* GitLab */]: "GitLab"
|
|
3719
|
-
};
|
|
3720
|
-
var SCANNERS = {
|
|
3721
|
-
Checkmarx: "checkmarx",
|
|
3722
|
-
Codeql: "codeql",
|
|
3723
|
-
Fortify: "fortify",
|
|
3724
|
-
Snyk: "snyk",
|
|
3725
|
-
Sonarqube: "sonarqube"
|
|
3726
|
-
};
|
|
3727
|
-
var SupportedScannersZ = z11.enum([SCANNERS.Checkmarx, SCANNERS.Snyk]);
|
|
3728
|
-
var envVariablesSchema = z11.object({
|
|
3729
|
-
WEB_APP_URL: z11.string(),
|
|
3730
|
-
API_URL: z11.string(),
|
|
3731
|
-
HASURA_ACCESS_KEY: z11.string(),
|
|
3732
|
-
LOCAL_GRAPHQL_ENDPOINT: z11.string()
|
|
3733
|
-
}).required();
|
|
3734
|
-
var envVariables = envVariablesSchema.parse(process.env);
|
|
3735
|
-
debug("config %o", envVariables);
|
|
3736
|
-
var mobbAscii = `
|
|
3737
|
-
..
|
|
3738
|
-
..........
|
|
3739
|
-
.................
|
|
3740
|
-
...........................
|
|
3741
|
-
..............................
|
|
3742
|
-
................................
|
|
3743
|
-
..................................
|
|
3744
|
-
....................................
|
|
3745
|
-
.....................................
|
|
3746
|
-
.............................................
|
|
3747
|
-
.................................................
|
|
3748
|
-
............................... .................
|
|
3749
|
-
.................................. ............
|
|
3750
|
-
.................. ............. ..........
|
|
3751
|
-
......... ........ ......... ......
|
|
3752
|
-
............... ....
|
|
3753
|
-
.... ..
|
|
3754
|
-
|
|
3755
|
-
. ...
|
|
3756
|
-
..............
|
|
3757
|
-
......................
|
|
3758
|
-
...........................
|
|
3759
|
-
................................
|
|
3760
|
-
......................................
|
|
3761
|
-
...............................
|
|
3762
|
-
.................
|
|
3763
|
-
`;
|
|
3764
|
-
var PROJECT_DEFAULT_NAME = "My first project";
|
|
3765
|
-
var WEB_APP_URL = envVariables.WEB_APP_URL;
|
|
3766
|
-
var API_URL = envVariables.API_URL;
|
|
3767
|
-
var HASURA_ACCESS_KEY = envVariables.HASURA_ACCESS_KEY;
|
|
3768
|
-
var LOCAL_GRAPHQL_ENDPOINT = envVariables.LOCAL_GRAPHQL_ENDPOINT;
|
|
3769
|
-
var errorMessages = {
|
|
3770
|
-
missingCxProjectName: `project name ${chalk.bold(
|
|
3771
|
-
"(--cx-project-name)"
|
|
3772
|
-
)} is needed if you're using checkmarx`,
|
|
3773
|
-
missingUrl: `url ${chalk.bold(
|
|
3774
|
-
"(--url)"
|
|
3775
|
-
)} is needed if you're adding an SCM token`,
|
|
3776
|
-
invalidScmType: `SCM type ${chalk.bold(
|
|
3777
|
-
"(--scm-type)"
|
|
3778
|
-
)} is invalid, please use one of: ${Object.values(ScmType).join(", ")}`,
|
|
3779
|
-
missingToken: `SCM token ${chalk.bold(
|
|
3780
|
-
"(--token)"
|
|
3781
|
-
)} is needed if you're adding an SCM token`
|
|
3782
|
-
};
|
|
3783
|
-
var progressMassages = {
|
|
3784
|
-
processingVulnerabilityReportSuccess: "\u2699\uFE0F Vulnerability report proccessed successfully",
|
|
3785
|
-
processingVulnerabilityReport: "\u2699\uFE0F Proccessing vulnerability report",
|
|
3786
|
-
processingVulnerabilityReportFailed: "\u2699\uFE0F Error Proccessing vulnerability report"
|
|
3787
|
-
};
|
|
3788
|
-
var VUL_REPORT_DIGEST_TIMEOUT_MS = 1e3 * 60 * 20;
|
|
3789
|
-
|
|
3790
|
-
// src/features/analysis/index.ts
|
|
3791
|
-
import crypto from "node:crypto";
|
|
3792
|
-
import fs3 from "node:fs";
|
|
3793
|
-
import os from "node:os";
|
|
3794
|
-
import path6 from "node:path";
|
|
3795
|
-
import { pipeline } from "node:stream/promises";
|
|
3796
|
-
|
|
3797
|
-
// src/utils/index.ts
|
|
3798
|
-
var utils_exports = {};
|
|
3799
|
-
__export(utils_exports, {
|
|
3800
|
-
CliError: () => CliError,
|
|
3801
|
-
Spinner: () => Spinner,
|
|
3802
|
-
getDirName: () => getDirName,
|
|
3803
|
-
getTopLevelDirName: () => getTopLevelDirName,
|
|
3804
|
-
keypress: () => keypress,
|
|
3805
|
-
sleep: () => sleep
|
|
3806
|
-
});
|
|
3807
|
-
|
|
3808
|
-
// src/utils/dirname.ts
|
|
3809
|
-
import path3 from "node:path";
|
|
3810
|
-
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
3811
|
-
function getDirName() {
|
|
3812
|
-
return path3.dirname(fileURLToPath2(import.meta.url));
|
|
3813
|
-
}
|
|
3814
|
-
function getTopLevelDirName(fullPath) {
|
|
3815
|
-
return path3.parse(fullPath).name;
|
|
3816
|
-
}
|
|
3817
|
-
|
|
3818
|
-
// src/utils/keypress.ts
|
|
3819
|
-
import readline from "node:readline";
|
|
3820
|
-
async function keypress() {
|
|
3821
|
-
const rl = readline.createInterface({
|
|
3822
|
-
input: process.stdin,
|
|
3823
|
-
output: process.stdout
|
|
3824
|
-
});
|
|
3825
|
-
return new Promise((resolve) => {
|
|
3826
|
-
rl.question("", (answer) => {
|
|
3827
|
-
rl.close();
|
|
3828
|
-
process.stderr.moveCursor(0, -1);
|
|
3829
|
-
process.stderr.clearLine(1);
|
|
3830
|
-
resolve(answer);
|
|
3831
|
-
});
|
|
3832
|
-
});
|
|
3833
|
-
}
|
|
3834
|
-
|
|
3835
|
-
// src/utils/spinner.ts
|
|
3836
|
-
import {
|
|
3837
|
-
createSpinner as _createSpinner
|
|
3838
|
-
} from "nanospinner";
|
|
3839
|
-
var mockSpinner = {
|
|
3840
|
-
success: () => mockSpinner,
|
|
3841
|
-
error: () => mockSpinner,
|
|
3842
|
-
warn: () => mockSpinner,
|
|
3843
|
-
stop: () => mockSpinner,
|
|
3844
|
-
start: () => mockSpinner,
|
|
3845
|
-
update: () => mockSpinner,
|
|
3846
|
-
reset: () => mockSpinner,
|
|
3847
|
-
clear: () => mockSpinner,
|
|
3848
|
-
spin: () => mockSpinner
|
|
3849
|
-
};
|
|
3850
|
-
function Spinner({ ci = false } = {}) {
|
|
3851
|
-
return {
|
|
3852
|
-
createSpinner: (text, options) => ci ? mockSpinner : _createSpinner(text, options)
|
|
3853
|
-
};
|
|
3854
|
-
}
|
|
3855
|
-
|
|
3856
|
-
// src/utils/index.ts
|
|
3857
|
-
var sleep = (ms = 2e3) => new Promise((r) => setTimeout(r, ms));
|
|
3858
|
-
var CliError = class extends Error {
|
|
3859
|
-
};
|
|
3860
|
-
|
|
3861
|
-
// src/features/analysis/index.ts
|
|
3862
|
-
import chalk4 from "chalk";
|
|
3863
|
-
import Configstore from "configstore";
|
|
3864
|
-
import Debug13 from "debug";
|
|
3865
|
-
import extract from "extract-zip";
|
|
3866
|
-
import fetch4 from "node-fetch";
|
|
3867
|
-
import open2 from "open";
|
|
3868
|
-
import semver from "semver";
|
|
3869
|
-
import tmp2 from "tmp";
|
|
3870
|
-
import { z as z14 } from "zod";
|
|
3871
|
-
|
|
3872
|
-
// src/features/analysis/add_fix_comments_for_pr/add_fix_comments_for_pr.ts
|
|
3873
|
-
import Debug4 from "debug";
|
|
3874
|
-
|
|
3875
3879
|
// src/features/analysis/add_fix_comments_for_pr/utils.ts
|
|
3876
3880
|
import Debug3 from "debug";
|
|
3877
3881
|
import parseDiff2 from "parse-diff";
|