import * as DateTime from "effect/DateTime"; import * as Duration from "effect/Duration"; import * as Effect from "effect/Effect"; import * as Option from "effect/Option"; import { type ReleaseAgeExcludePattern } from "../extensions/fqn-pattern.js"; import type { ExtensionFqnParts } from "../extensions/common.js"; import type { VersionEntry } from "./schema.js"; export interface ScopedReleaseAgeExcludePattern { readonly pattern: ReleaseAgeExcludePattern; readonly scope: "project" | "user"; } export interface ReleaseAgeEvaluation { readonly minimumReleaseAge: Duration.Duration; readonly evaluatedAt: DateTime.Utc; readonly mode: "enforce" | "ignore"; readonly exclude?: ReadonlyArray; readonly grantedExemption?: ReleaseAgeExemption; } export type ReleaseAgeExemption = { readonly bypassCause: "exclude"; readonly exemptionScope: "project" | "user"; } | { readonly bypassCause: "ignore-flag"; }; export declare const releaseAgeExemptionForIdentity: (evaluation: ReleaseAgeEvaluation, identity: ExtensionFqnParts) => ReleaseAgeExemption | undefined; export interface ReleaseAgeEvidence { readonly version: string; readonly publishedAt: string; readonly eligibleAt: string; readonly minimumReleaseAgeSeconds: number; } export interface ReleaseAgeRecordBase { readonly reason: "minimum-release-age"; readonly target: string; readonly dependencyPath: ReadonlyArray; readonly requestedRange?: string; readonly currentVersion?: string; readonly selectedVersion?: string; readonly candidateVersion: string; readonly publishedAt: string; readonly eligibleAt: string; readonly minimumReleaseAgeSeconds: number; } export type ReleaseAgeHoldbackRecord = ReleaseAgeRecordBase; export type ReleaseAgeBypassRecord = ReleaseAgeRecordBase & ({ readonly bypassCause: "exclude"; readonly exemptionScope: "project" | "user"; } | { readonly bypassCause: "ignore-flag"; }); export type ReleaseAgeRecord = ReleaseAgeHoldbackRecord | ReleaseAgeBypassRecord; export interface ReleaseAgeOperationEvidence { readonly evaluatedAt: string; readonly holdbacks: ReadonlyArray; readonly bypasses: ReadonlyArray; } /** Deduplicate and order operation evidence independently from concurrent resolution order. */ export declare const normalizeReleaseAgeRecords: (records: ReadonlyArray) => ReadonlyArray; export declare const DEFAULT_MINIMUM_RELEASE_AGE = "24h"; export declare const DEFAULT_MINIMUM_RELEASE_AGE_DURATION: Duration.Duration; export declare const parseMinimumReleaseAge: (value: string) => Option.Option; /** * Render a release-age window in the compact grammar the setting accepts, so * output names the policy in the same units the reader would configure. * * Days are used only from two days up: the default window is written `24h`, * and reporting it as `1d` would not match the setting the reader would edit. * Falls back to whole seconds when the window is not a clean larger unit. */ export declare const formatMinimumReleaseAgeSeconds: (seconds: number) => string; export declare const isVersionEntryMature: (entry: VersionEntry, minimumAge: Duration.Duration) => Effect.Effect; export declare const isVersionEntryEligibleAt: (entry: VersionEntry, evaluation: ReleaseAgeEvaluation) => boolean; export declare const releaseAgeEvidence: (entry: VersionEntry, evaluation: ReleaseAgeEvaluation) => ReleaseAgeEvidence; export declare const filterMatureVersions: (versions: ReadonlyArray, minimumAge: Duration.Duration) => Effect.Effect>; export declare const releaseAgeHoldbackWarning: (args: { readonly fqn: string; readonly selectedVersion: string; readonly heldVersion: string; readonly minimumReleaseAge: string; }) => string; //# sourceMappingURL=release-age-policy.d.ts.map