Skip to main content
View as Markdown

@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');

Classes

ClassDescription
FlowBuilderBuild EventCatalog flow resources using a fluent API.

Type Aliases

Type aliasDescription
FlowActorStepInputPayload for a flow step that represents a user or actor.
FlowBuilderInputInput used to create a flow builder.
FlowCustomStepInputPayload for a custom flow step.
FlowDataProductStepInputPayload for a flow step that references a data product.
FlowDataStoreStepInputPayload for a flow step that references a data store/container.
FlowExternalSystemStepInputPayload for a flow step that represents an external system.
FlowMessageStepInputPayload for a flow step that references an event, command, or query.
FlowServiceStepInputPayload for a flow step that references a service.
FlowStepInputPayload for a generic flow step.
FlowSubFlowStepInputPayload for a flow step that references another flow.

Functions

FunctionDescription
addDataProductToDomainAdd a data product to a domain by its id. Optionally specify a version to add the data product to a specific version of the domain.
addDataStoreToServiceAdd a data store to a service by it's id.
addEntityToDomainAdd an entity to a domain by its id. Optionally specify a version to add the entity to a specific version of the domain.
addEntityToServiceAdd an entity to a service by its id.
addExampleToCommandAdd an example file to a command.
addExampleToEventAdd an example file to an event.
addExampleToQueryAdd an example file to a query.
addFileToCommandAdd a file to a command by it's id.
addFileToDataProductAdd a file to a data product by its id.
addFileToDataStoreAdd a file to a data store (e.g. database, cache, etc.) by it's id.
addFileToDiagramAdds a file to the given diagram.
addFileToDomainAdd a file to a domain by it's id.
addFileToEventAdd a file to an event by it's id.
addFileToFlowAdds a file to the given flow.
addFileToQueryAdd a file to a query by it's id.
addFileToServiceAdd a file to a service by it's id.
addMessageToChannelAdd an event/command/query to a channel by it's id.
addMessageToDomainAdd an event/command/query to a domain by its id.
addMessageToServiceAdd an event/command to a service by it's id.
addSchemaToCommandAdd a schema to a command by it's id.
addSchemaToEventAdd a schema to an event by it's id.
addSchemaToQueryAdd a schema to a query by it's id.
addServiceToDomainAdd a service to a domain by it's id.
addSubDomainToDomainAdd a subdomain to a domain by it's id. Optionally specify a version to add the subdomain to a specific version of the domain
addUbiquitousLanguageToDomainAdds a ubiquitous language dictionary to a domain.
appendChangelogAppends a changelog entry to an existing changelog for a resource. If no changelog exists, one is created.
channelHasVersionCheck to see if the catalog has a version for the given channel.
commandHasVersionCheck to see if the catalog has a version for the given command.
dataProductHasVersionCheck to see if the catalog has a version for the given data product.
dataStoreHasVersionCheck to see if the catalog has a version for the given data store (e.g. database, cache, etc.).
diagramHasVersionCheck to see if the catalog has a version for the given diagram.
domainHasVersionCheck to see if the catalog has a version for the given domain.
dumpCatalogDumps the catalog to a JSON file.
entityHasVersionCheck to see if the catalog has a version for the given entity.
eventHasVersionCheck to see if the catalog has a version for the given event.
flowHasVersionCheck to see if the catalog has a version for the given flow.
getChangelogReturns the changelog for a resource in EventCatalog.
getChannelReturns a channel from EventCatalog.
getChannelsReturns all channels from EventCatalog.
getCommandReturns a command from EventCatalog.
getCommandsReturns all commands from EventCatalog.
getConsumersOfSchemaReturns the consumers of a given schema path.
getCustomDocReturns a custom doc from EventCatalog by the given file path.
getCustomDocsReturns all custom docs for the project.
getDataProductReturns a data product from EventCatalog.
getDataProductsReturns all data products from EventCatalog.
getDataStoreReturns a data store (e.g. database, cache, etc.) from EventCatalog.
getDataStoresReturns all data stores (e.g. databases, caches, etc.) from EventCatalog.
getDiagramReturns a diagram from EventCatalog.
getDiagramsReturns all diagrams from EventCatalog.
getDomainReturns a domain from EventCatalog.
getDomainsReturns all domains from EventCatalog.
getEntitiesReturns all entities from EventCatalog.
getEntityReturns an entity from EventCatalog.
getEventReturns an event from EventCatalog.
getEventCatalogConfigurationFileReturns the event catalog configuration file. The event catalog configuration file is the file that contains the configuration for the event catalog.
getEventsReturns all events from EventCatalog.
getExamplesFromCommandGet all examples from a command.
getExamplesFromEventGet all examples from an event.
getExamplesFromQueryGet all examples from a query.
getFlowReturns a flow from EventCatalog.
getFlowsReturns all flows from EventCatalog.
getMessageBySchemaPathReturns a message from EventCatalog by a given schema path.
getOwnersForResourceReturns the owners for a given resource (e.g domain, service, event, command, query, etc.)
getProducersAndConsumersForMessageReturns the producers and consumers (services) for a given message.
getProducersOfSchemaReturns the producers of a given schema path.
getQueriesReturns all queries from EventCatalog.
getQueryReturns a query from EventCatalog.
getSchemaForMessageReturns the schema for a given message (event, command or query) by its id and version.
getServiceReturns a service from EventCatalog.
getServiceByPathReturns a service from EventCatalog by it's path.
getServicesReturns all services from EventCatalog.
getSpecificationFilesForServiceReturns specification files for a service
getTeamReturns a team from EventCatalog.
getTeamsReturns all teams from EventCatalog.
getUbiquitousLanguageFromDomainReturns the ubiquitous language dictionary from a domain.
getUserReturns a user from EventCatalog.
getUsersReturns all users from EventCatalog.
isServiceCheck to see if the path is a service.
queryHasVersionCheck to see if the catalog has a version for the given query.
removeExampleFromCommandRemove an example file from a command.
removeExampleFromEventRemove an example file from an event.
removeExampleFromQueryRemove an example file from a query.
rmChangelogRemoves the changelog for a resource in EventCatalog.
rmChannelDelete a channel at it's given path.
rmChannelByIdDelete a channel by it's id.
rmCommandDelete a command at it's given path.
rmCommandByIdDelete a command by it's id.
rmCustomDocDelete a custom doc by its' path
rmDataProductDelete a data product at its given path.
rmDataProductByIdDelete a data product by its id.
rmDataStoreDelete an data store (e.g. database, cache, etc.) at its given path.
rmDataStoreByIdDelete an data store (e.g. database, cache, etc.) by its id.
rmDiagramDelete a diagram at its given path.
rmDiagramByIdDelete a diagram by its id.
rmDomainDelete a domain at it's given path.
rmDomainByIdDelete a domain by it's id.
rmEntityDelete an entity at its given path.
rmEntityByIdDelete an entity by its id.
rmEventDelete an event at it's given path.
rmEventByIdDelete an event by it's id.
rmFlowDelete a flow at its given path.
rmFlowByIdDelete a flow by its id.
rmQueryDelete a query at it's given path.
rmQueryByIdDelete a query by it's id.
rmServiceDelete a service at it's given path.
rmServiceByIdDelete a service by it's id.
rmTeamByIdDelete a team by it's id.
rmUserByIdDelete a user by it's id.
serviceHasVersionCheck to see if the catalog has a version for the given service.
toServiceTakes a given raw file and converts it to a service.
versionChannelVersion a channel by it's id.
versionCommandVersion a command by it's id.
versionDataProductVersion a data product by its id.
versionDataStoreVersion an data store (e.g. database, cache, etc.) by its id.
versionDiagramVersion a diagram by its id.
versionDomainVersion a domain by it's id.
versionEntityVersion an entity by its id.
versionEventVersion an event by it's id.
versionFlowVersion a flow by its id.
versionQueryVersion a query by it's id.
versionServiceVersion a service by it's id.
writeChangelogWrites a changelog entry to a resource in EventCatalog.
writeChannelWrite a channel to EventCatalog.
writeCommandWrite a command to EventCatalog.
writeCommandToServiceWrite an command to a service in EventCatalog.
writeCustomDocWrite a custom doc to EventCatalog.
writeDataProductWrite a data product to EventCatalog.
writeDataProductToDomainWrite a data product to a domain in EventCatalog.
writeDataStoreWrite a data store (e.g. database, cache, etc.) to EventCatalog.
writeDataStoreToServiceWrite an data store (e.g. database, cache, etc.) to a service in EventCatalog.
writeDiagramWrite a diagram to EventCatalog.
writeDomainWrite a domain to EventCatalog.
writeEntityWrite an entity to EventCatalog.
writeEventWrite an event to EventCatalog.
writeEventToServiceWrite an event to a service in EventCatalog.
writeFlowWrite a flow to EventCatalog.
writeFlowToDomainWrite a flow to a domain in EventCatalog.
writeFlowToServiceWrite a flow to a service in EventCatalog.
writeQueryWrite a query to EventCatalog.
writeQueryToServiceWrite a query to a service in EventCatalog.
writeServiceWrite a Service to EventCatalog.
writeServiceToDomainWrite a service to a domain in EventCatalog.
writeTeamWrite a team to EventCatalog.
writeUserWrite a user to EventCatalog.
writeVersionedFlowWrite a versioned flow to EventCatalog.
writeVersionedServiceWrite a versioned service to EventCatalog.