@eventcatalog/sdk
EventCatalog SDK
The EventCatalog SDK provides methods to interact with domains, services, and messages.
Installation
npm install @eventcatalog/sdk
Usage
import utils from '@eventcatalog/sdk';
const { getEvent } = utils(PATH_TO_CATALOG);
// Get an event by the id
const event = getEvent('event-name');
// Get an event by the id and it's version
const event = getEvent('event-name', '0.3.4');
Functions
| Function | Description |
|---|---|
| addDataStoreToService | Add a data store to a service by it's id. |
| addEntityToDomain | Add an entity to a domain by its id. Optionally specify a version to add the entity to a specific version of the domain. |
| addEntityToService | Add an entity to a service by its id. |
| addFileToCommand | Add a file to a command by it's id. |
| addFileToDataStore | Add a file to a data store (e.g. database, cache, etc.) by it's id. |
| addFileToDomain | Add a file to a domain by it's id. |
| addFileToEvent | Add a file to an event by it's id. |
| addFileToQuery | Add a file to a query by it's id. |
| addFileToService | Add a file to a service by it's id. |
| addMessageToChannel | Add an event/command/query to a channel by it's id. |
| addMessageToService | Add an event/command to a service by it's id. |
| addSchemaToCommand | Add a schema to a command by it's id. |
| addSchemaToEvent | Add a schema to an event by it's id. |
| addSchemaToQuery | Add a schema to a query by it's id. |
| addServiceToDomain | Add a service to a domain by it's id. |
| addSubDomainToDomain | Add a subdomain to a domain by it's id. Optionally specify a version to add the subdomain to a specific version of the domain. |
| addUbiquitousLanguageToDomain | Adds a ubiquitous language dictionary to a domain. |
| channelHasVersion | Check to see if the catalog has a version for the given channel. |
| commandHasVersion | Check to see if the catalog has a version for the given command. |
| dataStoreHasVersion | Check to see if the catalog has a version for the given data store (e.g. database, cache, etc.). |
| domainHasVersion | Check to see if the catalog has a version for the given domain. |
| dumpCatalog | Dumps the catalog to a JSON file. |
| entityHasVersion | Check to see if the catalog has a version for the given entity. |
| eventHasVersion | Check to see if the catalog has a version for the given event. |
| getChannel | Returns a channel from EventCatalog. |
| getChannels | Returns all channels from EventCatalog. |
| getCommand | Returns a command from EventCatalog. |
| getCommands | Returns all commands from EventCatalog. |
| getConsumersOfSchema | Returns the consumers of a given schema path. |
| getCustomDoc | Returns a custom doc from EventCatalog by the given file path. |
| getCustomDocs | Returns all custom docs for the project. |
| getDataStore | Returns a data store (e.g. database, cache, etc.) from EventCatalog. |
| getDataStores | Returns all data stores (e.g. databases, caches, etc.) from EventCatalog. |
| getDomain | Returns a domain from EventCatalog. |
| getDomains | Returns all domains from EventCatalog. |
| getEntities | Returns all entities from EventCatalog. |
| getEntity | Returns an entity from EventCatalog. |
| getEvent | Returns an event from EventCatalog. |
| getEventCatalogConfigurationFile | Returns the event catalog configuration file. The event catalog configuration file is the file that contains the configuration for the event catalog. |
| getEvents | Returns all events from EventCatalog. |
| getMessageBySchemaPath | Returns a message from EventCatalog by a given schema path. |
| getOwnersForResource | Returns the owners for a given resource (e.g domain, service, event, command, query, etc.) |
| getProducersAndConsumersForMessage | Returns the producers and consumers (services) for a given message. |
| getProducersOfSchema | Returns the producers of a given schema path. |
| getQueries | Returns all queries from EventCatalog. |
| getQuery | Returns a query from EventCatalog. |
| getService | Returns a service from EventCatalog. |
| getServiceByPath | Returns a service from EventCatalog by it's path. |
| getServices | Returns all services from EventCatalog. |
| getSpecificationFilesForService | Returns specification files for a service |
| getTeam | Returns a team from EventCatalog. |
| getTeams | Returns all teams from EventCatalog. |
| getUbiquitousLanguageFromDomain | Returns the ubiquitous language dictionary from a domain. |
| getUser | Returns a user from EventCatalog. |
| getUsers | Returns all users from EventCatalog. |
| isService | Check to see if the path is a service. |
| queryHasVersion | Check to see if the catalog has a version for the given query. |
| rmChannel | Delete a channel at it's given path. |
| rmChannelById | Delete a channel by it's id. |
| rmCommand | Delete a command at it's given path. |
| rmCommandById | Delete a command by it's id. |
| rmCustomDoc | Delete a custom doc by its' path |
| rmDataStore | Delete an data store (e.g. database, cache, etc.) at its given path. |
| rmDataStoreById | Delete an data store (e.g. database, cache, etc.) by its id. |
| rmDomain | Delete a domain at it's given path. |
| rmDomainById | Delete a domain by it's id. |
| rmEntity | Delete an entity at its given path. |
| rmEntityById | Delete an entity by its id. |
| rmEvent | Delete an event at it's given path. |
| rmEventById | Delete an event by it's id. |
| rmQuery | Delete a query at it's given path. |
| rmQueryById | Delete a query by it's id. |
| rmService | Delete a service at it's given path. |
| rmServiceById | Delete a service by it's id. |
| rmTeamById | Delete a team by it's id. |
| rmUserById | Delete a user by it's id. |
| serviceHasVersion | Check to see if the catalog has a version for the given service. |
| toService | Takes a given raw file and converts it to a service. |
| versionChannel | Version a channel by it's id. |
| versionCommand | Version a command by it's id. |
| versionDataStore | Version an data store (e.g. database, cache, etc.) by its id. |
| versionDomain | Version a domain by it's id. |
| versionEntity | Version an entity by its id. |
| versionEvent | Version an event by it's id. |
| versionQuery | Version a query by it's id. |
| versionService | Version a service by it's id. |
| writeChannel | Write a channel to EventCatalog. |
| writeCommand | Write a command to EventCatalog. |
| writeCommandToService | Write an command to a service in EventCatalog. |
| writeCustomDoc | Write a custom doc to EventCatalog. |
| writeDataStore | Write a data store (e.g. database, cache, etc.) to EventCatalog. |
| writeDataStoreToService | Write an data store (e.g. database, cache, etc.) to a service in EventCatalog. |
| writeDomain | Write a domain to EventCatalog. |
| writeEntity | Write an entity to EventCatalog. |
| writeEvent | Write an event to EventCatalog. |
| writeEventToService | Write an event to a service in EventCatalog. |
| writeQuery | Write a query to EventCatalog. |
| writeQueryToService | Write a query to a service in EventCatalog. |
| writeService | Write a Service to EventCatalog. |
| writeServiceToDomain | Write a service to a domain in EventCatalog. |
| writeTeam | Write a team to EventCatalog. |
| writeUser | Write a user to EventCatalog. |
| writeVersionedService | Write a versioned service to EventCatalog. |