DueByRule
A rest that must start within a number of periods of the last one: “a weekly rest by the end of six operator days after the previous one”.
import type { DueByRule } from "@northguild/gmt";Members
Section titled “Members”| Member | Type | Description |
|---|---|---|
label | string | The caller’s name for the rule. The report is keyed by it; labels must be unique. |
severity? | "violation" | "advisory" (DutySeverity) | Whether a failure is a violation or an advisory. |
kind | "dueBy" | Selects this rule kind. |
event | object | The rest that is due. |
event.statuses | S[] | The statuses the rest is made of. |
event.minimum | string | How long the rest must be, a positive ISO 8601 duration of exact time. |
within | object (Period) | How soon the rest is due. |
within.periods | number | How many periods, an integer from 1 to 10,000. Times a count period, it is 10,000 at most. |
within.period | Period | The period counted: an elapsed length, or one local period ({ operatorDays: 1 }). |
reset? | Reset<S> (Reset) | Another rest that also starts the clock. |
Definition
Section titled “Definition”type DueByRule<S extends string = string> = { /** The caller's name for the rule. The report is keyed by it; labels must be unique. */ label: string; /** * Whether a failure is a violation or an advisory. * * @defaultValue `"violation"`. */ severity?: DutySeverity; /** Selects this rule kind. */ kind: "dueBy"; /** The rest that is due. */ event: { /** The statuses the rest is made of. */ statuses: S[]; /** How long the rest must be, a positive ISO 8601 duration of exact time. */ minimum: string; }; /** How soon the rest is due. */ within: { /** * How many periods, an integer from 1 to 10,000. Times a count `period`, it is 10,000 at * most. */ periods: number; /** The period counted: an `elapsed` length, or one local period (`{ operatorDays: 1 }`). */ period: Period; }; /** * Another rest that also starts the clock. * * @defaultValue None. Only the event starts the clock. */ reset?: Reset<S>;};