CI / changes (push) Successful in 10s
CI / commitlint (push) Has been skipped
CI / openapi (push) Successful in 27s
CI / web (push) Successful in 38s
CI / go (push) Successful in 2m36s
CI / bird2 (push) Successful in 15s
CI / release (push) Failing after 3m7s
Refactored the project structure to support a monorepo setup, moving the web application to `apps/web/` and updating related configurations. Adjusted pre-commit hooks to use `pnpm` for linting and formatting. Updated CI workflows to reflect the new directory structure and dependencies. Removed legacy files and configurations from the previous `web/` directory, streamlining the project for better maintainability and clarity.
38 lines
985 B
TypeScript
38 lines
985 B
TypeScript
import { apiJSON, apiMutate } from '$lib/api/client.js';
|
|
|
|
export type RuntimeLogAutoEstimateItem = {
|
|
filename: string;
|
|
size_bytes: number;
|
|
would_cleanup: boolean;
|
|
skip_reason?: string;
|
|
};
|
|
|
|
export type RuntimeLogAutoEstimate = {
|
|
policy?: {
|
|
enabled?: boolean;
|
|
max_file_bytes?: number;
|
|
schedule?: string;
|
|
mode?: 'truncate' | 'delete';
|
|
};
|
|
items?: RuntimeLogAutoEstimateItem[];
|
|
would_count?: number;
|
|
};
|
|
|
|
export type RuntimeLogAutoRunResult = {
|
|
dry_run?: boolean;
|
|
trigger?: string;
|
|
cleaned_count?: number;
|
|
skipped_count?: number;
|
|
cleaned?: unknown[];
|
|
skipped?: unknown[];
|
|
};
|
|
|
|
export async function fetchRuntimeLogAutoEstimate(): Promise<RuntimeLogAutoEstimate> {
|
|
return apiJSON<RuntimeLogAutoEstimate>('/v1/runtime-logs/auto-estimate');
|
|
}
|
|
|
|
export async function runRuntimeLogAutoCleanup(dryRun = false): Promise<RuntimeLogAutoRunResult> {
|
|
const q = dryRun ? '?dry_run=true' : '';
|
|
return apiMutate<RuntimeLogAutoRunResult>(`/v1/runtime-logs/auto-run${q}`, 'POST');
|
|
}
|