UNPKG

@reliverse/rse

Version:

@reliverse/rse is your all-in-one companion for bootstrapping and improving any kind of projects (especially web apps built with frameworks like Next.js) — whether you're kicking off something new or upgrading an existing app. It is also a little AI-power

30 lines (29 loc) 1.94 kB
import type { ReliverseMemory } from "./schemaMemory"; export declare const OctokitWithRest: typeof import("@octokit/core").Octokit & (new (...args: any[]) => import("@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types").RestEndpointMethods & import("@octokit/plugin-rest-endpoint-methods").Api & { paginate: import("@octokit/plugin-paginate-rest").PaginateInterface; }) & import("@octokit/core/dist-types/types").Constructor<import("@octokit/plugin-rest-endpoint-methods").Api>; export declare const octokitUserAgent: string; export type InstanceGithub = InstanceType<typeof OctokitWithRest>; /** * Ensures a valid GitHub token is available in rse's memory. * * If a token is already stored in memory, this function validates it by fetching the * authenticated user's information. If the token is missing or invalid, the user is prompted * to input one. The new token is then saved persistently. * * @param memory - The rse memory object. * @param maskInput - A flag or the string "prompt" that determines if input should be masked. * @returns The valid GitHub token. */ export declare function ensureGithubToken(memory: ReliverseMemory, maskInput: "prompt" | boolean): Promise<string>; /** * Initializes a GitHub SDK instance and returns the GitHub token along with the Octokit instance. * * This function is analogous to the Vercel SDK init function; it ensures that a valid GitHub token is * available (prompting for one if necessary), initializes Octokit with the token, and returns both. * * @param memory - The rse memory object. * @param maskInput - A flag or "prompt" to determine if the token input should be masked. * @returns A tuple containing the GitHub token and works as the wrapper for the Octokit instance. */ export declare function initGithubSDK(memory: ReliverseMemory, frontendUsername: string, maskInput: "prompt" | boolean): Promise<[string, InstanceGithub, string]>;