# | Dependency management contracts (schema definitions)
# | Migrated from: provisioning/kcl/dependencies.k
# | Pattern: Pure schema definitions using Nickel contracts

{
  ResourceRequirement = {
    cpu | String,
    memory | String,
    disk | String,
    network | Bool,
    privileged | Bool,
  },

  HealthCheck = {
    command | String,
    interval | Number,
    timeout | Number,
    retries | Number,
    success_threshold | Number,
    failure_threshold | Number,
  },

  InstallationPhase = {
    name | String,
    order | Number,
    parallel | Bool,
    required | Bool,
  },

  TaskservDependencies = {
    name | String,
    timeout | Number,
    retry_count | Number,
    os_support,
    arch_support,
    requires | Dyn | optional,
    conflicts | Dyn | optional,
    optional | Dyn | optional,
    provides | Dyn | optional,
    resources | Dyn | optional,
    health_checks | Dyn | optional,
    readiness_probe | Dyn | optional,
    phases | Dyn | optional,
    k8s_versions | Dyn | optional,
  },

  TaskservDependency = {
    name | String,
    timeout | Number,
    retry_count | Number,
    os_support,
    arch_support,
    requires | Dyn | optional,
    conflicts | Dyn | optional,
    optional | Dyn | optional,
    provides | Dyn | optional,
    resources | Dyn | optional,
    health_checks | Dyn | optional,
    readiness_probe | Dyn | optional,
    phases | Dyn | optional,
    k8s_versions | Dyn | optional,
  },

  OCISource = {
    registry | String,
    namespace | String,
    tls_enabled | Bool,
    insecure_skip_verify | Bool,
    platform | String,
    media_type | String,
    auth_token_path | String | optional,
  },

  GiteaSource = {
    url | String,
    organization | String,
    use_ssh | Bool,
    branch | String,
    auth_token_path | String | optional,
  },

  LocalSource = {
    path | String,
    watch | Bool,
  },

  HTTPSource = {
    url | String,
    basic_auth | Bool,
    auth_header | String | optional,
    username | String | optional,
    password | String | optional,
  },

  ExtensionSource = {
    type | String,
    oci | Dyn | optional,
    gitea | Dyn | optional,
    local | Dyn | optional,
    http | Dyn | optional,
  },

  ExtensionManifest = {
    name | String,
    type | String,
    version | String,
    license | String,
    platforms,
    description | String | optional,
    author | String | optional,
    homepage | String | optional,
    repository | String | optional,
    dependencies | Dyn | optional,
    tags | Dyn | optional,
    min_provisioning_version | String | optional,
  },

  RepositoryConfig = {
    name | String,
    type | String,
    enabled | Bool,
    priority | Number,
    cache_ttl | Number,
    source | Dyn | optional,
    version | String | optional,
  },

  DependencyResolution = {
    strategy | String,
    allow_prerelease | Bool,
    pin_versions | Bool,
    max_depth | Number,
    conflict_strategy | String,
  },
}
