1.2.1 • Published 4 years ago

@gftc/trawler v1.2.1

Weekly downloads
9
License
MIT
Repository
-
Last release
4 years ago

trawler

The trawler library is created to make it easier for seafood supplychain entities to integrate their existing workflow with the tracability data flow.

At its core, trawler defines a human-readable, easy to use csv schema for supplychain entity to convert their existing csv format to. Then using the library (or the microservice provided by gftcms which exposes a ready-to-use deployment of this library and others), the csv can then be converted into GDST compliance EPCIS XML document which can then be safely published to EPCIS datastore and other entities participating in the supplychain.

Documentation

Visit docs/index

Install

npm i -S @gftc/trawler

Usage

The excerpt below is taken from gftcms's consumption of the library.

// Import trawler generator functions:
import {
  createTrawlerXml,
  createBusinessDocumentHeaderXml,
  createEpcClassXml,
  createLocationHeaderXml,
  createObjectEventXml,
  createTransformationEventXml,
  createAggregationEventXml
} from '@gftc/trawler'

// Use the generator to create the xml pieces for each csv form
...
const [
  bdhXml,
  epcClassXml,
  locationXml,
  objectEventXmlList,
  transformationEventXmlList,
  aggregationEventXmlList
] = await Promise.all([
  createBusinessDocumentHeaderXml(businessHeaderCsv.value),
  createEpcClassXml(epcClassCsv.value),
  createLocationHeaderXml(locationCsv.value),
  createObjectEventXml(objectEventCsv.value),
  createTransformationEventXml(transformationEventCsv.value),
  createAggregationEventXml(aggregationEventCsv.value)
])


// Combine the generator's result to create the final EPCIS document 
const result = createTrawlerXml({
  bdhXml,
  epcClassXml,
  locationXml,
  xmlList: [
    ...objectEventXmlList,
    ...transformationEventXmlList,
    ...aggregationEventXmlList
  ]
})
1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago