export var ValidationErrorType;
(function (ValidationErrorType) {
    ValidationErrorType["Chart"] = "chart";
    ValidationErrorType["Sorting"] = "sorting";
    ValidationErrorType["Filter"] = "filter";
    ValidationErrorType["Metric"] = "metric";
    ValidationErrorType["Model"] = "model";
    ValidationErrorType["Dimension"] = "dimension";
    ValidationErrorType["CustomMetric"] = "custom metric";
    ValidationErrorType["ChartConfiguration"] = "chart configuration";
})(ValidationErrorType || (ValidationErrorType = {}));
export var DashboardFilterValidationErrorType;
(function (DashboardFilterValidationErrorType) {
    DashboardFilterValidationErrorType["FieldDoesNotExist"] = "field_does_not_exist";
    DashboardFilterValidationErrorType["FieldTableMismatch"] = "field_table_mismatch";
    DashboardFilterValidationErrorType["TableNotUsedByAnyChart"] = "table_not_used_by_any_chart";
    DashboardFilterValidationErrorType["TableDoesNotExist"] = "table_does_not_exist";
})(DashboardFilterValidationErrorType || (DashboardFilterValidationErrorType = {}));
export var ValidationSourceType;
(function (ValidationSourceType) {
    ValidationSourceType["Chart"] = "chart";
    ValidationSourceType["Dashboard"] = "dashboard";
    ValidationSourceType["Table"] = "table";
})(ValidationSourceType || (ValidationSourceType = {}));
export const isTableValidationError = (error) => error.source === ValidationSourceType.Table;
export const isChartValidationError = (error) => error.source === ValidationSourceType.Chart;
export const isDashboardValidationError = (error) => error.source === ValidationSourceType.Dashboard;
/**
 * Checks if a dashboard validation error is fixable via rename.
 * Fixable: FieldDoesNotExist (field renamed), TableDoesNotExist (model renamed),
 * FieldTableMismatch (field doesn't match table after model rename).
 */
export const isFixableDashboardValidationError = (error) => isDashboardValidationError(error) &&
    !!error.dashboardUuid &&
    !!error.dashboardFilterErrorType &&
    (error.dashboardFilterErrorType ===
        DashboardFilterValidationErrorType.FieldDoesNotExist ||
        error.dashboardFilterErrorType ===
            DashboardFilterValidationErrorType.TableDoesNotExist ||
        error.dashboardFilterErrorType ===
            DashboardFilterValidationErrorType.FieldTableMismatch);
export var ValidationTarget;
(function (ValidationTarget) {
    ValidationTarget["CHARTS"] = "charts";
    ValidationTarget["DASHBOARDS"] = "dashboards";
    ValidationTarget["TABLES"] = "tables";
})(ValidationTarget || (ValidationTarget = {}));
export function isValidationTargetValid(validationTarget) {
    return Object.values(ValidationTarget).includes(validationTarget);
}
//# sourceMappingURL=validation.js.map