What a plan needs before it may be carried out, by the assurance of the fleet: a confirmation typed by a person for each destructive entry, a second approver where the control asks for one, and the digest of the plan named by the approval where the control requires it. destructiveGate lets a plan through only when all of it is given.
import { approvalsNeeded } from"./approvals.ts";
// approvalsNeeded(plan, assurance).typedConfirmations lists the requirement ids a person must type
typeApprovalsNeeded= {
/** The requirement ids a person must type, one for each destructive entry that changes something. */readonlytypedConfirmations:readonlyRequirementId[];
readonlysecondApprover:boolean;
readonlyplanDigestRequired:boolean;
};
typeGiven= {
/** The texts a person typed to confirm. */readonlyconfirmations:readonlystring[];
readonlysecondApprover:boolean;
/** The digest the approval names, if it names one. */readonlyplanDigest:string|undefined;
};
Whether a plan may be carried out: each destructive entry is confirmed by its exact id, a second approver is present where one is needed, and the digest the approval names is the digest of this plan where one is required. digest is the digest of the plan as it is now.