2023-09-15 14:52:54 +02:00
|
|
|
import { Db, IUnleashConfig } from 'lib/server-impl';
|
|
|
|
import PrivateProjectStore from './privateProjectStore';
|
|
|
|
import { PrivateProjectChecker } from './privateProjectChecker';
|
2023-09-18 10:06:26 +02:00
|
|
|
import { FakePrivateProjectChecker } from './fakePrivateProjectChecker';
|
2023-09-15 14:52:54 +02:00
|
|
|
|
|
|
|
export const createPrivateProjectChecker = (
|
|
|
|
db: Db,
|
|
|
|
config: IUnleashConfig,
|
|
|
|
): PrivateProjectChecker => {
|
|
|
|
const { getLogger } = config;
|
|
|
|
const privateProjectStore = new PrivateProjectStore(db, getLogger);
|
|
|
|
|
2023-09-22 10:54:33 +02:00
|
|
|
return new PrivateProjectChecker(
|
|
|
|
{
|
|
|
|
privateProjectStore: privateProjectStore,
|
|
|
|
},
|
|
|
|
config,
|
|
|
|
);
|
2023-09-15 14:52:54 +02:00
|
|
|
};
|
|
|
|
|
2023-09-18 10:06:26 +02:00
|
|
|
export const createFakePrivateProjectChecker =
|
|
|
|
(): FakePrivateProjectChecker => {
|
|
|
|
return new FakePrivateProjectChecker();
|
2023-09-15 14:52:54 +02:00
|
|
|
};
|