"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MODEL_WITH_METRIC_AI_HINT = exports.MODEL_WITH_DIMENSION_AI_HINT = exports.LIGHTDASH_TABLE_WITH_AI_HINT_FROM_CONFIG = exports.LIGHTDASH_TABLE_WITH_AI_HINT = exports.LIGHTDASH_TABLE_WITH_METRIC_LEVEL_CATEGORIES = exports.MODEL_WITH_METRIC_LEVEL_CATEGORIES = exports.LIGHTDASH_TABLE_WITH_MODEL_LEVEL_CATEGORIES = exports.MODEL_WITH_MODEL_LEVEL_CATEGORIES = exports.LIGHTDASH_TABLE_WITH_NO_CATEGORIES = exports.MODEL_WITH_NO_CATEGORIES = exports.SPOTLIGHT_CONFIG_WITH_CATEGORIES_AND_HIDE = exports.LIGHTDASH_TABLE_WITH_ADDITIONAL_DIMENSIONS = exports.MODEL_WITH_ADDITIONAL_DIMENSIONS = exports.LIGHTDASH_TABLE_SQL_WHERE = exports.expectedModelWithType = exports.warehouseSchemaWithUpperCaseColumn = exports.warehouseSchemaWithMissingColumn = exports.warehouseSchemaWithMissingTable = exports.warehouseSchema = exports.LIGHTDASH_TABLE_WITH_CUSTOM_TIME_INTERVAL_DIMENSIONS = exports.MODEL_WITH_CUSTOM_TIME_INTERVAL_DIMENSIONS = exports.LIGHTDASH_TABLE_WITH_OFF_TIME_INTERVAL_DIMENSIONS = exports.MODEL_WITH_OFF_BOOLEAN_TIME_INTERVAL_DIMENSIONS = exports.MODEL_WITH_OFF_TIME_INTERVAL_DIMENSIONS = exports.LIGHTDASH_TABLE_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS_SNOWFLAKE = exports.LIGHTDASH_TABLE_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS_BIGQUERY = exports.MODEL_WITH_NO_TIME_INTERVAL_DIMENSIONS = exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS = exports.LIGHTDASH_TABLE_WITH_METRICS = exports.MODEL_WITH_WRONG_METRICS = exports.MODEL_WITH_WRONG_METRIC = exports.MODEL_WITH_METRIC = exports.LIGHTDASH_TABLE_WITHOUT_AUTO_METRICS = exports.MODEL_WITH_NO_METRICS = exports.MODEL_WITH_AI_HINT_IN_CONFIG = exports.MODEL_WITH_AI_HINT = exports.MODEL_WITH_SQL_FILTER = exports.MODEL_WITH_SQL_WHERE = exports.LIGHTDASH_TABLE_WITH_GROUP_BLOCK = exports.LIGHTDASH_TABLE_WITH_GROUP_LABEL = exports.MODEL_WITH_GROUPS_BLOCK = exports.MODEL_WITH_GROUP_LABEL = exports.LIGHTDASH_TABLE_WITH_COMPOSITE_PRIMARY_KEY = exports.LIGHTDASH_TABLE_WITH_SINGLE_PRIMARY_KEY = exports.MODEL_WITH_COMPOSITE_PRIMARY_KEY = exports.MODEL_WITH_SINGLE_PRIMARY_KEY = exports.BASE_LIGHTDASH_TABLE = exports.model = exports.INVALID_ID_COLUMN_NAMES = exports.VALID_ID_COLUMN_NAMES = void 0;
exports.MODEL_WITH_DUPLICATE_METRIC_DIMENSION_NAME = exports.MODEL_WITH_CUSTOM_GRANULARITY_AND_REQUIRED_ATTRIBUTES = exports.MODEL_WITH_CUSTOM_GRANULARITY = exports.MODEL_WITH_METRIC_DRIVERS = exports.LIGHTDASH_TABLE_WITH_DEFAULT_SHOW_UNDERLYING_VALUES = exports.MODEL_WITH_DEFAULT_SHOW_UNDERLYING_VALUES = exports.LIGHTDASH_TABLE_WITH_METRIC_AI_HINT_ARRAY = exports.LIGHTDASH_TABLE_WITH_DIMENSION_AI_HINT_ARRAY = exports.LIGHTDASH_TABLE_WITH_AI_HINT_ARRAY = exports.LIGHTDASH_TABLE_WITH_MODEL_METRIC_AI_HINT = exports.MODEL_WITH_METRIC_AI_HINT_ARRAY = exports.MODEL_WITH_DIMENSION_AI_HINT_ARRAY = exports.MODEL_WITH_AI_HINT_ARRAY = exports.MODEL_WITH_MODEL_METRIC_AI_HINT = exports.LIGHTDASH_TABLE_WITH_METRIC_AI_HINT = exports.LIGHTDASH_TABLE_WITH_DIMENSION_AI_HINT = void 0;
const field_1 = require("../types/field");
const table_1 = require("../types/table");
const timeFrames_1 = require("../types/timeFrames");
exports.VALID_ID_COLUMN_NAMES = [
    { input: 'userid', output: 'user' },
    { input: 'user_id', output: 'user' },
    { input: 'user__id', output: 'user' },
    { input: 'UNiqUE_*093USER___ID', output: 'unique_user' },
    { input: 'gid', output: 'g' },
    { input: 'userId', output: 'user' },
    { input: 'USERID', output: 'user' },
    { input: '$$__nth.rc*#)id', output: 'nth_rc' },
    { input: '0932_user_id', output: 'user' },
    { input: 'valid_id', output: 'valid' },
];
exports.INVALID_ID_COLUMN_NAMES = [
    'isValid',
    'invalid',
    '',
    'id',
    'i',
    'my_fave_column',
    '12345_id',
];
const ID_COLUMN_WITHOUT_METRICS = {
    name: 'user_id',
    meta: {},
    data_type: field_1.DimensionType.STRING,
};
const column = {
    name: 'myColumnName',
    meta: {},
};
const COLUMN_WITH_METRICS = {
    user_id: {
        name: 'user_id',
        data_type: field_1.DimensionType.STRING,
        meta: {
            metrics: {
                user_count: { type: field_1.MetricType.COUNT_DISTINCT },
            },
        },
    },
    num_participating_athletes: {
        name: 'num_participating_athletes',
        data_type: field_1.DimensionType.NUMBER,
        meta: {
            dimension: {
                sql: 'num_participating_men + num_participating_women',
            },
            metrics: {
                total_num_participating_athletes: { type: field_1.MetricType.SUM },
            },
        },
    },
};
const COLUMN_WITH_DEFAULT_TIME_INTERVALS = {
    user_created: {
        name: 'user_created',
        data_type: field_1.DimensionType.TIMESTAMP,
        meta: {
            dimension: {
                time_intervals: 'default',
            },
        },
    },
};
const COLUMN_WITH_NO_TIME_INTERVALS = {
    user_created: {
        name: 'user_created',
        data_type: field_1.DimensionType.TIMESTAMP,
        meta: {
            dimension: {
                time_intervals: undefined,
            },
        },
    },
};
const COLUMN_WITH_OFF_BOOLEAN_TIME_INTERVALS = {
    user_created: {
        name: 'user_created',
        data_type: field_1.DimensionType.TIMESTAMP,
        meta: {
            dimension: {
                time_intervals: false,
            },
        },
    },
};
const COLUMN_WITH_OFF_TIME_INTERVALS = {
    user_created: {
        name: 'user_created',
        data_type: field_1.DimensionType.TIMESTAMP,
        meta: {
            dimension: {
                time_intervals: 'OFF',
            },
        },
    },
};
const COLUMN_WITH_CUSTOM_TIME_INTERVALS = {
    user_created: {
        name: 'user_created',
        data_type: field_1.DimensionType.DATE,
        meta: {
            dimension: {
                time_intervals: [timeFrames_1.TimeFrames.YEAR],
            },
        },
    },
};
exports.model = {
    alias: 'myTable',
    checksum: { name: '', checksum: '' },
    fqn: [],
    language: '',
    package_name: '',
    path: '',
    raw_code: '',
    compiled: true,
    unique_id: 'unique_id',
    description: 'my fun table',
    resource_type: 'model',
    columns: {
        myColumnName: column,
    },
    meta: {},
    database: 'myDatabase',
    schema: 'mySchema',
    name: 'myTable',
    tags: [],
    relation_name: 'relation_name',
    depends_on: { nodes: [] },
    patch_path: null,
    original_file_path: '',
};
exports.BASE_LIGHTDASH_TABLE = {
    name: exports.model.name,
    label: 'My table',
    database: exports.model.database,
    schema: exports.model.schema,
    sqlTable: exports.model.relation_name,
    description: exports.model.description,
    sqlWhere: undefined,
    requiredAttributes: undefined,
    anyAttributes: undefined,
    primaryKey: undefined,
    dimensions: {
        myColumnName: {
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            format: undefined,
            groups: [],
            colors: undefined,
            hidden: false,
            index: 0,
            label: 'My column name',
            name: 'myColumnName',
            round: undefined,
            source: undefined,
            sql: '${TABLE}.myColumnName',
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            type: field_1.DimensionType.STRING,
            isIntervalBase: false,
        },
    },
    metrics: {},
    orderFieldsBy: table_1.OrderFieldsByStrategy.LABEL,
    requiredFilters: [],
    groupLabel: undefined,
    groupDetails: {},
};
exports.MODEL_WITH_SINGLE_PRIMARY_KEY = {
    ...exports.model,
    meta: {
        primary_key: 'user_id',
    },
    columns: {
        user_id: {
            name: 'user_id',
            data_type: field_1.DimensionType.STRING,
            meta: {},
        },
    },
};
exports.MODEL_WITH_COMPOSITE_PRIMARY_KEY = {
    ...exports.model,
    meta: {
        primary_key: ['user_id', 'order_id'],
    },
    columns: {
        user_id: {
            name: 'user_id',
            data_type: field_1.DimensionType.STRING,
            meta: {},
        },
        order_id: {
            name: 'order_id',
            data_type: field_1.DimensionType.STRING,
            meta: {},
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_SINGLE_PRIMARY_KEY = {
    ...exports.BASE_LIGHTDASH_TABLE,
    primaryKey: ['user_id'],
    dimensions: {
        user_id: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_COMPOSITE_PRIMARY_KEY = {
    ...exports.BASE_LIGHTDASH_TABLE,
    primaryKey: ['user_id', 'order_id'],
    dimensions: {
        user_id: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        order_id: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.STRING,
            sql: '${TABLE}.order_id',
            name: 'order_id',
            label: 'Order id',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 1,
            isIntervalBase: false,
        },
    },
};
exports.MODEL_WITH_GROUP_LABEL = {
    ...exports.model,
    meta: {
        group_label: 'revenue',
    },
};
exports.MODEL_WITH_GROUPS_BLOCK = {
    ...exports.model,
    meta: {
        group_details: {
            revenue: {
                label: 'Revenue',
                description: 'Revenue description',
            },
        },
    },
    columns: {
        user_id: {
            name: 'user_id',
            data_type: field_1.DimensionType.STRING,
            meta: {
                metrics: {
                    user_id_count: {
                        type: field_1.MetricType.COUNT_DISTINCT,
                        groups: ['revenue'],
                    },
                },
            },
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_GROUP_LABEL = {
    ...exports.BASE_LIGHTDASH_TABLE,
    groupLabel: 'revenue',
};
exports.LIGHTDASH_TABLE_WITH_GROUP_BLOCK = {
    ...exports.BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_id: {
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            format: undefined,
            groups: [],
            colors: undefined,
            hidden: false,
            index: 0,
            label: 'User id',
            name: 'user_id',
            round: undefined,
            source: undefined,
            sql: '${TABLE}.user_id',
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            type: field_1.DimensionType.STRING,
            isIntervalBase: false,
        },
    },
    metrics: {
        user_id_count: {
            compact: undefined,
            separator: undefined,
            description: 'Count distinct of User id',
            dimensionReference: 'myTable_user_id',
            fieldType: field_1.FieldType.METRIC,
            filters: [],
            format: undefined,
            groups: ['revenue'],
            hidden: false,
            index: 0,
            label: 'User id count',
            name: 'user_id_count',
            percentile: undefined,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            showUnderlyingValues: undefined,
            source: undefined,
            sql: '${TABLE}.user_id',
            table: 'myTable',
            tableLabel: 'My table',
            type: field_1.MetricType.COUNT_DISTINCT,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
        },
    },
    groupDetails: {
        revenue: {
            label: 'Revenue',
            description: 'Revenue description',
        },
    },
};
exports.MODEL_WITH_SQL_WHERE = {
    ...exports.model,
    meta: {
        sql_where: '${payment_method} IS NOT NULL',
    },
};
exports.MODEL_WITH_SQL_FILTER = {
    ...exports.model,
    meta: {
        sql_filter: '${payment_method} IS NOT NULL',
    },
};
exports.MODEL_WITH_AI_HINT = {
    ...exports.model,
    meta: {
        ai_hint: 'This is a customers table.',
    },
};
exports.MODEL_WITH_AI_HINT_IN_CONFIG = {
    ...exports.model,
    config: {
        meta: {
            ai_hint: 'This is a customers table from config.',
        },
    },
    meta: {},
};
exports.MODEL_WITH_NO_METRICS = {
    ...exports.model,
    columns: {
        [ID_COLUMN_WITHOUT_METRICS.name]: ID_COLUMN_WITHOUT_METRICS,
    },
};
exports.LIGHTDASH_TABLE_WITHOUT_AUTO_METRICS = {
    ...exports.BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_id: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: exports.MODEL_WITH_NO_METRICS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
};
exports.MODEL_WITH_METRIC = {
    ...exports.model,
    description: 'my test table',
    columns: COLUMN_WITH_METRICS,
};
exports.MODEL_WITH_WRONG_METRIC = {
    ...exports.model,
    columns: {
        user_id: {
            name: 'user_id',
            data_type: field_1.DimensionType.STRING,
            meta: {
                metrics: {
                    user_id: { type: field_1.MetricType.COUNT_DISTINCT },
                },
            },
        },
    },
};
exports.MODEL_WITH_WRONG_METRICS = {
    ...exports.model,
    columns: {
        user_id: {
            name: 'user_id',
            data_type: field_1.DimensionType.STRING,
            meta: {},
        },
        other: {
            name: 'other',
            data_type: field_1.DimensionType.STRING,
            meta: {
                metrics: {
                    user_id: { type: field_1.MetricType.COUNT_DISTINCT },
                },
            },
        },
        user_id2: {
            name: 'user_id2',
            data_type: field_1.DimensionType.STRING,
            meta: {
                metrics: {
                    user_id2: { type: field_1.MetricType.COUNT_DISTINCT },
                },
            },
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_METRICS = {
    ...exports.BASE_LIGHTDASH_TABLE,
    description: exports.MODEL_WITH_METRIC.description,
    dimensions: {
        user_id: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: exports.MODEL_WITH_METRIC.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        num_participating_athletes: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.NUMBER,
            sql: 'num_participating_men + num_participating_women',
            name: 'num_participating_athletes',
            label: 'Num participating athletes',
            table: exports.MODEL_WITH_METRIC.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            isIntervalBase: false,
            index: 1,
        },
    },
    metrics: {
        user_count: {
            fieldType: field_1.FieldType.METRIC,
            type: field_1.MetricType.COUNT_DISTINCT,
            sql: '${TABLE}.user_id',
            name: 'user_count',
            label: 'User count',
            table: exports.MODEL_WITH_METRIC.name,
            tableLabel: 'My table',
            description: 'Count distinct of User id',
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: undefined,
            groups: [],
            filters: [],
            index: 0,
            dimensionReference: 'myTable_user_id',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
        },
        total_num_participating_athletes: {
            fieldType: field_1.FieldType.METRIC,
            type: field_1.MetricType.SUM,
            sql: 'num_participating_men + num_participating_women',
            name: 'total_num_participating_athletes',
            label: 'Total num participating athletes',
            table: exports.MODEL_WITH_METRIC.name,
            tableLabel: 'My table',
            description: 'Sum of Num participating athletes',
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: undefined,
            groups: [],
            filters: [],
            index: 1,
            dimensionReference: 'myTable_num_participating_athletes',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
        },
    },
};
exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS = {
    ...exports.model,
    columns: COLUMN_WITH_DEFAULT_TIME_INTERVALS,
};
exports.MODEL_WITH_NO_TIME_INTERVAL_DIMENSIONS = {
    ...exports.model,
    columns: COLUMN_WITH_NO_TIME_INTERVALS,
};
exports.LIGHTDASH_TABLE_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS_BIGQUERY = {
    ...exports.BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_created: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.TIMESTAMP,
            sql: '${TABLE}.user_created',
            name: 'user_created',
            label: 'User created',
            table: exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: true,
        },
        user_created_raw: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.TIMESTAMP,
            sql: '${TABLE}.user_created',
            name: 'user_created_raw',
            label: 'User created raw',
            table: exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: timeFrames_1.TimeFrames.RAW,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_created_day: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.DATE,
            sql: 'TIMESTAMP_TRUNC(${TABLE}.user_created, DAY)',
            name: 'user_created_day',
            label: 'User created day',
            table: exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: timeFrames_1.TimeFrames.DAY,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_created_week: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.DATE,
            sql: 'TIMESTAMP_TRUNC(${TABLE}.user_created, WEEK)',
            name: 'user_created_week',
            label: 'User created week',
            table: exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: timeFrames_1.TimeFrames.WEEK,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_created_month: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.DATE,
            sql: 'TIMESTAMP_TRUNC(${TABLE}.user_created, MONTH)',
            name: 'user_created_month',
            label: 'User created month',
            table: exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: timeFrames_1.TimeFrames.MONTH,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            isIntervalBase: false,
            index: 0,
        },
        user_created_quarter: {
            description: undefined,
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            format: undefined,
            groups: ['User created'],
            colors: undefined,
            hidden: false,
            label: 'User created quarter',
            name: 'user_created_quarter',
            round: undefined,
            compact: undefined,
            separator: undefined,
            source: undefined,
            sql: 'TIMESTAMP_TRUNC(${TABLE}.user_created, QUARTER)',
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: timeFrames_1.TimeFrames.QUARTER,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            type: field_1.DimensionType.DATE,
            index: 0,
            isIntervalBase: false,
        },
        user_created_year: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.DATE,
            sql: 'TIMESTAMP_TRUNC(${TABLE}.user_created, YEAR)',
            name: 'user_created_year',
            label: 'User created year',
            table: exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: timeFrames_1.TimeFrames.YEAR,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS_SNOWFLAKE = {
    ...exports.BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_created: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.TIMESTAMP,
            sql: "TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created))",
            name: 'user_created',
            table: exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            label: 'User created',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: true,
        },
        user_created_raw: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.TIMESTAMP,
            sql: "TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created))",
            name: 'user_created_raw',
            table: exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            label: 'User created raw',
            source: undefined,
            timeInterval: timeFrames_1.TimeFrames.RAW,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_created_day: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.DATE,
            sql: "DATE_TRUNC('DAY', TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created)))",
            name: 'user_created_day',
            table: exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            label: 'User created day',
            isIntervalBase: false,
            source: undefined,
            timeInterval: timeFrames_1.TimeFrames.DAY,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
        },
        user_created_week: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.DATE,
            sql: "DATE_TRUNC('WEEK', TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created)))",
            name: 'user_created_week',
            table: exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            label: 'User created week',
            source: undefined,
            timeInterval: timeFrames_1.TimeFrames.WEEK,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_created_month: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.DATE,
            sql: "DATE_TRUNC('MONTH', TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created)))",
            name: 'user_created_month',
            table: exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            label: 'User created month',
            source: undefined,
            timeInterval: timeFrames_1.TimeFrames.MONTH,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_created_quarter: {
            description: undefined,
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            format: undefined,
            groups: ['User created'],
            colors: undefined,
            hidden: false,
            label: 'User created quarter',
            name: 'user_created_quarter',
            round: undefined,
            compact: undefined,
            separator: undefined,
            source: undefined,
            sql: "DATE_TRUNC('QUARTER', TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created)))",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: timeFrames_1.TimeFrames.QUARTER,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            type: field_1.DimensionType.DATE,
            index: 0,
            isIntervalBase: false,
        },
        user_created_year: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.DATE,
            sql: "DATE_TRUNC('YEAR', TO_TIMESTAMP_NTZ(CONVERT_TIMEZONE('UTC', ${TABLE}.user_created)))",
            name: 'user_created_year',
            table: exports.MODEL_WITH_DEFAULT_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            label: 'User created year',
            source: undefined,
            timeInterval: timeFrames_1.TimeFrames.YEAR,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
};
exports.MODEL_WITH_OFF_TIME_INTERVAL_DIMENSIONS = {
    ...exports.model,
    columns: COLUMN_WITH_OFF_TIME_INTERVALS,
};
exports.MODEL_WITH_OFF_BOOLEAN_TIME_INTERVAL_DIMENSIONS = {
    ...exports.model,
    columns: COLUMN_WITH_OFF_BOOLEAN_TIME_INTERVALS,
};
exports.LIGHTDASH_TABLE_WITH_OFF_TIME_INTERVAL_DIMENSIONS = {
    ...exports.BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_created: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.TIMESTAMP,
            sql: '${TABLE}.user_created',
            name: 'user_created',
            label: 'User created',
            table: exports.MODEL_WITH_OFF_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
};
exports.MODEL_WITH_CUSTOM_TIME_INTERVAL_DIMENSIONS = {
    ...exports.model,
    columns: COLUMN_WITH_CUSTOM_TIME_INTERVALS,
};
exports.LIGHTDASH_TABLE_WITH_CUSTOM_TIME_INTERVAL_DIMENSIONS = {
    ...exports.BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_created: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.DATE,
            sql: '${TABLE}.user_created',
            name: 'user_created',
            label: 'User created',
            table: exports.MODEL_WITH_CUSTOM_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: true,
        },
        user_created_year: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.DATE,
            sql: 'DATE_TRUNC(${TABLE}.user_created, YEAR)',
            name: 'user_created_year',
            label: 'User created year',
            table: exports.MODEL_WITH_CUSTOM_TIME_INTERVAL_DIMENSIONS.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: timeFrames_1.TimeFrames.YEAR,
            timeIntervalBaseDimensionName: 'user_created',
            timeIntervalBaseDimensionType: field_1.DimensionType.DATE,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: ['User created'],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
};
exports.warehouseSchema = {
    [exports.model.database]: {
        [exports.model.schema]: {
            [exports.model.name]: {
                [column.name]: field_1.DimensionType.STRING,
            },
        },
    },
};
exports.warehouseSchemaWithMissingTable = {
    [exports.model.database]: {
        [exports.model.schema]: {},
    },
};
exports.warehouseSchemaWithMissingColumn = {
    [exports.model.database]: {
        [exports.model.schema]: {
            [exports.model.name]: {},
        },
    },
};
exports.warehouseSchemaWithUpperCaseColumn = {
    [exports.model.database]: {
        [exports.model.schema]: {
            [exports.model.name]: {
                [column.name.toUpperCase()]: field_1.DimensionType.STRING,
            },
        },
    },
};
exports.expectedModelWithType = {
    ...exports.model,
    columns: {
        myColumnName: { ...column, data_type: field_1.DimensionType.STRING },
    },
};
exports.LIGHTDASH_TABLE_SQL_WHERE = {
    ...exports.BASE_LIGHTDASH_TABLE,
    sqlWhere: '${payment_method} IS NOT NULL',
};
exports.MODEL_WITH_ADDITIONAL_DIMENSIONS = {
    ...exports.model,
    columns: {
        metadata: {
            name: 'metadata',
            data_type: field_1.DimensionType.STRING,
            meta: {
                dimension: {
                    hidden: true,
                },
                additional_dimensions: {
                    version: {
                        type: field_1.DimensionType.NUMBER,
                        sql: "${metadata}-->'version'",
                    },
                    created_at: {
                        type: field_1.DimensionType.TIMESTAMP,
                        sql: "${metadata}-->'created_at'",
                    },
                },
            },
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_ADDITIONAL_DIMENSIONS = {
    ...exports.BASE_LIGHTDASH_TABLE,
    dimensions: {
        metadata: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.STRING,
            sql: '${TABLE}.metadata',
            name: 'metadata',
            label: 'Metadata',
            table: exports.BASE_LIGHTDASH_TABLE.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: true,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        version: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.NUMBER,
            sql: "${metadata}-->'version'",
            name: 'version',
            label: 'Version',
            table: exports.BASE_LIGHTDASH_TABLE.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
        },
        created_at: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.TIMESTAMP,
            sql: "${metadata}-->'created_at'",
            name: 'created_at',
            label: 'Created at',
            table: exports.BASE_LIGHTDASH_TABLE.name,
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: true,
        },
        created_at_day: {
            colors: undefined,
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: field_1.FieldType.DIMENSION,
            format: undefined,
            groups: ['Created at'],
            hidden: false,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
            label: 'Created at day',
            name: 'created_at_day',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            source: undefined,
            sql: "DATE_TRUNC('DAY', ${metadata}-->'created_at')",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: timeFrames_1.TimeFrames.DAY,
            timeIntervalBaseDimensionName: 'created_at',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            type: field_1.DimensionType.DATE,
        },
        created_at_month: {
            colors: undefined,
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: field_1.FieldType.DIMENSION,
            format: undefined,
            groups: ['Created at'],
            hidden: false,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
            label: 'Created at month',
            name: 'created_at_month',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            source: undefined,
            sql: "DATE_TRUNC('MONTH', ${metadata}-->'created_at')",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: timeFrames_1.TimeFrames.MONTH,
            timeIntervalBaseDimensionName: 'created_at',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            type: field_1.DimensionType.DATE,
        },
        created_at_quarter: {
            colors: undefined,
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: field_1.FieldType.DIMENSION,
            format: undefined,
            groups: ['Created at'],
            hidden: false,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
            label: 'Created at quarter',
            name: 'created_at_quarter',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            source: undefined,
            sql: "DATE_TRUNC('QUARTER', ${metadata}-->'created_at')",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: timeFrames_1.TimeFrames.QUARTER,
            timeIntervalBaseDimensionName: 'created_at',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            type: field_1.DimensionType.DATE,
        },
        created_at_raw: {
            colors: undefined,
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: field_1.FieldType.DIMENSION,
            format: undefined,
            groups: ['Created at'],
            hidden: false,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
            label: 'Created at raw',
            name: 'created_at_raw',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            source: undefined,
            sql: "${metadata}-->'created_at'",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: timeFrames_1.TimeFrames.RAW,
            timeIntervalBaseDimensionName: 'created_at',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            type: field_1.DimensionType.TIMESTAMP,
        },
        created_at_week: {
            colors: undefined,
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: field_1.FieldType.DIMENSION,
            format: undefined,
            groups: ['Created at'],
            hidden: false,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
            label: 'Created at week',
            name: 'created_at_week',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            source: undefined,
            sql: "DATE_TRUNC('WEEK', ${metadata}-->'created_at')",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: timeFrames_1.TimeFrames.WEEK,
            timeIntervalBaseDimensionName: 'created_at',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            type: field_1.DimensionType.DATE,
        },
        created_at_year: {
            colors: undefined,
            compact: undefined,
            separator: undefined,
            description: undefined,
            fieldType: field_1.FieldType.DIMENSION,
            format: undefined,
            groups: ['Created at'],
            hidden: false,
            index: 0,
            isAdditionalDimension: true,
            isIntervalBase: false,
            label: 'Created at year',
            name: 'created_at_year',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            round: undefined,
            source: undefined,
            sql: "DATE_TRUNC('YEAR', ${metadata}-->'created_at')",
            table: 'myTable',
            tableLabel: 'My table',
            timeInterval: timeFrames_1.TimeFrames.YEAR,
            timeIntervalBaseDimensionName: 'created_at',
            timeIntervalBaseDimensionType: field_1.DimensionType.TIMESTAMP,
            type: field_1.DimensionType.DATE,
        },
    },
};
exports.SPOTLIGHT_CONFIG_WITH_CATEGORIES_AND_HIDE = {
    spotlight: {
        default_visibility: 'show',
        categories: {
            category_1: { label: 'Category 1' },
            category_2: { label: 'Category 2', color: 'red' },
        },
    },
};
exports.MODEL_WITH_NO_CATEGORIES = {
    ...exports.MODEL_WITH_METRIC,
    meta: {
        spotlight: {
            visibility: 'hide',
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_NO_CATEGORIES = {
    ...exports.LIGHTDASH_TABLE_WITH_METRICS,
    metrics: Object.fromEntries(Object.entries(exports.LIGHTDASH_TABLE_WITH_METRICS.metrics).map(([key, metric]) => [
        key,
        {
            ...metric,
            spotlight: { ...metric.spotlight, visibility: 'hide' },
        },
    ])),
    dimensions: exports.LIGHTDASH_TABLE_WITH_METRICS.dimensions,
};
exports.MODEL_WITH_MODEL_LEVEL_CATEGORIES = {
    ...exports.MODEL_WITH_METRIC,
    meta: {
        spotlight: {
            visibility: 'hide',
            categories: ['category_1'],
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_MODEL_LEVEL_CATEGORIES = {
    ...exports.LIGHTDASH_TABLE_WITH_NO_CATEGORIES,
    metrics: Object.fromEntries(Object.entries(exports.LIGHTDASH_TABLE_WITH_NO_CATEGORIES.metrics).map(([key, metric]) => [
        key,
        {
            ...metric,
            spotlight: {
                visibility: 'hide',
                categories: ['category_1'],
            },
        },
    ])),
};
exports.MODEL_WITH_METRIC_LEVEL_CATEGORIES = {
    ...exports.MODEL_WITH_MODEL_LEVEL_CATEGORIES,
    columns: {
        user_id: {
            name: 'user_id',
            data_type: field_1.DimensionType.STRING,
            meta: {
                metrics: {
                    user_count: {
                        type: field_1.MetricType.COUNT_DISTINCT,
                        spotlight: {
                            visibility: 'hide',
                            categories: ['category_2'],
                        },
                    },
                },
            },
        },
        num_participating_athletes: {
            name: 'num_participating_athletes',
            data_type: field_1.DimensionType.NUMBER,
            meta: {
                dimension: {
                    sql: 'num_participating_men + num_participating_women',
                },
                metrics: {
                    total_num_participating_athletes: {
                        type: field_1.MetricType.SUM,
                    },
                },
            },
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_METRIC_LEVEL_CATEGORIES = {
    ...exports.LIGHTDASH_TABLE_WITH_MODEL_LEVEL_CATEGORIES,
    metrics: Object.fromEntries(Object.entries(exports.LIGHTDASH_TABLE_WITH_MODEL_LEVEL_CATEGORIES.metrics).map(([key, metric]) => [
        key,
        {
            ...metric,
            spotlight: {
                visibility: 'hide',
                categories: [
                    'category_1',
                    ...(key === 'user_count' ? ['category_2'] : []),
                ],
            },
        },
    ])),
};
exports.LIGHTDASH_TABLE_WITH_AI_HINT = {
    ...exports.BASE_LIGHTDASH_TABLE,
    aiHint: ['This is a customers table.'],
};
exports.LIGHTDASH_TABLE_WITH_AI_HINT_FROM_CONFIG = {
    ...exports.BASE_LIGHTDASH_TABLE,
    aiHint: ['This is a customers table from config.'],
};
exports.MODEL_WITH_DIMENSION_AI_HINT = {
    ...exports.model,
    columns: {
        user_name: {
            name: 'user_name',
            data_type: field_1.DimensionType.STRING,
            meta: {
                dimension: {
                    ai_hint: 'User name dimension with AI hint.',
                },
            },
        },
    },
};
exports.MODEL_WITH_METRIC_AI_HINT = {
    ...exports.model,
    columns: {
        user_id: {
            name: 'user_id',
            data_type: field_1.DimensionType.STRING,
            meta: {
                metrics: {
                    user_count_with_ai: {
                        type: field_1.MetricType.COUNT_DISTINCT,
                        ai_hint: 'Count of unique users with AI hint.',
                    },
                },
            },
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_DIMENSION_AI_HINT = {
    ...exports.BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_name: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.STRING,
            sql: '${TABLE}.user_name',
            name: 'user_name',
            label: 'User name',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
            aiHint: ['User name dimension with AI hint.'],
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_METRIC_AI_HINT = {
    ...exports.BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_id: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
    metrics: {
        user_count_with_ai: {
            fieldType: field_1.FieldType.METRIC,
            type: field_1.MetricType.COUNT_DISTINCT,
            sql: '${TABLE}.user_id',
            name: 'user_count_with_ai',
            label: 'User count with ai',
            table: 'myTable',
            tableLabel: 'My table',
            description: 'Count distinct of User id',
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: undefined,
            groups: [],
            filters: [],
            index: 0,
            dimensionReference: 'myTable_user_id',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
            aiHint: ['Count of unique users with AI hint.'],
        },
    },
};
exports.MODEL_WITH_MODEL_METRIC_AI_HINT = {
    ...exports.model,
    meta: {
        metrics: {
            completion_percentage: {
                type: field_1.MetricType.NUMBER,
                sql: '${total_completed}/${total_orders}',
                ai_hint: 'Completion percentage of orders.',
            },
        },
    },
};
exports.MODEL_WITH_AI_HINT_ARRAY = {
    ...exports.model,
    meta: {
        ai_hint: ['This is a customers table.', 'Contains customer data.'],
    },
};
exports.MODEL_WITH_DIMENSION_AI_HINT_ARRAY = {
    ...exports.model,
    columns: {
        user_name: {
            name: 'user_name',
            data_type: field_1.DimensionType.STRING,
            meta: {
                dimension: {
                    ai_hint: ['User name dimension.', 'Contains PII data.'],
                },
            },
        },
    },
};
exports.MODEL_WITH_METRIC_AI_HINT_ARRAY = {
    ...exports.model,
    columns: {
        user_id: {
            name: 'user_id',
            data_type: field_1.DimensionType.STRING,
            meta: {
                metrics: {
                    user_count_with_ai: {
                        type: field_1.MetricType.COUNT_DISTINCT,
                        ai_hint: [
                            'Count of unique users.',
                            'Excludes null values.',
                        ],
                    },
                },
            },
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_MODEL_METRIC_AI_HINT = {
    ...exports.BASE_LIGHTDASH_TABLE,
    metrics: {
        completion_percentage: {
            fieldType: field_1.FieldType.METRIC,
            type: field_1.MetricType.NUMBER,
            sql: '${total_completed}/${total_orders}',
            name: 'completion_percentage',
            label: 'Completion percentage',
            table: 'myTable',
            tableLabel: 'My table',
            description: undefined,
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: undefined,
            groups: [],
            filters: [],
            index: 0,
            dimensionReference: undefined,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
            aiHint: ['Completion percentage of orders.'],
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_AI_HINT_ARRAY = {
    ...exports.BASE_LIGHTDASH_TABLE,
    aiHint: ['This is a customers table.', 'Contains customer data.'],
};
exports.LIGHTDASH_TABLE_WITH_DIMENSION_AI_HINT_ARRAY = {
    ...exports.BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_name: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.STRING,
            sql: '${TABLE}.user_name',
            name: 'user_name',
            label: 'User name',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
            aiHint: ['User name dimension.', 'Contains PII data.'],
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_METRIC_AI_HINT_ARRAY = {
    ...exports.BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_id: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            anyAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
    },
    metrics: {
        user_count_with_ai: {
            fieldType: field_1.FieldType.METRIC,
            type: field_1.MetricType.COUNT_DISTINCT,
            sql: '${TABLE}.user_id',
            name: 'user_count_with_ai',
            label: 'User count with ai',
            table: 'myTable',
            tableLabel: 'My table',
            description: 'Count distinct of User id',
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: undefined,
            groups: [],
            filters: [],
            index: 0,
            dimensionReference: 'myTable_user_id',
            requiredAttributes: undefined,
            anyAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
            aiHint: ['Count of unique users.', 'Excludes null values.'],
        },
    },
};
exports.MODEL_WITH_DEFAULT_SHOW_UNDERLYING_VALUES = {
    ...exports.model,
    meta: {
        default_show_underlying_values: ['user_id', 'user_name'],
        metrics: {
            total_revenue: {
                type: field_1.MetricType.SUM,
                sql: '${TABLE}.revenue',
            },
            average_revenue: {
                type: field_1.MetricType.AVERAGE,
                sql: '${TABLE}.revenue',
                show_underlying_values: ['custom_field'], // This should override the default
            },
        },
    },
    columns: {
        user_id: {
            name: 'user_id',
            data_type: field_1.DimensionType.STRING,
        },
        user_name: {
            name: 'user_name',
            data_type: field_1.DimensionType.STRING,
        },
        revenue: {
            name: 'revenue',
            data_type: field_1.DimensionType.NUMBER,
        },
    },
};
exports.LIGHTDASH_TABLE_WITH_DEFAULT_SHOW_UNDERLYING_VALUES = {
    ...exports.BASE_LIGHTDASH_TABLE,
    dimensions: {
        user_id: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.STRING,
            sql: '${TABLE}.user_id',
            name: 'user_id',
            label: 'User id',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 0,
            isIntervalBase: false,
        },
        user_name: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.STRING,
            sql: '${TABLE}.user_name',
            name: 'user_name',
            label: 'User name',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 1,
            isIntervalBase: false,
        },
        revenue: {
            fieldType: field_1.FieldType.DIMENSION,
            requiredAttributes: undefined,
            description: undefined,
            type: field_1.DimensionType.NUMBER,
            sql: '${TABLE}.revenue',
            name: 'revenue',
            label: 'Revenue',
            table: 'myTable',
            tableLabel: 'My table',
            source: undefined,
            timeInterval: undefined,
            timeIntervalBaseDimensionName: undefined,
            timeIntervalBaseDimensionType: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            compact: undefined,
            separator: undefined,
            groups: [],
            colors: undefined,
            index: 2,
            isIntervalBase: false,
        },
    },
    metrics: {
        total_revenue: {
            fieldType: field_1.FieldType.METRIC,
            type: field_1.MetricType.SUM,
            sql: '${TABLE}.revenue',
            name: 'total_revenue',
            label: 'Total revenue',
            table: 'myTable',
            tableLabel: 'My table',
            description: undefined,
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: ['user_id', 'user_name'], // Should inherit from model default
            groups: [],
            filters: [],
            index: 0,
            requiredAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
        },
        average_revenue: {
            fieldType: field_1.FieldType.METRIC,
            type: field_1.MetricType.AVERAGE,
            sql: '${TABLE}.revenue',
            name: 'average_revenue',
            label: 'Average revenue',
            table: 'myTable',
            tableLabel: 'My table',
            description: undefined,
            source: undefined,
            hidden: false,
            format: undefined,
            round: undefined,
            percentile: undefined,
            compact: undefined,
            separator: undefined,
            showUnderlyingValues: ['custom_field'], // Should use metric-specific override
            groups: [],
            filters: [],
            index: 1,
            requiredAttributes: undefined,
            spotlight: {
                visibility: 'show',
                categories: [],
            },
        },
    },
};
exports.MODEL_WITH_METRIC_DRIVERS = {
    ...exports.model,
    columns: {
        ...COLUMN_WITH_METRICS,
        num_participating_athletes: {
            ...COLUMN_WITH_METRICS.num_participating_athletes,
            meta: {
                ...COLUMN_WITH_METRICS.num_participating_athletes.meta,
                metrics: {
                    total_num_participating_athletes: {
                        type: field_1.MetricType.SUM,
                        drivers: ['user_count', 'other_table.other_metric'],
                    },
                },
            },
        },
    },
};
exports.MODEL_WITH_CUSTOM_GRANULARITY = {
    ...exports.model,
    columns: {
        created_at: {
            name: 'created_at',
            data_type: field_1.DimensionType.TIMESTAMP,
            meta: {
                dimension: {
                    type: field_1.DimensionType.TIMESTAMP,
                    time_intervals: ['DAY', 'slt_week'],
                },
            },
        },
    },
};
exports.MODEL_WITH_CUSTOM_GRANULARITY_AND_REQUIRED_ATTRIBUTES = {
    ...exports.model,
    columns: {
        created_at: {
            name: 'created_at',
            data_type: field_1.DimensionType.TIMESTAMP,
            meta: {
                dimension: {
                    type: field_1.DimensionType.TIMESTAMP,
                    time_intervals: ['DAY', 'slt_week'],
                    required_attributes: {
                        department: 'finance',
                    },
                },
            },
        },
    },
};
exports.MODEL_WITH_DUPLICATE_METRIC_DIMENSION_NAME = {
    ...exports.model,
    columns: {
        myColumnName: {
            name: 'myColumnName',
            data_type: field_1.DimensionType.STRING,
            meta: {},
        },
    },
    meta: {
        metrics: {
            myColumnName: {
                type: field_1.MetricType.COUNT,
                sql: '${TABLE}.myColumnName',
            },
        },
    },
};
//# sourceMappingURL=translator.mock.js.map