@tracepass/dpp-epcis
v0.1.4
Published
Map Digital Product Passport data to GS1 EPCIS 2.0 events, with a CBV 2.0 vocabulary extended for steel production steps. Pure functions, no third-party runtime dependencies.
Maintainers
Readme
@tracepass/dpp-epcis
Map Digital Product Passport events to GS1 EPCIS 2.0, with a CBV vocabulary extended for steel. No third-party runtime dependencies.
Part of tracepass-open · Maintained by TracePass
Build conformant GS1 EPCIS 2.0 events from passport data — commissioning, service, ownership transfer, and supply-chain transformation — as pure functions over plain objects.
npm install @tracepass/dpp-epcisimport { buildCommissioningEvent, validateEpcisDocument, EPCIS_JSONLD_CONTEXT } from "@tracepass/dpp-epcis";
const event = buildCommissioningEvent(
new Date("2026-01-01T00:00:00Z"), // publishedAt
"urn:epc:id:sgtin:0952012.345678.SN1", // product EPC
"passport-1",
"5012345678900", // manufacturer GLN
);
const doc = {
"@context": EPCIS_JSONLD_CONTEXT,
type: "EPCISDocument",
schemaVersion: "2.0",
creationDate: new Date().toISOString(),
epcisBody: { eventList: [event] },
};
validateEpcisDocument(doc).valid; // trueThe event carries a CBV business step (https://ref.gs1.org/cbv/BizStep-commissioning)
and a GS1 location reference (https://id.gs1.org/414/5012345678900).
Extending CBV for steel
Core Business Vocabulary 2.0 has no business steps for several steel production stages. Rather than misuse an unrelated step, this package coins them under a vendor namespace — the extension pattern GS1 sanctions for exactly this case:
https://tracepass.eu/voc/cbv/bizstep/smelting
https://tracepass.eu/voc/cbv/bizstep/casting
https://tracepass.eu/voc/cbv/bizstep/rollingStandard steps are used wherever one exists. validateEpcisDocument is a structural
check — envelope, event type, event time — not a full JSON Schema validation.
