import { ConstraintName } from "../../util/exec/types.js"; import { Timestamp } from "../../util/timestamp.js"; import { ModuleApi } from "../../types/base.js"; import { ConstraintsFilter, CustomDatasourceConfig } from "../../config/types.js"; //#region lib/modules/datasource/types.d.ts interface GetDigestInputConfig { datasource: string; packageName: string; defaultRegistryUrls?: string[]; registryUrls?: string[] | null; registryUrl?: string; lookupName?: string; additionalRegistryUrls?: string[]; currentValue?: string; currentDigest?: string; replacementName?: string; } interface DigestConfig { packageName: string; lookupName?: string; registryUrl?: string; currentValue?: string; currentDigest?: string; } interface GetReleasesConfig { customDatasources?: Record; datasource?: string; packageName: string; registryUrl?: string; currentValue?: string; constraints?: Partial>; constraintsFiltering?: ConstraintsFilter; } interface GetPkgReleasesConfig { customDatasources?: Record; npmrc?: string; defaultRegistryUrls?: string[]; registryUrls?: string[] | null; additionalRegistryUrls?: string[]; datasource: string; packageName: string; currentValue?: string; versioning?: string; extractVersion?: string; versionCompatibility?: string; currentCompatibility?: string; constraints?: Partial>; replacementName?: string; replacementVersion?: string; constraintsFiltering?: ConstraintsFilter; registryStrategy?: RegistryStrategy; } interface Release { changelogContent?: string; changelogUrl?: string; checksumUrl?: string; downloadUrl?: string; gitRef?: string; isDeprecated?: boolean; isStable?: boolean; releaseTimestamp?: Timestamp | null; version: string; /** The original value to which `extractVersion` was applied */ versionOrig?: string; newDigest?: string | null; constraints?: Partial>; dependencies?: Record; devDependencies?: Record; registryUrl?: string; sourceUrl?: string | undefined; sourceDirectory?: string; currentAge?: string; isLatest?: boolean; attestation?: boolean; } interface ReleaseResult { deprecationMessage?: string; isPrivate?: boolean; releases: Release[]; tags?: Record | undefined; changelogContent?: string; changelogUrl?: string; dependencyUrl?: string; homepage?: string | undefined; gitRef?: string; sourceUrl?: string | null; sourceDirectory?: string; registryUrl?: string; replacementName?: string; replacementVersion?: string; lookupName?: string; packageScope?: string; mostRecentTimestamp?: Timestamp; isAbandoned?: boolean; respectLatest?: boolean; } interface PostprocessReleaseConfig { packageName: string; registryUrl: string | null; } type PostprocessReleaseResult = Release | 'reject'; type RegistryStrategy = 'first' | 'hunt' | 'merge'; type SourceUrlSupport = 'package' | 'release' | 'none'; interface DatasourceApi extends ModuleApi { id: string; getDigest?(config: DigestConfig, newValue?: string): Promise; getReleases(config: GetReleasesConfig): Promise; defaultRegistryUrls?: string[] | (() => string[]); defaultVersioning?: string | undefined; defaultConfig?: Record | undefined; /** * Strategy to use when multiple registryUrls are available to the datasource. * - `first`: only the first registryUrl will be tried and others ignored * - `hunt`: registryUrls will be tried in order until one returns a result * - `merge`: all registryUrls will be tried and the results merged if more than one returns a result */ registryStrategy?: RegistryStrategy | undefined; /** * Whether custom registryUrls are allowed. */ customRegistrySupport: boolean; /** * Whether release timestamp can be returned. */ releaseTimestampSupport: boolean; /** * Notes on how release timestamp is determined. */ releaseTimestampNote?: string; /** * Whether sourceURL can be returned. */ sourceUrlSupport: SourceUrlSupport; /** * Notes on how sourceURL is determined. */ sourceUrlNote?: string; /** * Whether to perform centralized caching in the datasource index/wrapper or not. * * - `true`: datasource index wrapper will cache all results (based on registryUrl/packageName) * - **Must be set only if datasource is able to determine and return `isPrivate` flag** * - `false`: centralized caching is not performed, implementation still could do caching internally */ caching?: boolean | undefined; /** * When the candidate for update is formed, this method could be called * to fetch additional information such as `releaseTimestamp`. * * Also, the release could be checked (and potentially rejected) * via some datasource-specific external call. * * In case of reject, the next candidate release is selected, * and `postprocessRelease` is called again. * * Rejection must happen only when the release will lead to downstream error, * e.g. the release turned out to be yanked or doesn't exist for some reason. * * In other cases, the original `Release` parameter should be returned. */ postprocessRelease(config: PostprocessReleaseConfig, release: Release): Promise; } //#endregion export { DatasourceApi, DigestConfig, GetDigestInputConfig, GetPkgReleasesConfig, GetReleasesConfig, PostprocessReleaseConfig, PostprocessReleaseResult, RegistryStrategy, Release, ReleaseResult, SourceUrlSupport }; //# sourceMappingURL=types.d.ts.map