@@ -9,15 +9,16 @@ export class LaunchDarklyUtils {
99 async create ( API_TOKEN , customLogger ) {
1010 if ( customLogger ) log = customLogger ;
1111 this . apiClient = await LaunchDarklyApiClient . create ( API_TOKEN , log ) ;
12+ log . debug ( this . apiClient . apis ) ;
1213 return this ;
1314 }
1415
1516 async getFeatureFlags ( projectKey ) {
16- return this . apiClient . apis . flags . getFeatureFlags ( { projectKey : projectKey } ) ;
17+ return this . apiClient . apis [ 'Feature flags' ] . getFeatureFlags ( { projectKey : projectKey } ) ;
1718 }
1819
1920 async getFeatureFlag ( projectKey , featureFlagKey , environmentKeyQuery ) {
20- return this . apiClient . apis . flags . getFeatureFlag ( {
21+ return this . apiClient . apis [ 'Feature flags' ] . getFeatureFlag ( {
2122 projectKey : projectKey ,
2223 featureFlagKey : featureFlagKey ,
2324 environmentKeyQuery : environmentKeyQuery
@@ -31,10 +32,14 @@ export class LaunchDarklyUtils {
3132 }
3233
3334 async toggleFeatureFlag ( projectKey , featureFlagKey , environmentKeyQuery , value ) {
34- return this . apiClient . apis . flags . patchFeatureFlag ( {
35+ return this . apiClient . apis [ 'Feature flags' ] . patchFeatureFlag ( {
3536 projectKey : projectKey ,
3637 featureFlagKey : featureFlagKey ,
3738 patchDelta : [ { op : 'replace' , path : `/environments/${ environmentKeyQuery } /on` , value : value } ]
3839 } ) ;
3940 }
41+
42+ async getCustomRoles ( ) {
43+ return this . apiClient . apis [ 'Custom roles' ] . getCustomRoles ( ) ;
44+ }
4045}
0 commit comments