/** * Arial Server - GitHub OAuth utilities * * GitHub Device Flow and user info fetching */ /** * GitHub user info from the API */ export interface GitHubUser { id: number; login: string; avatar_url: string; name: string | null; email: string | null; } /** * GitHub organization info */ export interface GitHubOrg { login: string; id: number; } /** * GitHub team membership */ export interface GitHubTeam { name: string; slug: string; organization: { login: string; }; } /** * Device code response from GitHub */ export interface DeviceCodeResponse { device_code: string; user_code: string; verification_uri: string; expires_in: number; interval: number; } /** * Access token response from GitHub */ export interface AccessTokenResponse { access_token: string; token_type: string; scope: string; } /** * Error response from GitHub */ export interface GitHubErrorResponse { error: string; error_description?: string; } /** * Result type for GitHub API calls */ export type GitHubResult = { ok: true; value: T; } | { ok: false; error: string; }; /** * GitHub OAuth configuration */ export interface GitHubOAuthConfig { clientId: string; clientSecret: string; baseUrl: string; } /** * Start the GitHub Device Flow */ export declare function startDeviceFlow(config: GitHubOAuthConfig, scope?: string): Promise>; /** * Poll result types */ export type PollResult = AccessTokenResponse | { status: "pending"; } | { status: "slow_down"; interval: number; } | { status: "expired"; }; /** * Poll for the access token after user authorization */ export declare function pollForAccessToken(config: GitHubOAuthConfig, deviceCode: string): Promise>; /** * Get the authenticated user's info */ export declare function getUser(accessToken: string, baseUrl?: string): Promise>; /** * Get the user's organization memberships */ export declare function getUserOrgs(accessToken: string, baseUrl?: string): Promise>; /** * Get the user's team memberships */ export declare function getUserTeams(accessToken: string, baseUrl?: string): Promise>; /** * Check if user is a member of any of the allowed organizations */ export declare function checkOrgMembership(accessToken: string, allowedOrgs: string[], baseUrl?: string): Promise>; /** * Check if user is a member of any of the allowed teams * Team format: "org/team-slug" */ export declare function checkTeamMembership(accessToken: string, allowedTeams: string[], baseUrl?: string): Promise>; //# sourceMappingURL=github.d.ts.map