"use client"
import "./const-CaIm1Z8g.mjs";
import { C as markRelaunchHintCompleted, S as markOnboardingCompleted, _ as getLineageDiff, a as saveAs, b as getServerInfo, c as aggregateRuns, ct as reactQueryClient, d as listRuns, f as searchRuns, g as getLineage, h as waitRun, i as rename, l as cancelRun, m as submitRunFromCheck, n as importState, o as shareState, p as submitRun, r as isStateSyncing, s as syncState, st as axiosClient, t as exportState, u as getRun, v as getLineageWithError, x as getServerFlag, y as getModelInfo } from "./state-Sc2b4jri.mjs";
import { C as getCll, S as createLineageDiffCheck, _ as submitQueryBase, a as createCheckByRun, b as select, c as getCheck, d as reorderChecks, f as updateCheck, g as submitQuery, h as localStorageKeys, i as fetchUser, l as listChecks, m as connectToCloud, n as useVersionNumber, o as createSimpleCheck, p as useChecks, r as fetchGitHubAvatar, s as deleteCheck, t as getVersion, u as markAsPresetCheck, v as submitQueryDiff, x as createSchemaDiffCheck, y as sessionStorageKeys } from "./version-DP1kU_7v.mjs";

//#region recce-source/js/src/lib/api/rowcount.ts
async function submitRowCountDiff(params, options, client = axiosClient) {
	return await submitRun("row_count_diff", params, options, client);
}

//#endregion
//#region recce-source/js/src/lib/api/models.ts
async function fetchModelRowCount(modelName, client = axiosClient) {
	return (await client.get(`/api/models/${modelName}/row_count`)).data;
}
async function queryModelRowCount(modelName, client = axiosClient) {
	const { result } = await queryRowCount([modelName], client);
	return result[modelName];
}
async function queryRowCount(modelNames, client = axiosClient) {
	if (modelNames.length === 0) throw new Error("No model names provided");
	const { run_id } = await submitRowCountDiff({ node_names: modelNames }, { nowait: true }, client);
	return {
		runId: run_id,
		result: (await waitRun(run_id, void 0, client)).result
	};
}

//#endregion
//#region recce-source/js/src/lib/api/profile.ts
async function submitProfileDiff(params, options, client = axiosClient) {
	return await submitRun("profile_diff", params, options, client);
}

//#endregion
//#region recce-source/js/src/lib/api/valuediff.ts
async function submitValueDiff(params, options, client = axiosClient) {
	return await submitRun("value_diff", params, options, client);
}
async function submitValueDiffDetail(params, options, client = axiosClient) {
	return await submitRun("value_diff_detail", params, options, client);
}

//#endregion
export { aggregateRuns, axiosClient, cancelRun, connectToCloud, createCheckByRun, createLineageDiffCheck, createSchemaDiffCheck, createSimpleCheck, deleteCheck, exportState, fetchGitHubAvatar, fetchModelRowCount, fetchUser, getCheck, getCll, getLineage, getLineageDiff, getLineageWithError, getModelInfo, getRun, getServerFlag, getServerInfo, getVersion, importState, isStateSyncing, listChecks, listRuns, localStorageKeys, markAsPresetCheck, markOnboardingCompleted, markRelaunchHintCompleted, queryModelRowCount, queryRowCount, reactQueryClient, rename, reorderChecks, saveAs, searchRuns, select, sessionStorageKeys, shareState, submitProfileDiff, submitQuery, submitQueryBase, submitQueryDiff, submitRowCountDiff, submitRun, submitRunFromCheck, submitValueDiff, submitValueDiffDetail, syncState, updateCheck, useChecks, useVersionNumber, waitRun };
//# sourceMappingURL=api.mjs.map