/** * GitHub client types. */ import type { BaseIntegrationClient } from "../../types.js"; import type { SupportsApiRequest } from "../base/index.js"; /** * GitHub client for repository and project management. * * Provides the generic apiRequest() method for any GitHub API endpoint. * Use this to interact with GitHub's repositories, issues, pull requests, and other endpoints. * * @example * ```typescript * import { z } from 'zod'; * * // Declare in api(): integrations: { repo: github(INTEGRATION_ID) } * // In run(), access via ctx.integrations.repo * * // Define schemas * const RepositorySchema = z.object({ * id: z.number(), * name: z.string(), * full_name: z.string(), * owner: z.object({ * login: z.string(), * }), * }); * * // Get a repository * const repo = await ctx.integrations.repo.apiRequest( * { * method: 'GET', * path: '/repos/owner/repo', * }, * { response: RepositorySchema } * ); * * // Create an issue * const CreateIssueRequestSchema = z.object({ * title: z.string(), * body: z.string().optional(), * }); * * const IssueSchema = z.object({ * id: z.number(), * number: z.number(), * title: z.string(), * }); * * const issue = await ctx.integrations.repo.apiRequest( * { * method: 'POST', * path: '/repos/owner/repo/issues', * body: { * title: 'Bug report', * body: 'Found a bug...', * }, * }, * { * body: CreateIssueRequestSchema, * response: IssueSchema, * } * ); * ``` */ export interface GitHubClient extends BaseIntegrationClient, SupportsApiRequest { } //# sourceMappingURL=types.d.ts.map