import { HttpCacheProvider } from "./cache/types.js"; import { EmptyResultError } from "./errors.js"; import { OptionsInit, OptionsOfBufferResponseBody, OptionsOfJSONResponseBody, OptionsOfTextResponseBody, RequestError } from "got"; import { ZodError } from "zod/v4"; import { IncomingHttpHeaders } from "node:http"; //#region lib/util/http/types.d.ts export type GotContextOptions = { authType?: string; } & Record; export type GotOptions = GotBufferOptions | GotTextOptions | GotJSONOptions; export type GotBufferOptions = OptionsOfBufferResponseBody & GotExtraOptions; export type GotTextOptions = OptionsOfTextResponseBody & GotExtraOptions; export type GotJSONOptions = OptionsOfJSONResponseBody & GotExtraOptions; export type GotStreamOptions = OptionsInit & GotExtraOptions; /** * Renovate extra options. */ export interface GotExtraOptions { abortOnError?: boolean; abortIgnoreStatusCodes?: number[]; token?: string; hostType?: string; enabled?: boolean; memCache?: boolean; noAuth?: boolean; context?: GotContextOptions; /** * Got request timeout, overrides got interface. * Do not delete in `normalizeGotOptions`. */ timeout?: number; } /** * Renovate extra options that are not part of `got` options. */ export declare const GotExtraOptionKeys: (keyof GotExtraOptions)[]; export type OutgoingHttpHeaders = Record; export type GraphqlVariables = Record; export interface GraphqlOptions { variables?: GraphqlVariables; paginate?: boolean; count?: number; limit?: number; cursor?: string | null; acceptHeader?: string; token?: string; readOnly?: boolean; } /** * Renovate http options that are partly not part of `got` options. * Remember to delete these in `normalizeGotOptions` before passing to `got`. */ export interface HttpOptions { body?: any; username?: string; password?: string; baseUrl?: string; headers?: OutgoingHttpHeaders; /** * Do not use authentication */ noAuth?: boolean; throwHttpErrors?: boolean; token?: string; memCache?: boolean; cacheProvider?: HttpCacheProvider; readOnly?: boolean; /** * The response body becomes Renovate configuration, so an internal host must be permitted by a deliberately-scoped `allowInternal` grant rather than an implicit one - see `applyHostGuard`. * * Set it on any request whose response is interpreted as config, no matter which `hostType` the request is made with. */ responseBecomesConfig?: boolean; } export interface HttpHeaders extends IncomingHttpHeaders { link?: string | undefined; } export type HttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'head'; export interface HttpResponse { statusCode: number; body: T; headers: HttpHeaders; authorization?: boolean; cached?: boolean; } export type Task = () => Promise; export type GotTask = Task>; export interface ThrottleLimitRule { matchHost: string; throttleMs: number; } export interface ConcurrencyLimitRule { matchHost: string; concurrency: number; } export type SafeJsonError = RequestError | ZodError | EmptyResultError; //#endregion //# sourceMappingURL=types.d.ts.map