import { ApId, BaseModel } from '@activepieces/core-utils'

export type FlagId = ApId

export type Flag = {
    value: unknown
} & BaseModel<FlagId>

export enum ApEnvironment {
    PRODUCTION = 'prod',
    DEVELOPMENT = 'dev',
    TESTING = 'test',
}

export enum ApEdition {
    COMMUNITY = 'ce',
    ENTERPRISE = 'ee',
    CLOUD = 'cloud',
}

export enum ApFlagId {
    SHOW_BADGES = 'SHOW_BADGES',
    SHOW_POWERED_BY_IN_FORM = 'SHOW_POWERED_BY_IN_FORM',
    CLOUD_AUTH_ENABLED = 'CLOUD_AUTH_ENABLED',
    AGENTS_CONFIGURED = 'AGENTS_CONFIGURED',
    CURRENT_VERSION = 'CURRENT_VERSION',
    EDITION = 'EDITION',
    EMAIL_AUTH_ENABLED = 'EMAIL_AUTH_ENABLED',
    FRONTEND_SENTRY_DSN = 'FRONTEND_SENTRY_DSN',
    EXECUTION_DATA_RETENTION_DAYS = 'EXECUTION_DATA_RETENTION_DAYS',
    ENVIRONMENT = 'ENVIRONMENT',
    PUBLIC_URL = 'PUBLIC_URL',
    LATEST_VERSION = 'LATEST_VERSION',
    PRIVACY_POLICY_URL = 'PRIVACY_POLICY_URL',
    PIECES_SYNC_MODE = 'PIECES_SYNC_MODE',
    PRIVATE_PIECES_ENABLED = 'PRIVATE_PIECES_ENABLED',
    FLOW_RUN_MEMORY_LIMIT_KB = 'FLOW_RUN_MEMORY_LIMIT_KB',
    FLOW_RUN_LOG_SIZE_LIMIT_MB = 'FLOW_RUN_LOG_SIZE_LIMIT_MB',
    FLOW_RUN_TIME_SECONDS = 'FLOW_RUN_TIME_SECONDS',
    TRIGGER_TIMEOUT_SECONDS = 'TRIGGER_TIMEOUT_SECONDS',
    SHOW_COMMUNITY = 'SHOW_COMMUNITY',
    SUPPORTED_APP_WEBHOOKS = 'SUPPORTED_APP_WEBHOOKS',
    TELEMETRY_ENABLED = 'TELEMETRY_ENABLED',
    TEMPLATES_PROJECT_ID = 'TEMPLATES_PROJECT_ID',
    TERMS_OF_SERVICE_URL = 'TERMS_OF_SERVICE_URL',
    THEME = 'THEME',
    THIRD_PARTY_AUTH_PROVIDER_REDIRECT_URL = 'THIRD_PARTY_AUTH_PROVIDER_REDIRECT_URL',
    THIRD_PARTY_AUTH_PROVIDERS_TO_SHOW_MAP = 'THIRD_PARTY_AUTH_PROVIDERS_TO_SHOW_MAP',
    SAML_AUTH_ACS_URL = 'SAML_AUTH_ACS_URL',
    USER_CREATED = 'USER_CREATED',
    WEBHOOK_URL_PREFIX = 'WEBHOOK_URL_PREFIX',
    ALLOW_NPM_PACKAGES_IN_CODE_STEP = 'ALLOW_NPM_PACKAGES_IN_CODE_STEP',
    PAUSED_FLOW_TIMEOUT_DAYS = 'PAUSED_FLOW_TIMEOUT_DAYS',
    WEBHOOK_TIMEOUT_SECONDS = 'WEBHOOK_TIMEOUT_SECONDS',
    MAX_RECORDS_PER_TABLE = 'MAX_RECORDS_PER_TABLE',
    MAX_FIELDS_PER_TABLE = 'MAX_FIELDS_PER_TABLE',
    MAX_FILE_SIZE_MB = 'MAX_FILE_SIZE_MB',
    MAX_MCPS_PER_PROJECT = 'MAX_MCPS_PER_PROJECT',
    ENABLE_FLOW_ON_PUBLISH = 'ENABLE_FLOW_ON_PUBLISH',
    SHOW_ALERTS = 'SHOW_ALERTS',
    ALLOWED_EMBED_ORIGINS = 'ALLOWED_EMBED_ORIGINS',
    SHOW_PROJECT_MEMBERS = 'SHOW_PROJECT_MEMBERS',
    TEMPLATES_CATEGORIES = 'TEMPLATES_CATEGORIES',

    // AI_CREDITS_ENABLED = 'AI_CREDITS_ENABLED',
    // SHOW_BILLING = 'SHOW_BILLING',
    CAN_BUY_AI_CREDITS = 'CAN_BUY_AI_CREDITS',
    CAN_BUY_ACTIVE_FLOWS = 'CAN_BUY_ACTIVE_FLOWS',
    SHOW_BILLING_LIMITS_ON_SIDEBAR = 'SHOW_BILLING_LIMITS_ON_SIDEBAR',
    SHOW_BILLING_PAGE = 'SHOW_BILLING_PAGE',
    PROJECT_RATE_LIMITER_ENABLED = 'PROJECT_RATE_LIMITER_ENABLED',
    DEFAULT_CONCURRENT_JOBS_LIMIT = 'DEFAULT_CONCURRENT_JOBS_LIMIT',
    SMTP_CONFIGURED = 'SMTP_CONFIGURED',
    PGVECTOR_AVAILABLE = 'PGVECTOR_AVAILABLE',
}
