RequirementIdtypetype RequirementId = Brand<string, "archon requirement id">;The identity of a requirement, stable for the life of the requirement.
The names of Archon, each a branded text made only by the function that validates it: a requirement, a kind of resource, a subject (a host name), a dialect and a reference to a secret (never the secret itself).
import { parseSubjectName } from "./ids.ts";
parseSubjectName("web-01.example.test").kind; // "ok"
parseSubjectName("Web 01").kind; // "err"RequirementIdtypetype RequirementId = Brand<string, "archon requirement id">;The identity of a requirement, stable for the life of the requirement.
ResourceKindIdtypeno test imports ittype ResourceKindId = Brand<string, "archon resource kind">;The identity of a kind of resource.
SubjectNametypeno test imports ittype SubjectName = Brand<string, "archon subject name">;The name of a subject: a host name.
DialectIdtypeno test imports ittype DialectId = Brand<string, "archon dialect id">;The identity of a dialect.
SecretReftypeno test imports ittype SecretRef = Brand<string, "archon secret reference">;A reference to a secret kept in a store: secret:<store>/<name>.
parseRequirementIdconstconst parseRequirementId: (text: string) => Result<RequirementId, string>A requirement id from text: lower case words of letters and digits joined by dots or hyphens, starting with a letter, at most 100 characters.
parseKindIdconstconst parseKindId: (text: string) => Result<ResourceKindId, string>A kind id from text: lower case words joined by hyphens, starting with a letter.
parseSubjectNameconstconst parseSubjectName: (text: string) => Result<SubjectName, string>A subject name from text: a host name of labels of lower case letters, digits and hyphens joined by dots, at most 253 characters.
parseDialectIdconstconst parseDialectId: (text: string) => Result<DialectId, string>A dialect id from text: lower case words joined by hyphens, starting with a letter.
parseSecretRefconstconst parseSecretRef: (text: string) => Result<SecretRef, string>A secret reference from text: secret:<store>/<name>.
isSecretReffunctionno test imports itfunction isSecretRef(text: string): booleanWhether a text is a secret reference.