Accepts the full bpg data shape (flat, ~250 optional fields, values in
the JSON model types). Returns the normalized bit JSON. Throws
No config found for bit: X for unknown bit types, as bpg does.
NOTE (documented divergences from bpg):
the return value is bit JSON, not bpg's internal AST node model;
resourceType (an inference hint in bpg) is not carried into the
JSON — the attached resource object is authoritative.
resources follows bpg's JsonGenerator routing: on a bit whose config
maps a repeatable resource tag group onto a collection key (e.g.
images / logos — see the generated RESOURCE_COLLECTION_KEYS), the
matching-type entries land under that key; on every other bit the first
entry becomes the canonical single resource (as bpg: "if there is
more than one resource, use the first one").
Build a bit (bpg-compatible
buildBit).Accepts the full bpg data shape (flat, ~250 optional fields, values in the JSON model types). Returns the normalized bit JSON. Throws
No config found for bit: Xfor unknown bit types, as bpg does.NOTE (documented divergences from bpg):
resourceType(an inference hint in bpg) is not carried into the JSON — the attachedresourceobject is authoritative.resourcesfollows bpg's JsonGenerator routing: on a bit whose config maps a repeatable resource tag group onto a collection key (e.g.images/logos— see the generated RESOURCE_COLLECTION_KEYS), the matching-type entries land under that key; on every other bit the first entry becomes the canonical singleresource(as bpg: "if there is more than one resource, use the first one").