governance.ItemIdtypeno test imports ittype ItemId = Brand<string, "plan item id">;The id of an item: a UUID version 7. Made only by parseItemId, or by the clock.
The ids of Planning: an item id and an event id are each a UUID version 7 as 36 lower case characters (RFC 9562 section 5.7), branded and made only by a smart constructor that returns a Result (0037-planning FR-007). The syntax is the one of the version id of AnyFS, which makes them with its hybrid clock (the logical layer mints them); an id of another scheme is an external id, a source's name and a value, kept as the source named it and never written into the wording of an id (FR-044).
import { parseItemId } from "./ids.ts";
parseItemId("018f3a6e-7c00-7000-8123-456789abcdef"); // { kind: "ok", value: "018f3a6e-7c00-7000-8123-456789abcdef" }governance.ItemIdtypeno test imports ittype ItemId = Brand<string, "plan item id">;The id of an item: a UUID version 7. Made only by parseItemId, or by the clock.
governance.EventIdtypeno test imports ittype EventId = Brand<string, "plan event id">;The id of an event: a UUID version 7. Made only by parseEventId, or by the clock.
governance.IdProblemtypeno test imports ittype IdProblem =
| { readonly kind: "not-uuid-v7"; readonly what: "item id" | "event id"; readonly text: string }
| { readonly kind: "bad-external-id"; readonly message: string };An id that is not one.
governance.parseItemIdfunctionno test imports itfunction parseItemId(text: string): Result<ItemId, IdProblem>An item id from text, or why it is not one.
governance.parseEventIdfunctionno test imports itfunction parseEventId(text: string): Result<EventId, IdProblem>An event id from text, or why it is not one.
governance.idTimefunctionno test imports itfunction idTime(id: EventId | ItemId): IdTimeThe time an id holds: the milliseconds and the counter that orders ids of one millisecond.
governance.ExternalIdtypeno test imports ittype ExternalId = { readonly source: string; readonly value: string };The id an item or an event has in the place it was read from, named by that place: the source's name and the value, as the source wrote it.
governance.externalIdfunctionno test imports itfunction externalId(source: string, value: string): Result<ExternalId, IdProblem>An external id, or why the two texts are not one: each is non-empty, with no control character, and the source's name is at most 64 characters and the value at most 256.
ItemIdtypeno test imports ittype ItemId = Brand<string, "plan item id">;The id of an item: a UUID version 7. Made only by parseItemId, or by the clock.
EventIdtypeno test imports ittype EventId = Brand<string, "plan event id">;The id of an event: a UUID version 7. Made only by parseEventId, or by the clock.
IdProblemtypeno test imports ittype IdProblem =
| { readonly kind: "not-uuid-v7"; readonly what: "item id" | "event id"; readonly text: string }
| { readonly kind: "bad-external-id"; readonly message: string };An id that is not one.
parseItemIdfunctionno test imports itfunction parseItemId(text: string): Result<ItemId, IdProblem>An item id from text, or why it is not one.
parseEventIdfunctionno test imports itfunction parseEventId(text: string): Result<EventId, IdProblem>An event id from text, or why it is not one.
idTimefunctionno test imports itfunction idTime(id: EventId | ItemId): IdTimeThe time an id holds: the milliseconds and the counter that orders ids of one millisecond.
ExternalIdtypeno test imports ittype ExternalId = { readonly source: string; readonly value: string };The id an item or an event has in the place it was read from, named by that place: the source's name and the value, as the source wrote it.
externalIdfunctionno test imports itfunction externalId(source: string, value: string): Result<ExternalId, IdProblem>An external id, or why the two texts are not one: each is non-empty, with no control character, and the source's name is at most 64 characters and the value at most 256.