IF Commons GitHub

logical/records/trace-file

Written to: 1 requirement: 0 proved, 0 partly, 0 failing, 1 with no test recorded. 0004-planning-sources FR-001

The files of a store that are not events: a trace of an item in a source (the content last taken, the base of a three-way merge) and an entry of the outbox (a patch no source could apply, and why), in JSON5 with the order of keys of RFC 8785 (0037-planning FR-033, FR-038). Decoding is total: a text that is not one of them is an error value.

import { decodeTrace, encodeTrace } from "./trace-file.ts";
// decodeTrace(encodeTrace(trace)) is the trace

Source: commons/planning/src/logical/records/trace-file.ts

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

records.TRACE_SCHEMAconstno test imports it
const TRACE_SCHEMA: "planning/trace@1"

The schema of a trace file.

records.OUTBOX_SCHEMAconstno test imports it
const OUTBOX_SCHEMA: "planning/outbox@1"

The schema of an outbox file.

records.observedToJsonfunctionno test imports it
function observedToJson(o: ObservedItem): Json

The JSON of an observed item: what an opening holds, its state and the ids it was read with. The history a place keeps is not kept in a trace.

records.observedOfJsonfunctionno test imports it
function observedOfJson(j: Json | undefined): Result<ObservedItem, CodecProblem>

An observed item from its JSON, or why it is not one.

records.encodeTracefunctionno test imports it
function encodeTrace(t: Trace): string

The text of a trace's file.

records.decodeTracefunctionno test imports it
function decodeTrace(text: string): Result<Trace, CodecProblem>

A trace from the text of its file, or why it is not one.

records.encodeOutboxfunctionno test imports it
function encodeOutbox(e: OutboxEntry): string

The text of an outbox file.

records.decodeOutboxfunctionno test imports it
function decodeOutbox(text: string): Result<OutboxEntry, CodecProblem>

An outbox entry from the text of its file, or why it is not one.

TRACE_SCHEMAconstno test imports it
const TRACE_SCHEMA: "planning/trace@1"

The schema of a trace file.

OUTBOX_SCHEMAconstno test imports it
const OUTBOX_SCHEMA: "planning/outbox@1"

The schema of an outbox file.

observedToJsonfunctionno test imports it
function observedToJson(o: ObservedItem): Json

The JSON of an observed item: what an opening holds, its state and the ids it was read with. The history a place keeps is not kept in a trace.

observedOfJsonfunctionno test imports it
function observedOfJson(j: Json | undefined): Result<ObservedItem, CodecProblem>

An observed item from its JSON, or why it is not one.

encodeTracefunctionno test imports it
function encodeTrace(t: Trace): string

The text of a trace's file.

decodeTracefunctionno test imports it
function decodeTrace(text: string): Result<Trace, CodecProblem>

A trace from the text of its file, or why it is not one.

encodeOutboxfunctionno test imports it
function encodeOutbox(e: OutboxEntry): string

The text of an outbox file.

decodeOutboxfunctionno test imports it
function decodeOutbox(text: string): Result<OutboxEntry, CodecProblem>

An outbox entry from the text of its file, or why it is not one.

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