const apmIndexConfigs = [ [ 'sourcemap' , 'apm_oss.sourcemapIndices' ] , [ 'error' , 'apm_oss.errorIndices' ] , [ 'onboarding' , 'apm_oss.onboardingIndices' ] , [ 'span' , 'apm_oss.spanIndices' ] , [ 'transaction' , 'apm_oss.transactionIndices' ] , [ 'metric' , 'apm_oss.metricsIndices' ] , ] as const ; type ApmIndexConfigs = typeof apmIndexConfigs [ number ] [ 0 ] ; type ApmIndicesSavedObjectAttributes = Partial < { [ Property in ApmIndexConfigs ] : string ; } > ; type DeprecatedApmIndexConfigPaths = typeof apmIndexConfigs [ number ] [ 1 ] ; type DeprecatedApmIndicesSavedObjectAttributes = Partial < { [ Property in DeprecatedApmIndexConfigPaths ] : string ; } > ; export function updateApmOssIndexPaths ( attributes ) { return apmIndexConfigs . reduce ( ( attrs , [ configPath , deprecatedConfigPath ] ) => { const indexConfig = attributes [ deprecatedConfigPath ] ; if ( indexConfig ) { attrs [ configPath ] = indexConfig ; } return attrs ; } , { } as ApmIndicesSavedObjectAttributes ) ; }