Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"@radix-ui/react-slot": "^1.2.3",
"@radix-ui/react-switch": "^1.2.5",
"@radix-ui/react-tooltip": "1.2.7",
"@scalar/api-reference-react": "0.7.25",
"@sentry/nextjs": "9.34.0",
"@shazow/whatsabi": "0.22.2",
"@tanstack/react-query": "5.81.5",
Expand Down Expand Up @@ -47,7 +46,6 @@
"papaparse": "^5.5.3",
"pluralize": "^8.0.0",
"posthog-js": "1.256.1",
"posthog-node": "^5.4.0",
"prettier": "3.6.2",
"react": "19.1.0",
"react-children-utilities": "^2.10.0",
Expand Down
57 changes: 0 additions & 57 deletions apps/dashboard/src/@/analytics/posthog-server.ts

This file was deleted.

56 changes: 2 additions & 54 deletions apps/dashboard/src/@/api/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import type {
UserOpStats,
WalletStats,
WebhookLatencyStats,
WebhookRequestStats,
WebhookSummaryStats,
} from "@/types/analytics";
import { getChains } from "./chain";
Expand Down Expand Up @@ -660,7 +659,7 @@ export function getEngineCloudMethodUsage(
return cached_getEngineCloudMethodUsage(normalizedParams(params), authToken);
}

const cached_getWebhookSummary = unstable_cache(
const _cached_getWebhookSummary = unstable_cache(
async (
params: AnalyticsQueryParams & { webhookId: string },
authToken: string,
Expand Down Expand Up @@ -688,51 +687,7 @@ const cached_getWebhookSummary = unstable_cache(
},
);

export function getWebhookSummary(
params: AnalyticsQueryParams & { webhookId: string },
authToken: string,
) {
return cached_getWebhookSummary(normalizedParams(params), authToken);
}

const cached_getWebhookRequests = unstable_cache(
async (
params: AnalyticsQueryParams & { webhookId?: string },
authToken: string,
): Promise<{ data: WebhookRequestStats[] } | { error: string }> => {
const searchParams = buildSearchParams(params);
if (params.webhookId) {
searchParams.append("webhookId", params.webhookId);
}

const res = await fetchAnalytics({
authToken,
url: `v2/webhook/requests?${searchParams.toString()}`,
init: {
method: "GET",
},
});
if (!res.ok) {
const reason = await res.text();
return { error: reason };
}

return (await res.json()) as { data: WebhookRequestStats[] };
},
["getWebhookRequests"],
{
revalidate: 60 * 60, // 1 hour
},
);

export function getWebhookRequests(
params: AnalyticsQueryParams & { webhookId?: string },
authToken: string,
) {
return cached_getWebhookRequests(normalizedParams(params), authToken);
}

const cached_getWebhookLatency = unstable_cache(
const _cached_getWebhookLatency = unstable_cache(
async (
params: AnalyticsQueryParams & { webhookId?: string },
authToken: string,
Expand Down Expand Up @@ -762,13 +717,6 @@ const cached_getWebhookLatency = unstable_cache(
},
);

export function getWebhookLatency(
params: AnalyticsQueryParams & { webhookId?: string },
authToken: string,
) {
return cached_getWebhookLatency(normalizedParams(params), authToken);
}

const cached_getInsightChainUsage = unstable_cache(
async (
params: AnalyticsQueryParams,
Expand Down
Loading
Loading