add webhook support

This commit is contained in:
Morten Olsen
2025-09-09 18:31:20 +02:00
parent 829071f7cc
commit 4a539702e9
5 changed files with 86 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import type { DocumentUpsertEvent } from '@morten-olsen/fluxcurrent-core/services/documents/documents.schemas.ts';
import type { Notifier } from './notifier.types.ts';
class Notifiers {
#notifiers: Notifier[];
constructor(notifiers: Notifier[]) {
this.#notifiers = notifiers;
}
public upsert = async (event: DocumentUpsertEvent) => {
await Promise.all(this.#notifiers.map((notifier) => notifier.upsert(event)));
};
}
export { Notifiers };