interface · Browser and Node

# MandateTaskHandlers

`@toip-tools/mandates` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/mandates/src/tasks.ts#L53)

Import:

```ts
import { type MandateTaskHandlers } from "@toip-tools/mandates";
```

## Declaration

interface:

```ts
interface MandateTaskHandlers {
  clock: Clock;
  /** Default: the bundled policy. */
  engine?: MandateEngine;
  /** With a resolver, an issued mandate's status lists are checked too. */
  status?: StatusResolver;
  /** A mandate for this endpoint whose whole chain verifies and narrows. */
  onIssue?(m: IssuePayload & Sender): Maybe;
  /** A list signed by the sender. Check your mandate against it with isRevoked. */
  onRevoked?(n: RevokedPayload & Sender): Maybe;
  /** A request from the leaf of a chain that verifies, with an action matching its hash. */
  onApprovalRequest?(r: ApprovalRequestPayload & Sender): Maybe;
  /** An approval signed by the sender. Pass it to decide, which checks the rest. */
  onApprovalGrant?(g: ApprovalGrantPayload & Sender): Maybe;
  onApprovalDeny?(d: ApprovalDenyPayload & Sender): Maybe;
  /** A message that failed its checks, and why. */
  onRejected?(r: { type: string; sender: string; reasons: Reason[] }): Maybe;
}
```

## Properties

**`clock` (required)**

`Clock`

**`engine` (optional)**

`MandateEngine | undefined`

Default: the bundled policy.

**`status` (optional)**

`StatusResolver | undefined`

With a resolver, an issued mandate's status lists are checked too.

**`onIssue` (optional)**

`((m: IssuePayload & Sender) => Maybe) | undefined`

A mandate for this endpoint whose whole chain verifies and narrows.

**`onRevoked` (optional)**

`((n: RevokedPayload & Sender) => Maybe) | undefined`

A list signed by the sender. Check your mandate against it with isRevoked.

**`onApprovalRequest` (optional)**

`((r: ApprovalRequestPayload & Sender) => Maybe) | undefined`

A request from the leaf of a chain that verifies, with an action matching its hash.

**`onApprovalGrant` (optional)**

`((g: ApprovalGrantPayload & Sender) => Maybe) | undefined`

An approval signed by the sender. Pass it to decide, which checks the rest.

**`onApprovalDeny` (optional)**

`((d: ApprovalDenyPayload & Sender) => Maybe) | undefined`

**`onRejected` (optional)**

`((r: { type: string; sender: string; reasons: Reason[]; }) => Maybe) | undefined`

A message that failed its checks, and why.

[Usage guide](https://toip.tools/toolkit/mandates/#usage) · [Error handling](https://toip.tools/toolkit/mandates/#errors) · [All exports](https://toip.tools/toolkit/mandates/api/)

---

This is the Markdown version of https://toip.tools/toolkit/mandates/api/MandateTaskHandlers/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
