FeatureAvailabilityRestClient class

Base class that should be used (derived from) to make requests to VSS REST apis

Extends

Constructors

FeatureAvailabilityRestClient(IVssRestClientOptions)

Methods

getAllFeatureFlags(string)

Retrieve a listing of all feature flags and their current states for a user

getFeatureFlagByName(string, boolean)

Retrieve information on a single feature flag and its current states

getFeatureFlagByNameAndUserEmail(string, string, boolean)

Retrieve information on a single feature flag and its current states for a user

getFeatureFlagByNameAndUserId(string, string, boolean)

Retrieve information on a single feature flag and its current states for a user

updateFeatureFlag(FeatureFlagPatch, string, string, boolean, boolean)

Change the state of an individual feature flag for a name

Constructor Details

FeatureAvailabilityRestClient(IVssRestClientOptions)

new FeatureAvailabilityRestClient(options: IVssRestClientOptions)

Parameters

Method Details

getAllFeatureFlags(string)

Retrieve a listing of all feature flags and their current states for a user

function getAllFeatureFlags(userEmail?: string): Promise<FeatureFlag[]>

Parameters

userEmail

string

The email of the user to check

Returns

Promise<FeatureFlag[]>

getFeatureFlagByName(string, boolean)

Retrieve information on a single feature flag and its current states

function getFeatureFlagByName(name: string, checkFeatureExists?: boolean): Promise<FeatureFlag>

Parameters

name

string

The name of the feature to retrieve

checkFeatureExists

boolean

Check if feature exists

Returns

Promise<FeatureFlag>

getFeatureFlagByNameAndUserEmail(string, string, boolean)

Retrieve information on a single feature flag and its current states for a user

function getFeatureFlagByNameAndUserEmail(name: string, userEmail: string, checkFeatureExists?: boolean): Promise<FeatureFlag>

Parameters

name

string

The name of the feature to retrieve

userEmail

string

The email of the user to check

checkFeatureExists

boolean

Check if feature exists

Returns

Promise<FeatureFlag>

getFeatureFlagByNameAndUserId(string, string, boolean)

Retrieve information on a single feature flag and its current states for a user

function getFeatureFlagByNameAndUserId(name: string, userId: string, checkFeatureExists?: boolean): Promise<FeatureFlag>

Parameters

name

string

The name of the feature to retrieve

userId

string

The id of the user to check

checkFeatureExists

boolean

Check if feature exists

Returns

Promise<FeatureFlag>

updateFeatureFlag(FeatureFlagPatch, string, string, boolean, boolean)

Change the state of an individual feature flag for a name

function updateFeatureFlag(state: FeatureFlagPatch, name: string, userEmail?: string, checkFeatureExists?: boolean, setAtApplicationLevelAlso?: boolean): Promise<FeatureFlag>

Parameters

state
FeatureFlagPatch

State that should be set

name

string

The name of the feature to change

userEmail

string

checkFeatureExists

boolean

Checks if the feature exists before setting the state

setAtApplicationLevelAlso

boolean

Returns

Promise<FeatureFlag>