Skip to content
PACKAGES

withBlueprintProvenance()

Attach caller-supplied provenance data to a blueprint.

import { withBlueprintProvenance } from "@graphrefly/ts/graph";
function withBlueprintProvenance(
blueprint: GraphBlueprint,
provenance: GraphBlueprintProvenance,
): GraphBlueprint
ParameterTypeDescription
blueprintGraphBlueprintBlueprint to augment.
provenanceGraphBlueprintProvenanceStrict JSON provenance payload.

The blueprint with normalized provenance attached.

import {
GRAPH_BLUEPRINT_VERSION,
normalizeTopology,
withBlueprintProvenance,
} from "@graphrefly/ts/graph";
const blueprint = {
version: GRAPH_BLUEPRINT_VERSION,
topology: normalizeTopology({ nodes: [], edges: [] }),
};
withBlueprintProvenance(blueprint, { source: "snapshot" });

packages/ts/src/graph/blueprint.ts