import { SmrtObject, SmrtObjectOptions } from '@happyvertical/smrt-core'; import { IProject, ItemFilters, ProjectField, ProjectItem, ProjectProviderType, ProjectStatus, SyncOptions } from '../types'; import { Issue } from './Issue'; import { PullRequest } from './PullRequest'; export interface ProjectOptions extends SmrtObjectOptions { projectId?: string; projectNumber?: number; title?: string; description?: string; owner?: string; url?: string; providerType?: ProjectProviderType; tokenConfigKey?: string; statuses?: ProjectStatus[]; fields?: ProjectField[]; statusFieldId?: string; statusOptions?: Record; tenantId?: string | null; } export declare class Project extends SmrtObject { /** * Tenant ID for multi-tenant isolation */ tenantId: string | null; /** * Provider-specific project ID (e.g., GitHub GraphQL node ID) */ projectId: string; /** * Human-readable project number */ projectNumber: number; /** * Project title */ title: string; /** * Project description */ description: string; /** * Project owner (organization or user) */ owner: string; /** * Project URL */ url: string; /** * Project provider type */ providerType: ProjectProviderType; /** * Environment variable name or config key for token resolution */ tokenConfigKey: string; /** * Available statuses (columns) in the project */ statuses: ProjectStatus[]; /** * Custom fields defined in the project */ fields: ProjectField[]; /** * Status field ID for GitHub Projects V2 */ statusFieldId: string; /** * Maps status name to option ID (for GitHub Projects V2) */ statusOptions: Record; /** * Last sync timestamp */ lastSyncedAt: Date | null; /** * Transient: Cached project client (not persisted) */ private _client?; constructor(options?: ProjectOptions); /** * Get the project client, resolving token from config * * @returns Project client for API operations * @throws Error if token cannot be resolved */ getClient(): Promise; /** * Clear the cached client */ clearClient(): void; /** * Sync project metadata from the provider * * @param options - Sync options * @returns This project with updated fields */ sync(options?: SyncOptions): Promise; /** * Add an issue or PR to this project * * @param item - Issue or PullRequest to add * @returns Created ProjectItem */ addItem(item: Issue | PullRequest): Promise; /** * Remove an item from this project * * @param itemId - Project item ID to remove */ removeItem(itemId: string): Promise; /** * Get a specific item from the project * * @param itemId - Project item ID * @returns ProjectItem or null */ getItem(itemId: string): Promise; /** * List items in this project * * @param filters - Optional filters * @returns Array of ProjectItems */ listItems(filters?: ItemFilters): Promise; /** * Update an item's status (column) * * @param itemId - Project item ID * @param status - New status name */ updateItemStatus(itemId: string, status: string): Promise; /** * Update an item's custom field * * @param itemId - Project item ID * @param fieldId - Field ID * @param value - New value */ updateItemField(itemId: string, fieldId: string, value: unknown): Promise; /** * Get available statuses * * @returns Array of status definitions */ getStatuses(): Promise; /** * Get available fields * * @returns Array of field definitions */ getFields(): Promise; /** * Get items in a specific status/column * * @param status - Status name * @returns Array of ProjectItems in that status */ getItemsByStatus(status: string): Promise; /** * Move an item to a new status * * @param item - Issue or PullRequest * @param status - Target status name */ moveItem(item: Issue | PullRequest, status: string): Promise; /** * AI-powered: Analyze project health and suggest improvements * * @returns Analysis of project status */ analyzeHealth(): Promise; /** * Get project by title * * @param title - Project title * @param options - Additional options * @returns Project or null */ static getByTitle(title: string, options?: SmrtObjectOptions): Promise; } //# sourceMappingURL=Project.d.ts.map