Fix NextJS reviews

This commit is contained in:
Chandrapal Badshah committed 2025-05-14 14:45:25 +05:30
1 parent 32701114bb
commit c99f202e74
10 files changed
+17 -87

No files matched your search

+4 -4
View File
@@ -5,14 +5,14 @@ export const getLighthouseCompliancesOverview = async ({
fields,
filters,
page,
page_size,
pageSize,
sort,
}: {
scanId: string;
fields?: string[];
filters?: Record<string, string | number | boolean | undefined>;
page?: number;
page_size?: number;
pageSize?: number;
sort?: string;
}) => {
const headers = await getAuthHeaders({ contentType: false });
@@ -39,8 +39,8 @@ export const getLighthouseCompliancesOverview = async ({
if (page) {
url.searchParams.append("page[number]", page.toString());
}
if (page_size) {
url.searchParams.append("page[size]", page_size.toString());
if (pageSize) {
url.searchParams.append("page[size]", pageSize.toString());
}
// Handle sorting
@@ -1,19 +0,0 @@
import "@/styles/globals.css";
import React from "react";
import { ContentLayout } from "@/components/ui";
interface ChatbotConfigLayoutProps {
children: React.ReactNode;
}
export default function ChatbotConfigLayout({
children,
}: ChatbotConfigLayoutProps) {
return (
<ContentLayout title="Configure Chatbot" icon="lucide:settings">
{children}
</ContentLayout>
);
}
+3 -5
View File
@@ -4,10 +4,8 @@ import Chat from "./chat";
export default function AIChatbot() {
return (
<div>
<ContentLayout title="Cloud Security Analyst" icon="lucide:bot">
<Chat />
</ContentLayout>
</div>
<ContentLayout title="Cloud Security Analyst" icon="lucide:bot">
<Chat />
</ContentLayout>
);
}
+2 -2
View File
@@ -4,8 +4,8 @@ import { getLighthouseProviderChecks } from "@/lib/lighthouse/helpers/checks";
import { checkSchema } from "@/types/lighthouse";
export const getProviderChecksTool = tool(
async ({ provider_type }) => {
const checks = await getLighthouseProviderChecks(provider_type);
async ({ providerType }) => {
const checks = await getLighthouseProviderChecks(providerType);
return checks;
},
{
+4 -4
View File
@@ -12,13 +12,13 @@ import {
} from "@/types/lighthouse";
export const getCompliancesOverviewTool = tool(
async ({ scanId, fields, filters, page, page_size, sort }) => {
async ({ scanId, fields, filters, page, pageSize, sort }) => {
return await getLighthouseCompliancesOverview({
scanId,
fields,
filters,
page,
page_size,
pageSize,
sort,
});
},
@@ -31,8 +31,8 @@ export const getCompliancesOverviewTool = tool(
);
export const getComplianceFrameworksTool = tool(
async ({ provider }) => {
return await getLighthouseComplianceFrameworks(provider);
async ({ providerType }) => {
return await getLighthouseComplianceFrameworks(providerType);
},
{
name: "getComplianceFrameworks",
+1 -1
View File
@@ -1,5 +1,5 @@
import { z } from "zod";
export const checkSchema = z.object({
provider_type: z.enum(["aws", "gcp", "azure", "kubernetes", "m365"]),
providerType: z.enum(["aws", "gcp", "azure", "kubernetes", "m365"]),
});
+3 -3
View File
@@ -81,15 +81,15 @@ export const getCompliancesOverviewSchema = z.object({
"The filters to get the compliances overview for. If not provided, all regions will be returned by default.",
),
page: z.number().optional().describe("Page number. Default is 1."),
page_size: z.number().optional().describe("Page size. Default is 10."),
pageSize: z.number().optional().describe("Page size. Default is 10."),
sort: getCompliancesOverviewSort
.optional()
.describe("Sort by field. Default is inserted_at."),
});
export const getComplianceFrameworksSchema = z.object({
provider: z
.enum(["aws", "azure", "gcp", "kubernetes"])
providerType: z
.enum(["aws", "azure", "gcp", "kubernetes", "m365"])
.describe("The provider type to get the compliance frameworks for."),
});
-18
View File
@@ -2,24 +2,6 @@ import { z } from "zod";
// Get Findings Schema
// const findingFieldsEnum = z.enum([
// "",
// "uid",
// "delta",
// "status",
// "status_extended",
// "severity",
// "check_id",
// "check_metadata",
// "raw_result",
// "inserted_at",
// "updated_at",
// "first_seen_at",
// "url",
// "scan",
// "resources",
// ]);
const deltaEnum = z.enum(["", "new", "changed"]);
const impactEnum = z.enum([
-18
View File
@@ -18,24 +18,6 @@ export const getProvidersOverviewSchema = z.object({
// Get Findings By Status
// const findingsOverviewFieldsEnum = z.enum([
// "",
// "id",
// "new",
// "changed",
// "unchanged",
// "fail_new",
// "fail_changed",
// "pass_new",
// "pass_changed",
// "muted_new",
// "muted_changed",
// "total",
// "fail",
// "muted",
// "pass",
// ]);
const providerTypeEnum = z.enum(["", "aws", "azure", "gcp", "kubernetes"]);
const sortFieldsEnum = z.enum([
-13
View File
@@ -2,19 +2,6 @@ import { z } from "zod";
// Get Providers Schema
// const providerFieldsEnum = z.enum([
// "",
// "inserted_at",
// "updated_at",
// "provider",
// "uid",
// "alias",
// "connection",
// "secret",
// "provider_groups",
// "url",
// ]);
const providerEnum = z.enum(["", "aws", "azure", "gcp", "kubernetes"]);
const sortFieldsEnum = z.enum([