import { Configurator } from '@cityssm/configurator' import { configDefaultValues } from '../data/config.defaultValues.js' import { config } from '../data/config.js' const configurator = new Configurator( configDefaultValues, config as unknown as Record ) export function getConfigProperty( propertyName: K, fallbackValue?: (typeof configDefaultValues)[K] ): (typeof configDefaultValues)[K] { return configurator.getConfigProperty( propertyName, fallbackValue ) as (typeof configDefaultValues)[K] } export const keepAliveMillis = getConfigProperty('session.doKeepAlive') ? Math.max( getConfigProperty('session.maxAgeMillis') / 2, getConfigProperty('session.maxAgeMillis') - 10 * 60 * 1000 ) : 0