import { SmrtCollection } from '@happyvertical/smrt-core'; import { PullRequest } from '../models/PullRequest'; import { Repository } from '../models/Repository'; import { SearchFilters } from '../types'; export declare class PullRequestCollection extends SmrtCollection { static readonly _itemClass: typeof PullRequest; /** * Discover pull requests from a repository and sync to database * * @param options - Discovery options * @returns Array of PullRequest objects */ discover(options: { repository: Repository; filters?: SearchFilters; }): Promise; /** * Find PRs by repository * * @param repositoryId - Repository ID * @returns Array of PRs */ findByRepository(repositoryId: string): Promise; /** * Find open PRs * * @param repositoryId - Optional repository filter * @returns Array of open PRs */ findOpen(repositoryId?: string): Promise; /** * Find draft PRs * * @param repositoryId - Optional repository filter * @returns Array of draft PRs */ findDrafts(repositoryId?: string): Promise; /** * Find PRs ready to merge * * @param repositoryId - Optional repository filter * @returns Array of mergeable PRs */ findReadyToMerge(repositoryId?: string): Promise; /** * Find PRs by branch * * @param branch - Branch name (head or base) * @param repositoryId - Optional repository filter * @returns Array of PRs */ findByBranch(branch: string, repositoryId?: string): Promise; /** * Find PR by number in a repository * * @param repositoryId - Repository ID * @param number - PR number * @returns PullRequest or null */ findByNumber(repositoryId: string, number: number): Promise; /** * Find PRs ready to merge (AI-powered) * * @param repositoryId - Optional repository filter * @returns Array of PRs that are ready */ findAIReadyToMerge(repositoryId?: string): Promise; /** * Get PRs by change size * * @param size - Size classification * @param repositoryId - Optional repository filter * @returns Array of PRs */ findBySize(size: 'xs' | 's' | 'm' | 'l' | 'xl', repositoryId?: string): Promise; /** * Batch sync PRs from repository * * @param repository - Repository to sync from * @param options - Sync options * @returns Array of synced PRs */ batchSync(repository: Repository, options?: { force?: boolean; }): Promise; /** * Find pull requests by tenant ID * * @param tenantId - Tenant ID to filter by * @returns Array of pull requests for the tenant */ findByTenant(tenantId: string): Promise; /** * Find all global pull requests (no tenant association). * * Routes through the shared tenant-global helper so it does not throw under * an active tenant context (an explicit `tenant_id IS NULL` filter would be * flagged as an isolation violation). (#1600) * * @returns Array of global pull requests */ findGlobal(): Promise; /** * Find pull requests for a tenant plus all global pull requests. * * Fails closed if an active tenant context requests a different tenant's * rows; the admin/system path keeps the cross-tenant capability. (#1600) * * @param tenantId - Tenant ID to filter by * @returns Array of tenant and global pull requests */ findWithGlobals(tenantId: string): Promise; } //# sourceMappingURL=PullRequests.d.ts.map