Files
Portfolio/scripts/deploy/lib/release-transaction.d.mts

80 lines
2.3 KiB
TypeScript

export interface ProtectedControlState {
schema: "portfolio-release-control-state/v1";
currentManifestDigest: string | null;
currentReleaseId: string | null;
publisherFence: number;
latestLedgerHeadHash: string;
latestLedgerRevision: number;
releaseTrustPolicyDigest: string;
activeTransaction: null | Record<string, unknown>;
}
export interface ProductionPrepareInput {
root: string;
archivePath: string;
transactionId: string;
smokeCommand: string;
}
export interface ProductionActivateInput {
root: string;
transactionId: string;
expectedCurrentManifestDigest: string | null;
expectedFence: number;
}
export interface ProductionRollbackInput
extends ProductionPrepareInput, ProductionActivateInput {
targetReleaseId: string;
}
export interface TestTransactionInput {
root: string;
archivePath: string;
transactionId: string;
testOnlyVerification: {
trustPolicyPath: string;
verifySignedReleaseEnvelope: (input: any) => any;
};
testClock?: () => string;
smokeCheck?: (input: {
releaseDir: string;
manifestDigest: string;
}) => Promise<Uint8Array>;
smokeCommand?: string;
expectedCurrentManifestDigest?: string | null;
expectedFence?: number;
crashPoint?: "before-swap" | "after-swap";
testPreparationCrashPoint?:
| "after-intent"
| "after-extract"
| "after-immutable"
| "after-release-rename"
| "after-receipt";
testBeforeCommit?: () => Promise<void>;
testBeforePointerSwap?: () => Promise<void>;
targetReleaseId?: string;
lock?: boolean;
}
export function readControlState(root: string): Promise<ProtectedControlState>;
export function prepareRelease(
input: ProductionPrepareInput,
): Promise<Record<string, unknown>>;
export function prepareReleaseForTest(
input: TestTransactionInput,
): Promise<Record<string, unknown>>;
export function activateRelease(
input: ProductionActivateInput,
): Promise<Record<string, any>>;
export function activateReleaseForTest(
input: TestTransactionInput,
): Promise<Record<string, any>>;
export function rollbackRelease(
input: ProductionRollbackInput,
): Promise<Record<string, any>>;
export function rollbackReleaseForTest(
input: TestTransactionInput,
): Promise<Record<string, any>>;
export function cleanupOrphanStages(root: string): Promise<string[]>;