API reference · Browser and Node
@toip-tools/mandates
76 public exports.
import { type Action, actionHash, type Approval } from "@toip-tools/mandates";
Functions
-
actionHashSHA-256 of an action's JCS form.
-
approveSigns an approval of `action` under `chain`, valid from now for `ttlSeconds`.
-
defaultEngineThe engine with the bundled policy, loaded once.
-
delegateIssues a child of the chain's leaf, signed by the leaf's subject.
-
denyApproval -
explainOne sentence per reason, then one for the outcome.
-
getProfile -
grantApproval -
hasSentence -
httpStatusResolverFetches signed lists over HTTP: GET `${base}/${encodeURIComponent(did)}` for list "did#…", as the
-
isPatternExact, or ending in ".*" or "/*", with no other "*".
-
isRevokedWhether `list` revokes `mandate`.
-
issueMandateSigns a root mandate.
-
isUnitsA decimal integer string from 0 to 2^53 − 1.
-
jcsHashSHA-256 of the JCS form of any JSON value, as "sha256:<hex>".
-
linkFacts -
mandateHashSHA-256 of a mandate's JCS form, proof included.
-
narrowsWhether `child` narrows `parent`, with the bundled policy.
-
notifyRevoked -
presentSigns a presentation by `holder`, the leaf's subject.
-
registerProfileAdds an action vocabulary.
-
requestApproval -
sendMandate -
serveMandateTasksMounts a handler for each callback given.
-
staticStatusResolverLists already in hand, e.g.
-
verifyApprovalChecks an approval for `action` under `chain` (§9.2).
Classes
-
MandateEngine -
SpendLedger -
StatusRegistryOne signed revocation list per issuer, with id "<issuer DID>#status".
Interfaces
-
Action -
Approval -
ApprovalDenyPayload -
ApprovalGrantPayload -
ApprovalRequestPayload -
DecideInput -
Decision -
DelegateOptions -
ExplainOptions -
IssuePayload -
LinkFactsOne link as the policy sees it: verified facts, no signatures.
-
MandateSubject -
MandateTaskHandlers -
PolicyInputThe policy's input (§8.5).
-
PolicyOutput -
Presentation -
ProfileAn action vocabulary.
-
Reason -
Requirements -
RevokedPayload -
SpendEntry -
SpendLedgerState -
SpendStatement -
StatusEntry -
StatusRegistryState -
StatusResolver
Types
-
AttrValue -
Constraint -
IssueOptions -
Mandate -
Op -
Outcome -
Period -
SpecPolicy -
UnitsA decimal integer string, at most 2^53 − 1.
Constants
-
APPROVAL_DENYApprover → delegate.
-
APPROVAL_GRANTApprover → delegate.
-
APPROVAL_REQUESTDelegate → approver.
-
CAPTURE_1Owner-to-device delegation for projects/capture (agents design §16.3).
-
DEFAULT_REQUIREMENTS -
MANDATE_ISSUEDelegator → delegate: a new mandate, with the chain above it.
-
MANDATE_REVOKEDDelegator → delegate: a revocation notice, with the newly signed list.
-
OPS -
PERIODS -
POLICY_ID -
REASON_CODESEvery reason code this library produces.
-
SETTLE_1The Settle action vocabulary (agents design §7.4).
Signatures and source documentation are generated from packages/mandates/src/index.ts.