1.0.5 • Published 5 years ago

@danver97/service-events v1.0.5

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

Service events

Events used by services in TheForkReplica project

Usage

const checkUtility = require('@danver97/service-events');

checkUtility is an object with the following fields.

  • checkByObject: is a function that checks if the provided event satisfy the structure provided as object
  • checkByPath: is a function that checks if the provided event satisfy the structure provided as a path to the json hold by the module
  • paths: a short-hand for the json's paths

checkByObject(obj, event)

If the event doesn't satisfy the requirements described in obj throws an error.

checkByPath(path, event)

If the event doesn't satisfy the requirements described in json under path throws an error.

paths

It's an object the following fields and subfields:

  • reservation
    • RESERVATION_CREATED
    • RESERVATION_CONFIRMED
    • RESERVATION_REJECTED
    • RESERVATION_CANCELLED
    • RESTAURANT_RESERVATIONS_CREATED
    • RESERVATION_ADDED
    • RESERVATION_REMOVED
  • restaurant_catalog
    • RESTAURANT_CREATED
    • TABLE_ADDED
    • TABLE_REMOVED
    • TABLES_ADDED
    • TABLES_REMOVED
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago