@arturwojnar/hermes-mongodb
Version:
Production-Ready TypeScript Outbox Pattern for MongoDB
10 lines (9 loc) • 445 B
TypeScript
import { Db, ObjectId, type Document } from 'mongodb';
import { type OutboxConsumerModel } from './typings.js';
type ConsumerActiveRecord<T extends Document, K extends keyof T = keyof T> = {
[key in K]: T[key];
} & {
update(lastProcessedId: ObjectId, resumeToken: unknown): Promise<void | never>;
};
declare const getConsumer: (db: Db, partitionKey: string) => Promise<ConsumerActiveRecord<OutboxConsumerModel>>;
export { getConsumer };