fix: move ProviderType to shared types and update usages (#7710)

This commit is contained in:
Pablo Lara
2025-05-12 11:54:42 +02:00
committed by GitHub
parent 5c375d63c5
commit 60e0040577
18 changed files with 102 additions and 99 deletions
+4 -68
View File
@@ -1,6 +1,8 @@
import { LucideIcon } from "lucide-react";
import { SVGProps } from "react";
import { ProviderType } from "./providers";
export type IconSvgProps = SVGProps<SVGSVGElement> & {
size?: number;
};
@@ -45,7 +47,7 @@ export interface CollapseMenuButtonProps {
export interface SelectScanComplianceDataProps {
scans: (ScanProps & {
providerInfo: {
provider: "aws" | "azure" | "gcp" | "kubernetes";
provider: ProviderType;
uid: string;
alias: string;
};
@@ -174,27 +176,6 @@ export interface FindingsSeverityOverview {
};
}
export interface ProviderOverviewProps {
data: {
type: "provider-overviews";
id: "aws" | "gcp" | "azure" | "kubernetes";
attributes: {
findings: {
pass: number;
fail: number;
manual: number;
total: number;
};
resources: {
total: number;
};
};
}[];
meta: {
version: string;
};
}
export interface TaskDetails {
attributes: {
state: string;
@@ -509,51 +490,6 @@ export interface UserProps {
}[];
}
export interface ProviderProps {
id: string;
type: "providers";
attributes: {
provider: "aws" | "azure" | "m365" | "gcp" | "kubernetes";
uid: string;
alias: string;
status: "completed" | "pending" | "cancelled";
resources: number;
connection: {
connected: boolean;
last_checked_at: string;
};
scanner_args: {
only_logs: boolean;
excluded_checks: string[];
aws_retries_max_attempts: number;
};
inserted_at: string;
updated_at: string;
created_by: {
object: string;
id: string;
};
};
relationships: {
secret: {
data: {
type: string;
id: string;
} | null;
};
provider_groups: {
meta: {
count: number;
};
data: Array<{
type: string;
id: string;
}>;
};
};
groupNames?: string[];
}
export interface ScanProps {
type: "scans";
id: string;
@@ -596,7 +532,7 @@ export interface ScanProps {
};
};
providerInfo?: {
provider: "aws" | "azure" | "gcp" | "kubernetes";
provider: ProviderType;
uid: string;
alias: string;
};
+1
View File
@@ -2,3 +2,4 @@ export * from "./authFormSchema";
export * from "./components";
export * from "./filters";
export * from "./formSchemas";
export * from "./providers";
+67
View File
@@ -0,0 +1,67 @@
export type ProviderType = "aws" | "azure" | "m365" | "gcp" | "kubernetes";
export interface ProviderProps {
id: string;
type: "providers";
attributes: {
provider: ProviderType;
uid: string;
alias: string;
status: "completed" | "pending" | "cancelled";
resources: number;
connection: {
connected: boolean;
last_checked_at: string;
};
scanner_args: {
only_logs: boolean;
excluded_checks: string[];
aws_retries_max_attempts: number;
};
inserted_at: string;
updated_at: string;
created_by: {
object: string;
id: string;
};
};
relationships: {
secret: {
data: {
type: string;
id: string;
} | null;
};
provider_groups: {
meta: {
count: number;
};
data: Array<{
type: string;
id: string;
}>;
};
};
groupNames?: string[];
}
export interface ProviderOverviewProps {
data: {
type: "provider-overviews";
id: ProviderType;
attributes: {
findings: {
pass: number;
fail: number;
manual: number;
total: number;
};
resources: {
total: number;
};
};
}[];
meta: {
version: string;
};
}