add webhook support
This commit is contained in:
17
packages/server/src/notifiers/notifiers.ts
Normal file
17
packages/server/src/notifiers/notifiers.ts
Normal 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 };
|
||||
Reference in New Issue
Block a user