import { UsageCounter } from 'src/plugins/usage_collection/server' ; export interface CountUsageOfPredefinedIdsOptions { predefinedId ? : string ; spaceId ? : string ; usageCounter ? : UsageCounter ; } export function countUsageOfPredefinedIds ( { predefinedId , spaceId , usageCounter , } ) { if ( predefinedId && usageCounter ) { usageCounter ?. incrementCounter ( { counterName : 'ruleCreatedWithPredefinedId' , incrementBy : 1 , } ) ; const isInCustomSpace = spaceId !== undefined && spaceId !== 'default' ; if ( isInCustomSpace ) { usageCounter ?. incrementCounter ( { counterName : 'ruleCreatedWithPredefinedIdInCustomSpace' , incrementBy : 1 , } ) ; } } }