All checks were successful
ci/woodpecker/push/ci Pipeline was successful
Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
17 lines
506 B
TypeScript
17 lines
506 B
TypeScript
import { Inject, Injectable } from '@nestjs/common';
|
|
import { PLUGIN_REGISTRY } from './plugin.tokens.js';
|
|
import type { IChannelPlugin } from './plugin.interface.js';
|
|
|
|
@Injectable()
|
|
export class PluginService {
|
|
constructor(@Inject(PLUGIN_REGISTRY) private readonly plugins: IChannelPlugin[]) {}
|
|
|
|
getPlugins(): IChannelPlugin[] {
|
|
return this.plugins;
|
|
}
|
|
|
|
getPlugin(name: string): IChannelPlugin | undefined {
|
|
return this.plugins.find((plugin: IChannelPlugin) => plugin.name === name);
|
|
}
|
|
}
|