qraft
Version:
A powerful CLI tool to qraft structured project setups from GitHub template repositories
56 lines • 1.81 kB
TypeScript
export interface RepositoryPermissions {
canRead: boolean;
canWrite: boolean;
canAdmin: boolean;
canCreatePR: boolean;
canFork: boolean;
userRole: 'owner' | 'admin' | 'write' | 'triage' | 'read' | 'none';
isPublic: boolean;
isFork: boolean;
}
export interface PermissionCheckResult {
hasPermission: boolean;
permissions: RepositoryPermissions;
alternatives: PermissionAlternative[];
recommendations: string[];
requiresAuth: boolean;
}
export interface PermissionAlternative {
action: 'fork' | 'request_access' | 'use_different_repo' | 'create_pr';
description: string;
automated: boolean;
steps: string[];
}
export interface RepositoryInfo {
owner: string;
name: string;
fullName: string;
isPublic: boolean;
isFork: boolean;
parentRepo?: string | undefined;
defaultBranch: string;
permissions?: RepositoryPermissions | undefined;
}
export declare class PermissionChecker {
private readonly githubToken?;
constructor(githubToken?: string | undefined);
checkRepositoryPermissions(repoOwner: string, repoName: string): Promise<PermissionCheckResult>;
private getRepositoryInfo;
private getUserPermissions;
private probePermissions;
private determineUserRole;
private generateAlternatives;
private generateRecommendations;
private handlePermissionError;
static parseRepositoryUrl(url: string): {
owner: string;
name: string;
} | null;
hasGitHubToken(): boolean;
getCurrentUser(): Promise<{
login: string;
name: string;
} | null>;
checkPermissionsDryRun(repoOwner: string, repoName: string, mockPermissions?: Partial<RepositoryPermissions>): Promise<PermissionCheckResult>;
}
//# sourceMappingURL=permissionChecker.d.ts.map