@@ -6,11 +6,10 @@ import {
66 SetConfigurationSettingParam ,
77 FeatureFlagValue ,
88 featureFlagContentType ,
9- SecretReferenceValue ,
10- ConfigurationSettingParam ,
11- featureFlagPrefix } from "@azure/app-configuration" ;
9+ SecretReferenceValue ,
10+ featureFlagPrefix } from "@azure/app-configuration" ;
1211import { isEmpty , isEqual } from "lodash" ;
13- import { Tags , FeatureFlagClientFilters } from "../models" ;
12+ import { Tags , FeatureFlagClientFilters , JsonFeatureFlagValue } from "../models" ;
1413import { SourceOptions } from "../importOptions" ;
1514import { ConfigurationFormat , ConfigurationProfile } from "../enums" ;
1615import { ArgumentError , ArgumentNullError } from "../errors" ;
@@ -173,22 +172,24 @@ function toFeatureFlagValue(value: string): FeatureFlagValue {
173172 } ;
174173}
175174
176- export function serializeFeatureFlagToConfigurationSettingParam ( featureFlag : SetConfigurationSettingParam < MsFeatureFlagValue > ) : ConfigurationSettingParam {
175+ export function serializeFeatureFlagToConfigurationSettingParam ( featureFlag : SetConfigurationSettingParam < MsFeatureFlagValue > ) : SetConfigurationSettingParam < string > {
177176 if ( ! featureFlag . value ) {
178177 throw new TypeError ( `FeatureFlag has an unexpected value - ${ featureFlag . value } ` ) ;
179178 }
180179 let key = featureFlag . key ;
180+
181181 if ( typeof featureFlag . key === "string" && ! featureFlag . key . startsWith ( featureFlagPrefix ) ) {
182182 key = featureFlagPrefix + featureFlag . key ;
183183 }
184- const jsonFeatureFlagValue : MsFeatureFlagValue = {
184+
185+ const jsonFeatureFlagValue : JsonFeatureFlagValue = {
185186 id : featureFlag . value . id ?? key . replace ( featureFlagPrefix , "" ) ,
186187 enabled : featureFlag . value . enabled ,
187188 description : featureFlag . value . description ,
188189 conditions : {
189- clientFilters : featureFlag . value . conditions ?. clientFilters
190+ client_filters : featureFlag . value . conditions ?. clientFilters
190191 } ,
191- displayName : featureFlag . value . displayName ,
192+ display_name : featureFlag . value . displayName ,
192193 allocation : featureFlag . value . allocation ,
193194 variants : featureFlag . value . variants ,
194195 telemetry : featureFlag . value . telemetry
0 commit comments