import { ConfigService } from '@nestjs/config';
export type GiteaError = {
    code: 'gitea_token_missing';
    message: string;
} | {
    code: 'gitea_token_insufficient_scope';
    message: string;
    required?: string[];
} | {
    code: 'gitea_org_not_found';
    message: string;
    org: string;
} | {
    code: 'gitea_repo_already_exists';
    message: string;
    fullName: string;
} | {
    code: 'gitea_unreachable';
    message: string;
    cause?: string;
} | {
    code: 'gitea_webhook_install_failed';
    message: string;
    fullName: string;
    cause?: string;
} | {
    code: 'gitea_webhook_base_url_missing';
    message: string;
} | {
    code: 'gitea_unknown';
    message: string;
    status?: number;
    body?: string;
};
export interface GiteaRepoSummary {
    id: number;
    fullName: string;
    cloneUrl: string;
    sshUrl: string;
}
export interface PushCredential {
    token: string;
    expiresAt: Date;
    isEphemeral: false;
}
export declare class GiteaClientService {
    private readonly config;
    private readonly logger;
    private readonly baseUrl;
    private readonly apiToken;
    constructor(config: ConfigService);
    createRepo(params: {
        employeeSlug: string;
        appSlug: string;
    }): Promise<{
        ok: true;
        repo: GiteaRepoSummary;
    } | {
        ok: false;
        error: GiteaError;
    }>;
    getRepo(params: {
        employeeSlug: string;
        appSlug: string;
    }): Promise<{
        ok: true;
        exists: boolean;
        repo?: GiteaRepoSummary;
    } | {
        ok: false;
        error: GiteaError;
    }>;
    issuePushCredential(): {
        ok: true;
        credential: PushCredential;
    } | {
        ok: false;
        error: GiteaError;
    };
    ensureWebhook(repoFullName: string): Promise<{
        ok: true;
        created: boolean;
    } | {
        ok: false;
        error: GiteaError;
    }>;
    archiveRepo(params: {
        employeeSlug: string;
        appSlug: string;
    }): Promise<{
        ok: true;
        alreadyArchived: boolean;
    } | {
        ok: false;
        error: GiteaError;
    }>;
    private parseError;
}
