# | Gitea integration configuration contracts (schema definitions)
# | Migrated from: provisioning/kcl/gitea.k
# | Pattern: Pure schema definitions using Nickel contracts

{
  GiteaConfig = {
    mode | String,
    local | Dyn | optional,
    remote | Dyn | optional,
    auth | Dyn | optional,
    repositories | Dyn | optional,
    workspace_features | Dyn | optional,
  },

  LocalGitea = {
    enabled | Bool,
    deployment | String,
    port | Number,
    data_dir | String,
    auto_start | Bool,
    docker | Dyn | optional,
    binary | Dyn | optional,
  },

  DockerGitea = {
    image | String,
    container_name | String,
    ssh_port | Number,
    environment,
    volumes,
    restart_policy | String,
  },

  BinaryGitea = {
    binary_path | String,
    config_path | String,
    version | String,
    user | String,
    group | String,
  },

  RemoteGitea = {
    enabled | Bool,
    url | String,
    api_url | String,
  },

  GiteaAuth = {
    token_path | String,
    username | String | optional,
  },

  GiteaRepositories = {
    organization | String,
    core_repo | String,
    extensions_repo | String,
    platform_repo | String,
    workspaces_org | String,
  },

  WorkspaceFeatures = {
    git_integration | Bool,
    locking_enabled | Bool,
    webhooks_enabled | Bool,
    auto_sync | Bool,
    branch_protection | Bool,
  },

  GiteaRepository = {
    name | String,
    owner | String,
    private | Bool,
    auto_init | Bool,
    default_branch | String,
    description | String | optional,
    gitignore | String | optional,
    license | String | optional,
    readme | String | optional,
  },

  GiteaRelease = {
    tag_name | String,
    release_name | String,
    draft | Bool,
    prerelease | Bool,
    target_commitish | String,
    body | String | optional,
  },

  GiteaIssue = {
    title | String,
    body | String,
    labels,
    assignee | String | optional,
    milestone | String | optional,
  },

  WorkspaceLock = {
    workspace_name | String,
    lock_type | String,
    user | String,
    timestamp | String,
    force_unlock | Bool,
    operation | String | optional,
    expiry | String | optional,
  },

  ExtensionPublishConfig = {
    extension_path | String,
    version | String,
    include_patterns,
    exclude_patterns,
    compression | String,
    release_notes | String | optional,
  },

  GiteaWebhook = {
    url | String,
    content_type | String,
    events,
    active | Bool,
    secret | String | optional,
  },
}
