@darrenjcoxon/vibeguard 1.0.0
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/LICENSE +21 -0
- package/README.md +58 -0
- package/dist/agent-report.d.ts +36 -0
- package/dist/agent-report.d.ts.map +1 -0
- package/dist/agent-report.js +329 -0
- package/dist/agent-report.js.map +1 -0
- package/dist/ai-summary.d.ts +55 -0
- package/dist/ai-summary.d.ts.map +1 -0
- package/dist/ai-summary.js +267 -0
- package/dist/ai-summary.js.map +1 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +328 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator.d.ts +63 -0
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +331 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/scanners/complexity.d.ts +48 -0
- package/dist/scanners/complexity.d.ts.map +1 -0
- package/dist/scanners/complexity.js +512 -0
- package/dist/scanners/complexity.js.map +1 -0
- package/dist/scanners/eslint.d.ts +21 -0
- package/dist/scanners/eslint.d.ts.map +1 -0
- package/dist/scanners/eslint.js +196 -0
- package/dist/scanners/eslint.js.map +1 -0
- package/dist/scanners/gitleaks.d.ts +21 -0
- package/dist/scanners/gitleaks.d.ts.map +1 -0
- package/dist/scanners/gitleaks.js +158 -0
- package/dist/scanners/gitleaks.js.map +1 -0
- package/dist/scanners/index.d.ts +56 -0
- package/dist/scanners/index.d.ts.map +1 -0
- package/dist/scanners/index.js +71 -0
- package/dist/scanners/index.js.map +1 -0
- package/dist/scanners/npm-audit.d.ts +19 -0
- package/dist/scanners/npm-audit.d.ts.map +1 -0
- package/dist/scanners/npm-audit.js +176 -0
- package/dist/scanners/npm-audit.js.map +1 -0
- package/dist/scanners/semgrep.d.ts +22 -0
- package/dist/scanners/semgrep.d.ts.map +1 -0
- package/dist/scanners/semgrep.js +175 -0
- package/dist/scanners/semgrep.js.map +1 -0
- package/dist/types.d.ts +522 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +194 -0
- package/dist/types.js.map +1 -0
- package/package.json +53 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeGuard - Core Types and Interfaces
|
|
3
|
+
*
|
|
4
|
+
* Defines the common data structures used across all scanners and reporters
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
export declare const SeverityLevel: z.ZodEnum<["critical", "high", "medium", "low", "info"]>;
|
|
8
|
+
export type SeverityLevel = z.infer<typeof SeverityLevel>;
|
|
9
|
+
export declare const FindingCategory: z.ZodEnum<["security", "secret", "dependency", "quality", "complexity", "duplication", "dead-code", "style", "documentation", "test-coverage", "performance", "accessibility", "misconfiguration"]>;
|
|
10
|
+
export type FindingCategory = z.infer<typeof FindingCategory>;
|
|
11
|
+
export declare const Finding: z.ZodObject<{
|
|
12
|
+
id: z.ZodString;
|
|
13
|
+
source: z.ZodString;
|
|
14
|
+
severity: z.ZodEnum<["critical", "high", "medium", "low", "info"]>;
|
|
15
|
+
category: z.ZodEnum<["security", "secret", "dependency", "quality", "complexity", "duplication", "dead-code", "style", "documentation", "test-coverage", "performance", "accessibility", "misconfiguration"]>;
|
|
16
|
+
file: z.ZodString;
|
|
17
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
endLine: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
endColumn: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
title: z.ZodString;
|
|
22
|
+
description: z.ZodString;
|
|
23
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
24
|
+
cwe: z.ZodOptional<z.ZodString>;
|
|
25
|
+
owasp: z.ZodOptional<z.ZodString>;
|
|
26
|
+
cvss: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
cve: z.ZodOptional<z.ZodString>;
|
|
28
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
29
|
+
fixAvailable: z.ZodDefault<z.ZodBoolean>;
|
|
30
|
+
autoFixable: z.ZodDefault<z.ZodBoolean>;
|
|
31
|
+
ruleId: z.ZodOptional<z.ZodString>;
|
|
32
|
+
ruleUrl: z.ZodOptional<z.ZodString>;
|
|
33
|
+
confidence: z.ZodOptional<z.ZodEnum<["high", "medium", "low"]>>;
|
|
34
|
+
effort: z.ZodOptional<z.ZodEnum<["trivial", "easy", "medium", "hard"]>>;
|
|
35
|
+
fingerprint: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
id: string;
|
|
38
|
+
source: string;
|
|
39
|
+
severity: "critical" | "high" | "medium" | "low" | "info";
|
|
40
|
+
category: "security" | "secret" | "dependency" | "quality" | "complexity" | "duplication" | "dead-code" | "style" | "documentation" | "test-coverage" | "performance" | "accessibility" | "misconfiguration";
|
|
41
|
+
file: string;
|
|
42
|
+
title: string;
|
|
43
|
+
description: string;
|
|
44
|
+
fixAvailable: boolean;
|
|
45
|
+
autoFixable: boolean;
|
|
46
|
+
line?: number | undefined;
|
|
47
|
+
endLine?: number | undefined;
|
|
48
|
+
column?: number | undefined;
|
|
49
|
+
endColumn?: number | undefined;
|
|
50
|
+
snippet?: string | undefined;
|
|
51
|
+
cwe?: string | undefined;
|
|
52
|
+
owasp?: string | undefined;
|
|
53
|
+
cvss?: number | undefined;
|
|
54
|
+
cve?: string | undefined;
|
|
55
|
+
suggestion?: string | undefined;
|
|
56
|
+
ruleId?: string | undefined;
|
|
57
|
+
ruleUrl?: string | undefined;
|
|
58
|
+
confidence?: "high" | "medium" | "low" | undefined;
|
|
59
|
+
effort?: "medium" | "trivial" | "easy" | "hard" | undefined;
|
|
60
|
+
fingerprint?: string | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
id: string;
|
|
63
|
+
source: string;
|
|
64
|
+
severity: "critical" | "high" | "medium" | "low" | "info";
|
|
65
|
+
category: "security" | "secret" | "dependency" | "quality" | "complexity" | "duplication" | "dead-code" | "style" | "documentation" | "test-coverage" | "performance" | "accessibility" | "misconfiguration";
|
|
66
|
+
file: string;
|
|
67
|
+
title: string;
|
|
68
|
+
description: string;
|
|
69
|
+
line?: number | undefined;
|
|
70
|
+
endLine?: number | undefined;
|
|
71
|
+
column?: number | undefined;
|
|
72
|
+
endColumn?: number | undefined;
|
|
73
|
+
snippet?: string | undefined;
|
|
74
|
+
cwe?: string | undefined;
|
|
75
|
+
owasp?: string | undefined;
|
|
76
|
+
cvss?: number | undefined;
|
|
77
|
+
cve?: string | undefined;
|
|
78
|
+
suggestion?: string | undefined;
|
|
79
|
+
fixAvailable?: boolean | undefined;
|
|
80
|
+
autoFixable?: boolean | undefined;
|
|
81
|
+
ruleId?: string | undefined;
|
|
82
|
+
ruleUrl?: string | undefined;
|
|
83
|
+
confidence?: "high" | "medium" | "low" | undefined;
|
|
84
|
+
effort?: "medium" | "trivial" | "easy" | "hard" | undefined;
|
|
85
|
+
fingerprint?: string | undefined;
|
|
86
|
+
}>;
|
|
87
|
+
export type Finding = z.infer<typeof Finding>;
|
|
88
|
+
export declare const ScannerConfig: z.ZodObject<{
|
|
89
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
90
|
+
name: z.ZodString;
|
|
91
|
+
timeout: z.ZodDefault<z.ZodNumber>;
|
|
92
|
+
categories: z.ZodArray<z.ZodEnum<["security", "secret", "dependency", "quality", "complexity", "duplication", "dead-code", "style", "documentation", "test-coverage", "performance", "accessibility", "misconfiguration"]>, "many">;
|
|
93
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
enabled: boolean;
|
|
96
|
+
name: string;
|
|
97
|
+
timeout: number;
|
|
98
|
+
categories: ("security" | "secret" | "dependency" | "quality" | "complexity" | "duplication" | "dead-code" | "style" | "documentation" | "test-coverage" | "performance" | "accessibility" | "misconfiguration")[];
|
|
99
|
+
options?: Record<string, any> | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
name: string;
|
|
102
|
+
categories: ("security" | "secret" | "dependency" | "quality" | "complexity" | "duplication" | "dead-code" | "style" | "documentation" | "test-coverage" | "performance" | "accessibility" | "misconfiguration")[];
|
|
103
|
+
options?: Record<string, any> | undefined;
|
|
104
|
+
enabled?: boolean | undefined;
|
|
105
|
+
timeout?: number | undefined;
|
|
106
|
+
}>;
|
|
107
|
+
export type ScannerConfig = z.infer<typeof ScannerConfig>;
|
|
108
|
+
export declare const ScanTargetSchema: z.ZodObject<{
|
|
109
|
+
path: z.ZodString;
|
|
110
|
+
git: z.ZodOptional<z.ZodObject<{
|
|
111
|
+
remote: z.ZodOptional<z.ZodString>;
|
|
112
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
113
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
114
|
+
baseBranch: z.ZodOptional<z.ZodString>;
|
|
115
|
+
baseCommit: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, "strip", z.ZodTypeAny, {
|
|
117
|
+
remote?: string | undefined;
|
|
118
|
+
branch?: string | undefined;
|
|
119
|
+
commit?: string | undefined;
|
|
120
|
+
baseBranch?: string | undefined;
|
|
121
|
+
baseCommit?: string | undefined;
|
|
122
|
+
}, {
|
|
123
|
+
remote?: string | undefined;
|
|
124
|
+
branch?: string | undefined;
|
|
125
|
+
commit?: string | undefined;
|
|
126
|
+
baseBranch?: string | undefined;
|
|
127
|
+
baseCommit?: string | undefined;
|
|
128
|
+
}>>;
|
|
129
|
+
pullRequest: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
provider: z.ZodEnum<["github", "gitlab", "azure-devops", "bitbucket"]>;
|
|
131
|
+
number: z.ZodNumber;
|
|
132
|
+
url: z.ZodString;
|
|
133
|
+
title: z.ZodOptional<z.ZodString>;
|
|
134
|
+
author: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, "strip", z.ZodTypeAny, {
|
|
136
|
+
number: number;
|
|
137
|
+
provider: "github" | "gitlab" | "azure-devops" | "bitbucket";
|
|
138
|
+
url: string;
|
|
139
|
+
title?: string | undefined;
|
|
140
|
+
author?: string | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
number: number;
|
|
143
|
+
provider: "github" | "gitlab" | "azure-devops" | "bitbucket";
|
|
144
|
+
url: string;
|
|
145
|
+
title?: string | undefined;
|
|
146
|
+
author?: string | undefined;
|
|
147
|
+
}>>;
|
|
148
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
149
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
150
|
+
changedFilesOnly: z.ZodOptional<z.ZodBoolean>;
|
|
151
|
+
}, "strip", z.ZodTypeAny, {
|
|
152
|
+
path: string;
|
|
153
|
+
git?: {
|
|
154
|
+
remote?: string | undefined;
|
|
155
|
+
branch?: string | undefined;
|
|
156
|
+
commit?: string | undefined;
|
|
157
|
+
baseBranch?: string | undefined;
|
|
158
|
+
baseCommit?: string | undefined;
|
|
159
|
+
} | undefined;
|
|
160
|
+
pullRequest?: {
|
|
161
|
+
number: number;
|
|
162
|
+
provider: "github" | "gitlab" | "azure-devops" | "bitbucket";
|
|
163
|
+
url: string;
|
|
164
|
+
title?: string | undefined;
|
|
165
|
+
author?: string | undefined;
|
|
166
|
+
} | undefined;
|
|
167
|
+
include?: string[] | undefined;
|
|
168
|
+
exclude?: string[] | undefined;
|
|
169
|
+
changedFilesOnly?: boolean | undefined;
|
|
170
|
+
}, {
|
|
171
|
+
path: string;
|
|
172
|
+
git?: {
|
|
173
|
+
remote?: string | undefined;
|
|
174
|
+
branch?: string | undefined;
|
|
175
|
+
commit?: string | undefined;
|
|
176
|
+
baseBranch?: string | undefined;
|
|
177
|
+
baseCommit?: string | undefined;
|
|
178
|
+
} | undefined;
|
|
179
|
+
pullRequest?: {
|
|
180
|
+
number: number;
|
|
181
|
+
provider: "github" | "gitlab" | "azure-devops" | "bitbucket";
|
|
182
|
+
url: string;
|
|
183
|
+
title?: string | undefined;
|
|
184
|
+
author?: string | undefined;
|
|
185
|
+
} | undefined;
|
|
186
|
+
include?: string[] | undefined;
|
|
187
|
+
exclude?: string[] | undefined;
|
|
188
|
+
changedFilesOnly?: boolean | undefined;
|
|
189
|
+
}>;
|
|
190
|
+
export interface ScanTarget {
|
|
191
|
+
path: string;
|
|
192
|
+
git?: {
|
|
193
|
+
remote?: string;
|
|
194
|
+
branch?: string;
|
|
195
|
+
commit?: string;
|
|
196
|
+
baseBranch?: string;
|
|
197
|
+
baseCommit?: string;
|
|
198
|
+
};
|
|
199
|
+
pullRequest?: {
|
|
200
|
+
provider: 'github' | 'gitlab' | 'azure-devops' | 'bitbucket';
|
|
201
|
+
number: number;
|
|
202
|
+
url: string;
|
|
203
|
+
title?: string;
|
|
204
|
+
author?: string;
|
|
205
|
+
};
|
|
206
|
+
include?: string[];
|
|
207
|
+
exclude?: string[];
|
|
208
|
+
changedFilesOnly?: boolean;
|
|
209
|
+
}
|
|
210
|
+
export declare const ScannerResult: z.ZodObject<{
|
|
211
|
+
scanner: z.ZodString;
|
|
212
|
+
success: z.ZodBoolean;
|
|
213
|
+
error: z.ZodOptional<z.ZodString>;
|
|
214
|
+
findings: z.ZodArray<z.ZodObject<{
|
|
215
|
+
id: z.ZodString;
|
|
216
|
+
source: z.ZodString;
|
|
217
|
+
severity: z.ZodEnum<["critical", "high", "medium", "low", "info"]>;
|
|
218
|
+
category: z.ZodEnum<["security", "secret", "dependency", "quality", "complexity", "duplication", "dead-code", "style", "documentation", "test-coverage", "performance", "accessibility", "misconfiguration"]>;
|
|
219
|
+
file: z.ZodString;
|
|
220
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
221
|
+
endLine: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
223
|
+
endColumn: z.ZodOptional<z.ZodNumber>;
|
|
224
|
+
title: z.ZodString;
|
|
225
|
+
description: z.ZodString;
|
|
226
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
227
|
+
cwe: z.ZodOptional<z.ZodString>;
|
|
228
|
+
owasp: z.ZodOptional<z.ZodString>;
|
|
229
|
+
cvss: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
cve: z.ZodOptional<z.ZodString>;
|
|
231
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
232
|
+
fixAvailable: z.ZodDefault<z.ZodBoolean>;
|
|
233
|
+
autoFixable: z.ZodDefault<z.ZodBoolean>;
|
|
234
|
+
ruleId: z.ZodOptional<z.ZodString>;
|
|
235
|
+
ruleUrl: z.ZodOptional<z.ZodString>;
|
|
236
|
+
confidence: z.ZodOptional<z.ZodEnum<["high", "medium", "low"]>>;
|
|
237
|
+
effort: z.ZodOptional<z.ZodEnum<["trivial", "easy", "medium", "hard"]>>;
|
|
238
|
+
fingerprint: z.ZodOptional<z.ZodString>;
|
|
239
|
+
}, "strip", z.ZodTypeAny, {
|
|
240
|
+
id: string;
|
|
241
|
+
source: string;
|
|
242
|
+
severity: "critical" | "high" | "medium" | "low" | "info";
|
|
243
|
+
category: "security" | "secret" | "dependency" | "quality" | "complexity" | "duplication" | "dead-code" | "style" | "documentation" | "test-coverage" | "performance" | "accessibility" | "misconfiguration";
|
|
244
|
+
file: string;
|
|
245
|
+
title: string;
|
|
246
|
+
description: string;
|
|
247
|
+
fixAvailable: boolean;
|
|
248
|
+
autoFixable: boolean;
|
|
249
|
+
line?: number | undefined;
|
|
250
|
+
endLine?: number | undefined;
|
|
251
|
+
column?: number | undefined;
|
|
252
|
+
endColumn?: number | undefined;
|
|
253
|
+
snippet?: string | undefined;
|
|
254
|
+
cwe?: string | undefined;
|
|
255
|
+
owasp?: string | undefined;
|
|
256
|
+
cvss?: number | undefined;
|
|
257
|
+
cve?: string | undefined;
|
|
258
|
+
suggestion?: string | undefined;
|
|
259
|
+
ruleId?: string | undefined;
|
|
260
|
+
ruleUrl?: string | undefined;
|
|
261
|
+
confidence?: "high" | "medium" | "low" | undefined;
|
|
262
|
+
effort?: "medium" | "trivial" | "easy" | "hard" | undefined;
|
|
263
|
+
fingerprint?: string | undefined;
|
|
264
|
+
}, {
|
|
265
|
+
id: string;
|
|
266
|
+
source: string;
|
|
267
|
+
severity: "critical" | "high" | "medium" | "low" | "info";
|
|
268
|
+
category: "security" | "secret" | "dependency" | "quality" | "complexity" | "duplication" | "dead-code" | "style" | "documentation" | "test-coverage" | "performance" | "accessibility" | "misconfiguration";
|
|
269
|
+
file: string;
|
|
270
|
+
title: string;
|
|
271
|
+
description: string;
|
|
272
|
+
line?: number | undefined;
|
|
273
|
+
endLine?: number | undefined;
|
|
274
|
+
column?: number | undefined;
|
|
275
|
+
endColumn?: number | undefined;
|
|
276
|
+
snippet?: string | undefined;
|
|
277
|
+
cwe?: string | undefined;
|
|
278
|
+
owasp?: string | undefined;
|
|
279
|
+
cvss?: number | undefined;
|
|
280
|
+
cve?: string | undefined;
|
|
281
|
+
suggestion?: string | undefined;
|
|
282
|
+
fixAvailable?: boolean | undefined;
|
|
283
|
+
autoFixable?: boolean | undefined;
|
|
284
|
+
ruleId?: string | undefined;
|
|
285
|
+
ruleUrl?: string | undefined;
|
|
286
|
+
confidence?: "high" | "medium" | "low" | undefined;
|
|
287
|
+
effort?: "medium" | "trivial" | "easy" | "hard" | undefined;
|
|
288
|
+
fingerprint?: string | undefined;
|
|
289
|
+
}>, "many">;
|
|
290
|
+
metrics: z.ZodObject<{
|
|
291
|
+
filesScanned: z.ZodOptional<z.ZodNumber>;
|
|
292
|
+
linesScanned: z.ZodOptional<z.ZodNumber>;
|
|
293
|
+
duration: z.ZodNumber;
|
|
294
|
+
}, "strip", z.ZodTypeAny, {
|
|
295
|
+
duration: number;
|
|
296
|
+
filesScanned?: number | undefined;
|
|
297
|
+
linesScanned?: number | undefined;
|
|
298
|
+
}, {
|
|
299
|
+
duration: number;
|
|
300
|
+
filesScanned?: number | undefined;
|
|
301
|
+
linesScanned?: number | undefined;
|
|
302
|
+
}>;
|
|
303
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
304
|
+
}, "strip", z.ZodTypeAny, {
|
|
305
|
+
scanner: string;
|
|
306
|
+
success: boolean;
|
|
307
|
+
findings: {
|
|
308
|
+
id: string;
|
|
309
|
+
source: string;
|
|
310
|
+
severity: "critical" | "high" | "medium" | "low" | "info";
|
|
311
|
+
category: "security" | "secret" | "dependency" | "quality" | "complexity" | "duplication" | "dead-code" | "style" | "documentation" | "test-coverage" | "performance" | "accessibility" | "misconfiguration";
|
|
312
|
+
file: string;
|
|
313
|
+
title: string;
|
|
314
|
+
description: string;
|
|
315
|
+
fixAvailable: boolean;
|
|
316
|
+
autoFixable: boolean;
|
|
317
|
+
line?: number | undefined;
|
|
318
|
+
endLine?: number | undefined;
|
|
319
|
+
column?: number | undefined;
|
|
320
|
+
endColumn?: number | undefined;
|
|
321
|
+
snippet?: string | undefined;
|
|
322
|
+
cwe?: string | undefined;
|
|
323
|
+
owasp?: string | undefined;
|
|
324
|
+
cvss?: number | undefined;
|
|
325
|
+
cve?: string | undefined;
|
|
326
|
+
suggestion?: string | undefined;
|
|
327
|
+
ruleId?: string | undefined;
|
|
328
|
+
ruleUrl?: string | undefined;
|
|
329
|
+
confidence?: "high" | "medium" | "low" | undefined;
|
|
330
|
+
effort?: "medium" | "trivial" | "easy" | "hard" | undefined;
|
|
331
|
+
fingerprint?: string | undefined;
|
|
332
|
+
}[];
|
|
333
|
+
metrics: {
|
|
334
|
+
duration: number;
|
|
335
|
+
filesScanned?: number | undefined;
|
|
336
|
+
linesScanned?: number | undefined;
|
|
337
|
+
};
|
|
338
|
+
error?: string | undefined;
|
|
339
|
+
metadata?: Record<string, any> | undefined;
|
|
340
|
+
}, {
|
|
341
|
+
scanner: string;
|
|
342
|
+
success: boolean;
|
|
343
|
+
findings: {
|
|
344
|
+
id: string;
|
|
345
|
+
source: string;
|
|
346
|
+
severity: "critical" | "high" | "medium" | "low" | "info";
|
|
347
|
+
category: "security" | "secret" | "dependency" | "quality" | "complexity" | "duplication" | "dead-code" | "style" | "documentation" | "test-coverage" | "performance" | "accessibility" | "misconfiguration";
|
|
348
|
+
file: string;
|
|
349
|
+
title: string;
|
|
350
|
+
description: string;
|
|
351
|
+
line?: number | undefined;
|
|
352
|
+
endLine?: number | undefined;
|
|
353
|
+
column?: number | undefined;
|
|
354
|
+
endColumn?: number | undefined;
|
|
355
|
+
snippet?: string | undefined;
|
|
356
|
+
cwe?: string | undefined;
|
|
357
|
+
owasp?: string | undefined;
|
|
358
|
+
cvss?: number | undefined;
|
|
359
|
+
cve?: string | undefined;
|
|
360
|
+
suggestion?: string | undefined;
|
|
361
|
+
fixAvailable?: boolean | undefined;
|
|
362
|
+
autoFixable?: boolean | undefined;
|
|
363
|
+
ruleId?: string | undefined;
|
|
364
|
+
ruleUrl?: string | undefined;
|
|
365
|
+
confidence?: "high" | "medium" | "low" | undefined;
|
|
366
|
+
effort?: "medium" | "trivial" | "easy" | "hard" | undefined;
|
|
367
|
+
fingerprint?: string | undefined;
|
|
368
|
+
}[];
|
|
369
|
+
metrics: {
|
|
370
|
+
duration: number;
|
|
371
|
+
filesScanned?: number | undefined;
|
|
372
|
+
linesScanned?: number | undefined;
|
|
373
|
+
};
|
|
374
|
+
error?: string | undefined;
|
|
375
|
+
metadata?: Record<string, any> | undefined;
|
|
376
|
+
}>;
|
|
377
|
+
export type ScannerResult = z.infer<typeof ScannerResult>;
|
|
378
|
+
export declare const ScanReportSchema: z.ZodObject<{
|
|
379
|
+
id: z.ZodString;
|
|
380
|
+
timestamp: z.ZodString;
|
|
381
|
+
target: z.ZodAny;
|
|
382
|
+
results: z.ZodArray<z.ZodAny, "many">;
|
|
383
|
+
findings: z.ZodArray<z.ZodAny, "many">;
|
|
384
|
+
summary: z.ZodObject<{
|
|
385
|
+
totalFindings: z.ZodNumber;
|
|
386
|
+
bySeverity: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
387
|
+
byCategory: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
388
|
+
byScanner: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
389
|
+
passesQualityGate: z.ZodBoolean;
|
|
390
|
+
qualityGateDetails: z.ZodOptional<z.ZodString>;
|
|
391
|
+
}, "strip", z.ZodTypeAny, {
|
|
392
|
+
totalFindings: number;
|
|
393
|
+
bySeverity: Record<string, number>;
|
|
394
|
+
byCategory: Record<string, number>;
|
|
395
|
+
byScanner: Record<string, number>;
|
|
396
|
+
passesQualityGate: boolean;
|
|
397
|
+
qualityGateDetails?: string | undefined;
|
|
398
|
+
}, {
|
|
399
|
+
totalFindings: number;
|
|
400
|
+
bySeverity: Record<string, number>;
|
|
401
|
+
byCategory: Record<string, number>;
|
|
402
|
+
byScanner: Record<string, number>;
|
|
403
|
+
passesQualityGate: boolean;
|
|
404
|
+
qualityGateDetails?: string | undefined;
|
|
405
|
+
}>;
|
|
406
|
+
aiSummary: z.ZodOptional<z.ZodString>;
|
|
407
|
+
aiRecommendations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
408
|
+
}, "strip", z.ZodTypeAny, {
|
|
409
|
+
id: string;
|
|
410
|
+
findings: any[];
|
|
411
|
+
timestamp: string;
|
|
412
|
+
results: any[];
|
|
413
|
+
summary: {
|
|
414
|
+
totalFindings: number;
|
|
415
|
+
bySeverity: Record<string, number>;
|
|
416
|
+
byCategory: Record<string, number>;
|
|
417
|
+
byScanner: Record<string, number>;
|
|
418
|
+
passesQualityGate: boolean;
|
|
419
|
+
qualityGateDetails?: string | undefined;
|
|
420
|
+
};
|
|
421
|
+
target?: any;
|
|
422
|
+
aiSummary?: string | undefined;
|
|
423
|
+
aiRecommendations?: string[] | undefined;
|
|
424
|
+
}, {
|
|
425
|
+
id: string;
|
|
426
|
+
findings: any[];
|
|
427
|
+
timestamp: string;
|
|
428
|
+
results: any[];
|
|
429
|
+
summary: {
|
|
430
|
+
totalFindings: number;
|
|
431
|
+
bySeverity: Record<string, number>;
|
|
432
|
+
byCategory: Record<string, number>;
|
|
433
|
+
byScanner: Record<string, number>;
|
|
434
|
+
passesQualityGate: boolean;
|
|
435
|
+
qualityGateDetails?: string | undefined;
|
|
436
|
+
};
|
|
437
|
+
target?: any;
|
|
438
|
+
aiSummary?: string | undefined;
|
|
439
|
+
aiRecommendations?: string[] | undefined;
|
|
440
|
+
}>;
|
|
441
|
+
export interface ScanReport {
|
|
442
|
+
id: string;
|
|
443
|
+
timestamp: string;
|
|
444
|
+
target: ScanTarget;
|
|
445
|
+
results: ScannerResult[];
|
|
446
|
+
findings: Finding[];
|
|
447
|
+
summary: {
|
|
448
|
+
totalFindings: number;
|
|
449
|
+
bySeverity: Record<string, number>;
|
|
450
|
+
byCategory: Record<string, number>;
|
|
451
|
+
byScanner: Record<string, number>;
|
|
452
|
+
passesQualityGate: boolean;
|
|
453
|
+
qualityGateDetails?: string;
|
|
454
|
+
};
|
|
455
|
+
aiSummary?: string;
|
|
456
|
+
aiRecommendations?: string[];
|
|
457
|
+
}
|
|
458
|
+
export declare const QualityGate: z.ZodObject<{
|
|
459
|
+
name: z.ZodString;
|
|
460
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
461
|
+
metric: z.ZodEnum<["critical_findings", "high_findings", "security_findings", "secret_findings", "total_findings", "new_findings", "code_coverage", "duplication_ratio"]>;
|
|
462
|
+
operator: z.ZodEnum<["lt", "lte", "gt", "gte", "eq"]>;
|
|
463
|
+
threshold: z.ZodNumber;
|
|
464
|
+
failOnBreach: z.ZodDefault<z.ZodBoolean>;
|
|
465
|
+
}, "strip", z.ZodTypeAny, {
|
|
466
|
+
metric: "critical_findings" | "high_findings" | "security_findings" | "secret_findings" | "total_findings" | "new_findings" | "code_coverage" | "duplication_ratio";
|
|
467
|
+
operator: "lt" | "lte" | "gt" | "gte" | "eq";
|
|
468
|
+
threshold: number;
|
|
469
|
+
failOnBreach: boolean;
|
|
470
|
+
}, {
|
|
471
|
+
metric: "critical_findings" | "high_findings" | "security_findings" | "secret_findings" | "total_findings" | "new_findings" | "code_coverage" | "duplication_ratio";
|
|
472
|
+
operator: "lt" | "lte" | "gt" | "gte" | "eq";
|
|
473
|
+
threshold: number;
|
|
474
|
+
failOnBreach?: boolean | undefined;
|
|
475
|
+
}>, "many">;
|
|
476
|
+
}, "strip", z.ZodTypeAny, {
|
|
477
|
+
name: string;
|
|
478
|
+
rules: {
|
|
479
|
+
metric: "critical_findings" | "high_findings" | "security_findings" | "secret_findings" | "total_findings" | "new_findings" | "code_coverage" | "duplication_ratio";
|
|
480
|
+
operator: "lt" | "lte" | "gt" | "gte" | "eq";
|
|
481
|
+
threshold: number;
|
|
482
|
+
failOnBreach: boolean;
|
|
483
|
+
}[];
|
|
484
|
+
}, {
|
|
485
|
+
name: string;
|
|
486
|
+
rules: {
|
|
487
|
+
metric: "critical_findings" | "high_findings" | "security_findings" | "secret_findings" | "total_findings" | "new_findings" | "code_coverage" | "duplication_ratio";
|
|
488
|
+
operator: "lt" | "lte" | "gt" | "gte" | "eq";
|
|
489
|
+
threshold: number;
|
|
490
|
+
failOnBreach?: boolean | undefined;
|
|
491
|
+
}[];
|
|
492
|
+
}>;
|
|
493
|
+
export type QualityGate = z.infer<typeof QualityGate>;
|
|
494
|
+
export interface Scanner {
|
|
495
|
+
name: string;
|
|
496
|
+
categories: FindingCategory[];
|
|
497
|
+
/**
|
|
498
|
+
* Check if this scanner is available/configured
|
|
499
|
+
*/
|
|
500
|
+
isAvailable(): Promise<boolean>;
|
|
501
|
+
/**
|
|
502
|
+
* Run the scan
|
|
503
|
+
*/
|
|
504
|
+
scan(target: ScanTarget, config?: ScannerConfig): Promise<ScannerResult>;
|
|
505
|
+
}
|
|
506
|
+
export interface Reporter {
|
|
507
|
+
name: string;
|
|
508
|
+
/**
|
|
509
|
+
* Generate/send report
|
|
510
|
+
*/
|
|
511
|
+
report(scanReport: ScanReport): Promise<void>;
|
|
512
|
+
}
|
|
513
|
+
export declare const DEFAULT_QUALITY_GATE: QualityGate;
|
|
514
|
+
/**
|
|
515
|
+
* Generate a fingerprint for deduplication
|
|
516
|
+
*/
|
|
517
|
+
export declare function generateFingerprint(finding: Partial<Finding>): string;
|
|
518
|
+
/**
|
|
519
|
+
* Severity weight for sorting
|
|
520
|
+
*/
|
|
521
|
+
export declare function severityWeight(severity: SeverityLevel): number;
|
|
522
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,aAAa,0DAAwD,CAAC;AACnF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,eAAO,MAAM,eAAe,qMAc1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAM9D,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwClB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAM9C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;EAUxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAM1D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B3B,CAAC;AAGH,MAAM,WAAW,UAAU;IAC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