attestationFields
What an attestation row says of its record: taken from the record as its writer's repository signs it.
import type { Attestation } from "#codebase/tcmts/records"; import type { RegistryAttestation } from "#codebase/tcmts/registry"; export const attestationFields = ( a: Attestation, ): Pick< RegistryAttestation, "kind" | "namespace" | "release" | "author" | "body" | "severity" | "fixedIn" | "createdAt" > => ({ kind: a.kind, namespace: a.subject.namespace, ...(a.subject.release ? { release: a.subject.release } : {}), ...(a.subject.author ? { author: a.subject.author } : {}), body: a.body, ...(a.severity ? { severity: a.severity } : {}), ...(a.fixedIn ? { fixedIn: a.fixedIn } : {}), createdAt: a.createdAt, })