mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-31 00:16:47 +01:00
53354224fc
Upgrades biome to 1.6.1, and updates husky pre-commit hook. Most changes here are making type imports explicit.
33 lines
1009 B
TypeScript
33 lines
1009 B
TypeScript
import Webhook from './webhook';
|
|
import SlackAddon from './slack';
|
|
import TeamsAddon from './teams';
|
|
import DatadogAddon from './datadog';
|
|
import type Addon from './addon';
|
|
import type { LogProvider } from '../logger';
|
|
import SlackAppAddon from './slack-app';
|
|
import type { IFlagResolver } from '../types';
|
|
|
|
export interface IAddonProviders {
|
|
[key: string]: Addon;
|
|
}
|
|
|
|
export const getAddons: (args: {
|
|
getLogger: LogProvider;
|
|
unleashUrl: string;
|
|
flagResolver: IFlagResolver;
|
|
}) => IAddonProviders = ({ getLogger, unleashUrl, flagResolver }) => {
|
|
const addons: Addon[] = [
|
|
new Webhook({ getLogger }),
|
|
new SlackAddon({ getLogger, unleashUrl }),
|
|
new SlackAppAddon({ getLogger, unleashUrl }),
|
|
new TeamsAddon({ getLogger, unleashUrl }),
|
|
new DatadogAddon({ getLogger, unleashUrl }),
|
|
];
|
|
|
|
return addons.reduce((map, addon) => {
|
|
// eslint-disable-next-line no-param-reassign
|
|
map[addon.name] = addon;
|
|
return map;
|
|
}, {});
|
|
};
|