smart-saga-pattern
Version:
A library implementing the Saga pattern for microservice architecture
31 lines (30 loc) • 1.03 kB
TypeScript
import { SagaDefinition } from "../orchestration/SagaDefinition";
/**
* Builder for creating Saga definitions from decorated classes
*/
export declare class SagaBuilder {
/**
* Builds a Saga definition from all registered steps
* @template T Type of the context
*/
static buildFromAllSteps<T = any>(): SagaDefinition<T>;
/**
* Builds a Saga definition from specific step classes
* @param stepClasses Step classes to include in the Saga
* @template T Type of the context
*/
static buildFromSteps<T = any>(stepClasses: any[]): SagaDefinition<T>;
/**
* Adds a step to a SagaDefinition builder
* @param builder SagaDefinition builder
* @param stepClass Step class to add
* @template T Type of the context
*/
private static addStepToBuilder;
/**
* Finds a method with specific metadata in a class
* @param stepClass Class to search in
* @param metadataKey Metadata key to look for
*/
private static findMethodWithMetadata;
}