|
19 | 19 |
|
20 | 20 | import z from 'zod';
|
21 | 21 |
|
22 |
| -import { |
23 |
| - $OrtRunStatus, |
24 |
| - $Severity, |
25 |
| - $VulnerabilityRating, |
26 |
| -} from '@/api/requests/schemas.gen'; |
27 |
| - |
28 | 22 | // Enum schema for the groupId parameter of the Groups endpoints
|
29 | 23 | export const groupsSchema = z.enum(['admins', 'writers', 'readers']);
|
30 | 24 |
|
31 |
| -// Enum schema for the possible values of the status parameter of the ORT run |
32 |
| -export const runStatusSchema = z.enum($OrtRunStatus.enum); |
33 |
| - |
34 |
| -// Enum schema for the possible values of the severities |
35 |
| -export const severitySchema = z.enum($Severity.enum); |
36 |
| - |
37 | 25 | // Enum schema and type for the resolved statuses of issues, vulnerabilites, and rule violations
|
38 | 26 | export const itemResolvedSchema = z.enum(['Resolved', 'Unresolved']);
|
39 | 27 | export type ItemResolved = z.infer<typeof itemResolvedSchema>;
|
40 | 28 |
|
41 |
| -// Enum schema for the possible values of the advisory overall vulnerability ratings |
42 |
| -export const vulnerabilityRatingSchema = z.enum($VulnerabilityRating.enum); |
43 |
| - |
44 | 29 | // Enum schema and type for the possible values of the issue categories.
|
45 | 30 | export const issueCategorySchema = z.enum([
|
46 | 31 | 'Build System',
|
@@ -70,6 +55,27 @@ export const repositoryTypeSchema = z.enum([
|
70 | 55 | 'SUBVERSION',
|
71 | 56 | ]);
|
72 | 57 |
|
| 58 | +// Enum schema for the possible values of the status parameter of the ORT run |
| 59 | +export const runStatusSchema = z.enum([ |
| 60 | + 'CREATED', |
| 61 | + 'ACTIVE', |
| 62 | + 'FINISHED', |
| 63 | + 'FAILED', |
| 64 | + 'FINISHED_WITH_ISSUES', |
| 65 | +]); |
| 66 | + |
| 67 | +// Enum schema for the possible values of the severities |
| 68 | +export const severitySchema = z.enum(['HINT', 'WARNING', 'ERROR']); |
| 69 | + |
| 70 | +// Enum schema for the possible values of the advisory overall vulnerability ratings |
| 71 | +export const vulnerabilityRatingSchema = z.enum([ |
| 72 | + 'NONE', |
| 73 | + 'LOW', |
| 74 | + 'MEDIUM', |
| 75 | + 'HIGH', |
| 76 | + 'CRITICAL', |
| 77 | +]); |
| 78 | + |
73 | 79 | // Search parameter validation schemas
|
74 | 80 |
|
75 | 81 | export const paginationSearchParameterSchema = z.object({
|
|
0 commit comments