import { oneDayInMs } from '../shared/utils.js';
let conf;
export const setConfig = (config) => {
    conf = config;
};
export const getConfig = () => conf;
export const configForCollection = (collection) => conf.azure.collections.find(c => c.name === collection);
export const configForProject = (collection, project) => { var _a; return (_a = configForCollection(collection)) === null || _a === void 0 ? void 0 : _a.projects.find(p => p.name === project); };
export const collections = () => getConfig().azure.collections;
export const collectionsAndProjects = () => getConfig().azure.collections.flatMap(collection => collection.projects.map(project => [collection, project]));
export const queryPeriodDays = () => (Date.now() - getConfig().azure.queryFrom.getTime()) / oneDayInMs;
