These are the minimum number of repos that must be updated on contract changes committed to this library:
NodeJS library defining the events that happen within the Fusion backend
The documentation is automatically generated using TypeDoc from the Typescript definitions contained within this project.
All events within the PHDV system that can be subscribed to through SNS are documented here. The events fall are grouped by system:
As well as documentation of the events, the @pizza-hut/lib-event-definitions
npm package also
contains a range of helpful utilities to aid in developing Javascript systems to work with these events..
yard add @pizza-hut/lib-event-definitions
The validateEvent method validates an object against the schema for an event.
import { validateEvent, EventNames } from '@pizza-hut/lib-event-definitions';
try {
const payload = {};
const validatedPayload = validateEvent(EventNames.orderSubmitted, payload, {
stripUnknown: true
});
} catch (err) {
console.log('Schema validation failed');
}
The generateExample method will return an object that matches the schema of the described topic, however the content of that object will be mostly random.
import { generateExample } from '@pizza-hut/lib-event-definitions';
const randomExampleObject = generateExample('order-submitted');
Generated using TypeDoc