mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
23 lines
599 B
TypeScript
23 lines
599 B
TypeScript
|
|
import { NotifierConfiguration } from "..//Configuration";
|
|
import { NotifierDependencies } from "../Dependencies";
|
|
import { INotifier } from "./INotifier";
|
|
|
|
import { GMailNotifier } from "./GMailNotifier";
|
|
import { FileSystemNotifier } from "./FileSystemNotifier";
|
|
|
|
export class NotifierFactory {
|
|
static build(options: NotifierConfiguration, deps: NotifierDependencies): INotifier {
|
|
if ("gmail" in options) {
|
|
return new GMailNotifier(options.gmail, deps.nodemailer);
|
|
}
|
|
else if ("filesystem" in options) {
|
|
return new FileSystemNotifier(options.filesystem);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|