import type { CliContext } from '../../context/create-context.js'; import { SharedDockerService } from '../docker-service.js'; import type { ReportSyncResult } from '@stamhoofd/metabase/sync-report'; export declare class MetabaseService extends SharedDockerService { static readonly container = "stamhoofd-metabase"; readonly key = "metabase"; readonly name = "Metabase"; getContainer(): string; getDetail(context: CliContext): string; getLogin(): string; /** * The application database lives on the shared MySQL container, so that has to be up first. * Metabase creates its own schema on boot, but not the database itself. */ beforeRun(context: CliContext): Promise; /** * Register the platform statistics database of the selected environment as a data source, so a * fresh Metabase is immediately usable and switching environments needs no clicking. Creates * the MySQL database as well: Metabase refuses a connection to a database that does not exist. * * Runs on every start rather than only on a fresh container, so `--env keeo` after `--env ravot` * adds the second data source to the same Metabase. */ provision(context: CliContext): Promise<{ database: string; dataSource: string; created: boolean; removedSampleDatabase: boolean; hiddenTables: string[]; tableCount: number; }>; /** * Recreate the ledenstatistieken dashboards on top of the statistics data source. * * The report is written into one collection whichever environment it counts, so this points that * collection at the data source of the selected environment: a local Metabase holds the data of * several platforms and shows the report of the one that was written last. * * The definition is read for that environment too. Not every platform counts every figure the * same way, and which variant a card carries is decided while the report is loaded. The writer * is told the same environment: it says which colors a chart falls back to. */ provisionReport(context: CliContext): Promise; /** * Sign in and make sure the statistics database of the selected environment is registered. Also * creates the MySQL database: Metabase refuses a connection to a database that does not exist. */ private connectDataSource; afterRun(context: CliContext): Promise; getDockerArgs(context: CliContext): string[]; startedMessage(context: CliContext): string; /** * Metabase accepts TCP connections long before it finished migrating its application database, * and answers 503 on /api/health until it is done. Polls the published port directly rather * than the Caddy hostname, so this also works when only the container was started. */ waitUntilReady(context: CliContext, options?: { timeoutMs?: number; }): Promise; private assertMysqlRunning; /** * The statistics schema is created by the backend migrations, not by this command, so a database * without tables means those have not run yet. */ private countTables; /** How many rows a table holds, used to tell whether the maps have coordinates to plot. */ private countRows; private createMysqlDatabase; /** * `mysqlPort` is the host port the shared MySQL container publishes: Metabase reaches it over * the Docker host gateway. Linux Docker has no built-in host.docker.internal, so it is mapped * explicitly (Docker Desktop and Podman accept the same flag and keep working). */ static dockerArgs(port: number, mysqlPort: number, siteUrl: string): string[]; } export declare const metabaseService: MetabaseService; //# sourceMappingURL=metabase-service.d.ts.map