IF Commons GitHub

governance/kinds

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-archon-governance FR-002

The kinds of resource a requirement can be about, as data: each with a sentence, the classes of subject it applies to and whether it can destroy. A dialect says which of them it can carry out, and a fleet that needs a kind that is not here adds it to its own catalogue.

import { kindOf } from "./kinds.ts";
kindOf("package")?.subjects; // ["machine", "workstation"]

Source: commons/archon/src/governance/kinds.ts

3 of 5 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

SubjectClasstypeno test imports it
type SubjectClass = "machine" | "device" | "workstation" | "cloud-account";

What an order can be for: a machine, a device, a workstation or a cloud account.

SUBJECT_CLASSESconst
const SUBJECT_CLASSES: readonly SubjectClass[]

Every class of subject.

Imported by 8 tests of the run (8 passed, 0 failed): the library's results

KindSpectypeno test imports it
type KindSpec = {
  readonly id: ResourceKindId;
  readonly summary: string;
  readonly subjects: readonly SubjectClass[];
  readonly canDestroy: boolean;
};

A kind of resource.

KINDSconst
const KINDS: readonly KindSpec[]

The catalogue.

Imported by 8 tests of the run (8 passed, 0 failed): the library's results

kindOffunction
function kindOf(id: string, catalogue?: readonly KindSpec[]): KindSpec | undefined

The kind of the catalogue with this id, if there is one.

Imported by 8 tests of the run (8 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.