Remove console.log statements

This commit is contained in:
Chandrapal Badshah committed 2025-05-14 14:42:50 +05:30
1 parent aaf00a0f23
commit 8ab5d0127c
11 files changed
+2 -71

No files matched your search

-3
View File
@@ -31,7 +31,6 @@ export const getAIKey = async (): Promise<string> => {
const configId = await getAIConfigurationId();
if (!configId) {
console.log("AI configuration ID not found");
return "";
}
@@ -83,7 +82,6 @@ export const getAIConfiguration = async () => {
const configId = await getAIConfigurationId();
if (!configId) {
console.log("AI configuration ID not found");
return undefined;
}
@@ -110,7 +108,6 @@ export const updateAIConfiguration = async (config: {
const configId = await getAIConfigurationId();
if (!configId) {
console.log("AI configuration ID not found");
return undefined;
}
-1
View File
@@ -5,7 +5,6 @@ import { checkSchema } from "@/types/ai/checks";
export const getProviderChecksTool = tool(
async ({ provider_type }) => {
console.log("=> Invoking getProviderChecksTool - ", provider_type);
const checks = await aiGetProviderChecks(provider_type);
return checks;
},
@@ -13,14 +13,6 @@ import {
export const getCompliancesOverviewTool = tool(
async ({ scanId, fields, filters, page, page_size, sort }) => {
console.log("=> Invoking getCompliancesOverviewTool - ", {
scanId,
fields,
filters,
page,
page_size,
sort,
});
return await aiGetCompliancesOverview({
scanId,
fields,
@@ -40,7 +32,6 @@ export const getCompliancesOverviewTool = tool(
export const getComplianceFrameworksTool = tool(
async ({ provider }) => {
console.log("=> Invoking getComplianceFrameworksTool - ", { provider });
return await aiGetComplianceFrameworks(provider);
},
{
@@ -53,10 +44,6 @@ export const getComplianceFrameworksTool = tool(
export const getComplianceOverviewTool = tool(
async ({ complianceId, fields }) => {
console.log("=> Invoking getComplianceOverviewTool - ", {
complianceId,
fields,
});
return await aiGetComplianceOverview({ complianceId, fields });
},
{
-8
View File
@@ -5,13 +5,6 @@ import { getFindingsSchema, getMetadataInfoSchema } from "@/types/ai/findings";
export const getFindingsTool = tool(
async ({ page, pageSize, query, sort, filters }) => {
console.log("=> Invoking getFindingsTool - ", {
page,
pageSize,
query,
sort,
filters,
});
return await getFindings({ page, pageSize, query, sort, filters });
},
{
@@ -24,7 +17,6 @@ export const getFindingsTool = tool(
export const getMetadataInfoTool = tool(
async ({ query, sort, filters }) => {
console.log("=> Invoking getMetadataInfoTool - ", { query, sort, filters });
return await getMetadataInfo({ query, sort, filters });
},
{
-19
View File
@@ -13,12 +13,6 @@ import {
export const getProvidersOverviewTool = tool(
async ({ page, query, sort, filters }) => {
console.log("=> Invoking getProvidersOverviewTool - ", {
page,
query,
sort,
filters,
});
return await getProvidersOverview({ page, query, sort, filters });
},
{
@@ -31,12 +25,6 @@ export const getProvidersOverviewTool = tool(
export const getFindingsByStatusTool = tool(
async ({ page, query, sort, filters }) => {
console.log("=> Invoking getFindingsByStatusTool - ", {
page,
query,
sort,
filters,
});
return await getFindingsByStatus({ page, query, sort, filters });
},
{
@@ -49,13 +37,6 @@ export const getFindingsByStatusTool = tool(
export const getFindingsBySeverityTool = tool(
async ({ page, query, sort, filters }) => {
console.log("=> Invoking getFindingsBySeverityTool - ", {
page,
query,
sort,
filters,
});
// console.log("getFindingsBySeverityTool", { page, query, sort, filters });
return await getFindingsBySeverity({ page, query, sort, filters });
},
{
-7
View File
@@ -5,12 +5,6 @@ import { getProviderSchema, getProvidersSchema } from "@/types/ai/providers";
export const getProvidersTool = tool(
async ({ page, query, sort, filters }) => {
console.log("=> Invoking getProvidersTool - ", {
page,
query,
sort,
filters,
});
return await getProviders({
page: page,
query: query,
@@ -28,7 +22,6 @@ export const getProvidersTool = tool(
export const getProviderTool = tool(
async ({ id }) => {
console.log("=> Invoking getProviderTool - ", { id });
const formData = new FormData();
formData.append("id", id);
return await getProvider(formData);
-8
View File
@@ -5,13 +5,6 @@ import { getResourceSchema, getResourcesSchema } from "@/types/ai/resources";
export const getResourcesTool = tool(
async ({ page, query, sort, filters, fields }) => {
console.log("=> Invoking getResourcesTool - ", {
page,
query,
sort,
filters,
fields,
});
return await aiGetResources(page, query, sort, filters, fields);
},
{
@@ -23,7 +16,6 @@ export const getResourcesTool = tool(
export const getResourceTool = tool(
async ({ id, fields, include }) => {
console.log("=> Invoking getResourceTool - ", { id, fields, include });
return await aiGetResource(id, fields, include);
},
{
-2
View File
@@ -5,7 +5,6 @@ import { getRoleSchema, getRolesSchema } from "@/types/ai/roles";
export const getRolesTool = tool(
async ({ page, query, sort, filters }) => {
console.log("=> Invoking getRolesTool - ", { page, query, sort, filters });
return await getRoles({ page, query, sort, filters });
},
{
@@ -17,7 +16,6 @@ export const getRolesTool = tool(
export const getRoleTool = tool(
async ({ id }) => {
console.log("=> Invoking getRoleTool - ", { id });
return await getRoleInfoById(id);
},
{
-2
View File
@@ -5,7 +5,6 @@ import { getScanSchema, getScansSchema } from "@/types/ai/scans";
export const getScansTool = tool(
async ({ page, query, sort, filters }) => {
console.log("=> Invoking getScansTool - ", { page, query, sort, filters });
const scans = await getScans({ page, query, sort, filters });
return scans;
@@ -20,7 +19,6 @@ export const getScansTool = tool(
export const getScanTool = tool(
async ({ id }) => {
console.log("=> Invoking getScanTool - ", { id });
return await getScan(id);
},
{
-2
View File
@@ -6,7 +6,6 @@ import { getUsersSchema } from "@/types/ai/users";
export const getUsersTool = tool(
async ({ page, query, sort, filters }) => {
console.log("=> Invoking getUsersTool - ", { page, query, sort, filters });
return await getUsers({ page, query, sort, filters });
},
{
@@ -19,7 +18,6 @@ export const getUsersTool = tool(
export const getMyProfileInfoTool = tool(
async () => {
console.log("=> Invoking getMyProfileInfoTool()");
return await getProfileInfo();
},
{
+2 -6
View File
@@ -41,8 +41,7 @@ interface CachedData {
}
// Function to fetch all required data from APIs
const fetchDataFromAPIs = async (userId: string): Promise<CachedData> => {
console.log(`[Cache MISS] Fetching data from APIs for user: ${userId}`);
const fetchDataFromAPIs = async (): Promise<CachedData> => {
cacheMisses++;
// Step 1: Get user profile data
@@ -128,7 +127,7 @@ export const getCurrentUserId = async (): Promise<string> => {
// Create or update cache for a user - this will hit APIs
export const createCache = async (userId: string): Promise<CachedData> => {
const data = await fetchDataFromAPIs(userId);
const data = await fetchDataFromAPIs();
// Store in cache
cacheStore[userId] = {
@@ -136,7 +135,6 @@ export const createCache = async (userId: string): Promise<CachedData> => {
timestamp: Date.now(),
};
console.log(`Cache created/updated for user: ${userId}`);
return data;
};
@@ -147,7 +145,6 @@ export const getUserCache = async (): Promise<CachedData> => {
// Check if we have cached data for this user
if (userId in cacheStore) {
cacheHits++;
console.log(`[Cache HIT] Using cached data for user: ${userId}`);
return cacheStore[userId].data;
}
@@ -187,7 +184,6 @@ export const invalidateCache = async () => {
delete cacheStore[userId];
cacheVersion = Date.now();
cacheCreatedAt = new Date().toISOString();
console.log(`Cache invalidated for user: ${userId}`);
}
return {