node-sagas-orchestrator
Version:
Library for handling distributed transactions using an orchestrator
17 lines (16 loc) • 637 B
TypeScript
import { Saga } from './saga';
import Factory from './factory';
import { SagaContextMediator } from './saga-context-mediator';
export declare class SagaBuilder<T extends object = null> {
private currentStep;
private steps;
private factory;
private context;
setFactory(factory: Factory<T>): void;
step(name?: string): this;
invoke(method: (sagaContextMediator: SagaContextMediator<T>) => Promise<void> | void): this;
withCompensation(method: (sagaContextMediator: SagaContextMediator<T>) => Promise<void> | void): this;
withKey(key: string): this;
setContext(ctx: T): this;
build(): Saga<T>;
}