toip.tools

interface · Browser and Node

PolicyInput

The policy's input (§8.5). Logged with a decision, it lets anyone re-run it with evaluate.

@toip-tools/mandatesView source
TypeScriptImport
import { type PolicyInput } from "@toip-tools/mandates";

Declaration

TypeScriptinterface
interface PolicyInput {
  nowS: number;
  action: Pick<Action, "type" | "attrs"> & Partial<Action>;
  actionHash: string;
  chain: LinkFacts[];
  /** Reasons from steps 1 to 8, and presentation problems. */
  structural: Reason[];
  /** Problems with approvals; those approvals are left out of `approvals`. */
  approvalProblems: Reason[];
  state: { spent: Record<string, Partial<Record<Period, Units>>> };
  /** Approvals whose signatures and bindings TypeScript checked. */
  approvals: { id: string; approverLink: number; actionHash: string; validUntilS: number; used: boolean }[];
  requirements: Omit<Requirements, "maxStatusAgeSeconds">;
  facts: { rootCredentials: string[]; passport?: { issuer: string; subject: string } | null };
  options?: { skipNarrowing?: boolean };
}

Properties

nowSrequired
number
actionrequired
Pick<Action, "attrs" | "type"> & Partial<Action>
actionHashrequired
string
chainrequired
LinkFacts[]
structuralrequired
Reason[]

Reasons from steps 1 to 8, and presentation problems.

approvalProblemsrequired
Reason[]

Problems with approvals; those approvals are left out of approvals.

staterequired
{ spent: Record<string, Partial<Record<Period, Units>>>; }
approvalsrequired
{ id: string; approverLink: number; actionHash: string; validUntilS: number; used: boolean; }[]

Approvals whose signatures and bindings TypeScript checked.

requirementsrequired
Omit<Requirements, "maxStatusAgeSeconds">
factsrequired
{ rootCredentials: string[]; passport?: { issuer: string; subject: string; } | null; }
optionsoptional
{ skipNarrowing?: boolean; } | undefined