import { AzureDevOpsActivity } from '../types/index.js'; export interface AzureDevOpsSettings { organization: string; projects?: string[]; tenant?: string; } export interface AzureDevOpsIdentity { id: string; displayName: string; email: string; } type WorkItemAction = AzureDevOpsActivity['workItems'][number]['actions'][number]; interface RawUpdate { revisedBy?: { id?: string; }; revisedDate?: string; fields?: Record; } /** * Reduces a work item's revision history to what this user changed on this day. * Returns null when they did not touch it, so callers can drop the item. */ export declare function mapWorkItemUpdates(updates: RawUpdate[], myId: string, dayStart: Date, dayEnd: Date): { actions: WorkItemAction[]; stateFrom?: string; stateTo?: string; } | null; interface RawPullRequest { pullRequestId?: number; title?: string; status?: string; creationDate?: string; closedDate?: string; createdBy?: { id?: string; }; repository?: { name?: string; }; } /** * Classifies pull requests by what happened to them on the target day. * * ponytail: reviewer-side activity is reported as 'reviewing' without a precise * timestamp, because the PR payload carries no per-vote date. Upgrade path is * fetching /pullRequests/{id}/threads per PR, at one extra call each. */ export declare function mapPullRequests(prs: RawPullRequest[], myId: string, dayStart: Date, dayEnd: Date, project: string, asReviewer?: boolean): AzureDevOpsActivity['pullRequests']; interface RawCommit { comment?: string; commitId?: string; } /** * @param seenCommitIds when supplied, commit ids already present are skipped. * Repositories within a project can share history (mirrors, forks), and the * per-repository commits endpoint would otherwise report one commit several * times, inflating a timesheet summary. */ export declare function mapCommits(commits: RawCommit[], repository: string, project: string, seenCommitIds?: Set): AzureDevOpsActivity['commits']; /** * Tenant ids reach the command line, so they are constrained to the character * set of a GUID or a domain name. Everything else passed to the CLI is a * literal, which keeps the Windows shell path below injection-free. */ export declare function isValidTenant(tenant: string): boolean; /** Quotes only when needed, and never passes a quote character through. */ export declare function shellQuote(value: string): string; /** Local YYYY-MM-DD, for WIQL fields stored with date precision. */ export declare function toWiqlDate(date: Date): string; export declare function azSetupInstructions(): string; export declare class AzureDevOpsIntegration { private settings; private token; private tokenExpiresAt; private identity; private projectCache; initialize(settings: AzureDevOpsSettings): Promise; private requireSettings; private getToken; private api; getIdentity(): Promise; listProjects(): Promise; /** Validates configuration and reports what the credential can see. */ validate(): Promise<{ identity: AzureDevOpsIdentity; projects: string[]; }>; private resolveProjects; getActivityForDate(dateStr: string): Promise; private collectWorkItems; private collectPullRequests; private collectCommits; } export {}; //# sourceMappingURL=azureDevOps.d.ts.map