UNPKG

event-driven

Version:

makes building event-driven-architecture easy

37 lines (36 loc) 1.17 kB
/// <reference types="mongoose/types/pipelinestage" /> /// <reference types="mongoose/types/error" /> /// <reference types="mongoose/types/connection" /> import { Document, Types } from 'mongoose'; export interface BatchDoc extends Document { _id: Types.ObjectId; parentEventIds: Types.ObjectId[]; durableName: string; clientGroup: string; subject: string; processTime?: number; createdAt: Date; } export declare const Batch: import("mongoose").Model<BatchDoc, {}, {}, {}>; export interface BatchInput { parentEventIds: Types.ObjectId[]; durableName: string; clientGroup: string; subject: string; } export declare const createBatch: (data: BatchInput) => { batch: BatchDoc & { _id: Types.ObjectId; }; catchError: (error: Error) => void; }; export interface BatchError extends Document { batchId: Types.ObjectId; message?: string; stack?: string; isConfirmed: Boolean; createdAt: Date; updatedAt: Date; } export declare const BatchError: import("mongoose").Model<BatchError, {}, {}, {}>; export declare const createBatchError: (batchId: Types.ObjectId) => (error: Error) => void;