IF Commons GitHub

sql/cli/config

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0046-arcactl FR-002

The configuration of arcactl and the models it knows (commons data 0046-arcactl FR-002): arca.config.ts is a TypeScript file that default-exports defineArca({...}), so the compiler checks it, and holds no secret. The arca family is the party model, the tenancy model and the identity models; the issues model is available to it but is not of the family. A project names the models it wants and the modules they require come with them.

Source: commons/data/sql/cli/config.ts

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

Arcainterfaceno test imports it
interface Arca

The configuration with every default filled.

MemberTypeWhat it is
schemastring
modelsreadonly ("arcaParty" | "arcaTenancy" | "contract" | "flow" | "identity" | "identityAbac" | "identityAccess" | "identityAgent" | "identityDelegation" | "identityDevice" | "identityMachine" | "identityPki" | "identityRebac" | "issues" | "meaning" | "operations" | "proof")[]
invariantsboolean
guardboolean
sealboolean
unmanaged"drop" | "hold"
ledgerTablestring
ArcaConfiginterfaceno test imports it
interface ArcaConfig

What a project says of its arca database.

MemberTypeWhat it is
schema?stringThe schema the tables are in; arca by default.
modelsreadonly ("arcaParty" | "arcaTenancy" | "contract" | "flow" | "identity" | "identityAbac" | "identityAccess" | "identityAgent" | "identityDelegation" | "identityDevice" | "identityMachine" | "identityPki" | "identityRebac" | "issues" | "meaning" | "operations" | "proof")[]The models wanted, by name; what they require comes with them.
invariants?booleanWhether the invariants are in the database (append-only, chains, status moves); on by default.
guard?booleanWhether the guard against weakening them is expected (PostgreSQL's event triggers); on by default.
seal?booleanWhether the scope of row security is sealed (accessSource({ seal })); off by default.
unmanaged?"drop" | "hold"What to do with what is in the database and not in the model.
ledgerTable?stringThe ledger's table; lifecycle_ledger by default.
allModulesconst
const allModules: () => readonly Module[]

Every model of the family, as a module.

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

ConfigErrortypeno test imports it
type ConfigError = { readonly kind: "model"; readonly name: string } | { readonly kind: "schema"; readonly name: string } | { readonly kind: "compose"; readonly errors: readonly ComposeError[] } | { readonly kind: "project"; readonly why: string };

What is wrong with a configuration.

defineArcaconst
const defineArca: (config: ArcaConfig) => ArcaConfig

The configuration, as the compiler checks it.

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

loadConfigfunctionno test imports it
function loadConfig(path: string): Promise<Result<ArcaConfig, string>>

Reads arca.config.ts: the file's default export, which defineArca made.

ModelNametypeno test imports it
type ModelName = (typeof modelNames)[number];

The name of a model that a configuration may ask for.

modelNamesconst
const modelNames: readonly ["arcaParty", "arcaTenancy", "identity", "identityAccess", "identityAbac", "identityRebac", "identityPki", "identityMachine", "identityDevice", "identityDelegation", "identityAgent", "issues", "flow", "meaning", "contract", "operations", "proof"]

The models of the arca family, and the issues model.

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

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