"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isApiError = exports.TableSelectionType = exports.hasWarehouseCredentials = exports.CreateProjectTableConfiguration = exports.DbtProjectTypeLabels = exports.sensitiveDbtCredentialsFieldNames = exports.DBFieldTypes = exports.DeploySessionStatus = exports.LightdashMode = exports.hasInviteCode = exports.isRequestMethod = exports.RequestMethod = void 0;
const projects_1 = require("./projects");
var RequestMethod;
(function (RequestMethod) {
    RequestMethod["CLI"] = "CLI";
    RequestMethod["CLI_CI"] = "CLI_CI";
    RequestMethod["WEB_APP"] = "WEB_APP";
    RequestMethod["SDK"] = "SDK";
    RequestMethod["HEADLESS_BROWSER"] = "HEADLESS_BROWSER";
    RequestMethod["UNKNOWN"] = "UNKNOWN";
    RequestMethod["BACKEND"] = "BACKEND";
})(RequestMethod || (exports.RequestMethod = RequestMethod = {}));
const isRequestMethod = (value) => !!value && Object.values(RequestMethod).includes(value);
exports.isRequestMethod = isRequestMethod;
const hasInviteCode = (data) => 'inviteCode' in data;
exports.hasInviteCode = hasInviteCode;
var LightdashMode;
(function (LightdashMode) {
    LightdashMode["DEFAULT"] = "default";
    LightdashMode["DEMO"] = "demo";
    LightdashMode["PR"] = "pr";
    LightdashMode["CLOUD_BETA"] = "cloud_beta";
    LightdashMode["DEV"] = "development";
})(LightdashMode || (exports.LightdashMode = LightdashMode = {}));
// Deploy Session Types
var DeploySessionStatus;
(function (DeploySessionStatus) {
    DeploySessionStatus["UPLOADING"] = "uploading";
    DeploySessionStatus["FINALIZING"] = "finalizing";
    DeploySessionStatus["COMPLETED"] = "completed";
    DeploySessionStatus["FAILED"] = "failed";
})(DeploySessionStatus || (exports.DeploySessionStatus = DeploySessionStatus = {}));
var DBFieldTypes;
(function (DBFieldTypes) {
    DBFieldTypes["DIMENSION"] = "dimension";
    DBFieldTypes["METRIC"] = "metric";
})(DBFieldTypes || (exports.DBFieldTypes = DBFieldTypes = {}));
exports.sensitiveDbtCredentialsFieldNames = [
    'personal_access_token',
    'api_key',
];
exports.DbtProjectTypeLabels = {
    [projects_1.DbtProjectType.DBT]: 'dbt local server',
    [projects_1.DbtProjectType.DBT_CLOUD_IDE]: 'dbt cloud',
    [projects_1.DbtProjectType.GITHUB]: 'Github',
    [projects_1.DbtProjectType.GITLAB]: 'GitLab',
    [projects_1.DbtProjectType.BITBUCKET]: 'BitBucket',
    [projects_1.DbtProjectType.AZURE_DEVOPS]: 'Azure DevOps',
    [projects_1.DbtProjectType.NONE]: 'CLI',
    [projects_1.DbtProjectType.MANIFEST]: 'Manifest',
};
var CreateProjectTableConfiguration;
(function (CreateProjectTableConfiguration) {
    CreateProjectTableConfiguration["PROD"] = "prod";
    CreateProjectTableConfiguration["ALL"] = "all";
})(CreateProjectTableConfiguration || (exports.CreateProjectTableConfiguration = CreateProjectTableConfiguration = {}));
const hasWarehouseCredentials = (createProject) => !!createProject.warehouseConnection &&
    Object.keys(createProject.warehouseConnection).length > 0;
exports.hasWarehouseCredentials = hasWarehouseCredentials;
var TableSelectionType;
(function (TableSelectionType) {
    TableSelectionType["ALL"] = "ALL";
    TableSelectionType["WITH_TAGS"] = "WITH_TAGS";
    TableSelectionType["WITH_NAMES"] = "WITH_NAMES";
})(TableSelectionType || (exports.TableSelectionType = TableSelectionType = {}));
const isApiError = (error) => typeof error === 'object' &&
    error !== null &&
    'status' in error &&
    error.status === 'error';
exports.isApiError = isApiError;
//# sourceMappingURL=api.js.map