UNPKG

6.82 kBTypeScriptView Raw
1import basem = require('./ClientApiBases');
2import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces');
3import FeatureManagementInterfaces = require("./interfaces/FeatureManagementInterfaces");
4export interface IFeatureManagementApi extends basem.ClientApiBase {
5 getFeature(featureId: string): Promise<FeatureManagementInterfaces.ContributedFeature>;
6 getFeatures(targetContributionId?: string): Promise<FeatureManagementInterfaces.ContributedFeature[]>;
7 getFeatureState(featureId: string, userScope: string): Promise<FeatureManagementInterfaces.ContributedFeatureState>;
8 setFeatureState(feature: FeatureManagementInterfaces.ContributedFeatureState, featureId: string, userScope: string, reason?: string, reasonCode?: string): Promise<FeatureManagementInterfaces.ContributedFeatureState>;
9 getFeatureStateForScope(featureId: string, userScope: string, scopeName: string, scopeValue: string): Promise<FeatureManagementInterfaces.ContributedFeatureState>;
10 setFeatureStateForScope(feature: FeatureManagementInterfaces.ContributedFeatureState, featureId: string, userScope: string, scopeName: string, scopeValue: string, reason?: string, reasonCode?: string): Promise<FeatureManagementInterfaces.ContributedFeatureState>;
11 queryFeatureStates(query: FeatureManagementInterfaces.ContributedFeatureStateQuery): Promise<FeatureManagementInterfaces.ContributedFeatureStateQuery>;
12 queryFeatureStatesForDefaultScope(query: FeatureManagementInterfaces.ContributedFeatureStateQuery, userScope: string): Promise<FeatureManagementInterfaces.ContributedFeatureStateQuery>;
13 queryFeatureStatesForNamedScope(query: FeatureManagementInterfaces.ContributedFeatureStateQuery, userScope: string, scopeName: string, scopeValue: string): Promise<FeatureManagementInterfaces.ContributedFeatureStateQuery>;
14}
15export declare class FeatureManagementApi extends basem.ClientApiBase implements IFeatureManagementApi {
16 constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], options?: VsoBaseInterfaces.IRequestOptions);
17 /**
18 * Get a specific feature by its id
19 *
20 * @param {string} featureId - The contribution id of the feature
21 */
22 getFeature(featureId: string): Promise<FeatureManagementInterfaces.ContributedFeature>;
23 /**
24 * Get a list of all defined features
25 *
26 * @param {string} targetContributionId - Optional target contribution. If null/empty, return all features. If specified include the features that target the specified contribution.
27 */
28 getFeatures(targetContributionId?: string): Promise<FeatureManagementInterfaces.ContributedFeature[]>;
29 /**
30 * Get the state of the specified feature for the given user/all-users scope
31 *
32 * @param {string} featureId - Contribution id of the feature
33 * @param {string} userScope - User-Scope at which to get the value. Should be "me" for the current user or "host" for all users.
34 */
35 getFeatureState(featureId: string, userScope: string): Promise<FeatureManagementInterfaces.ContributedFeatureState>;
36 /**
37 * Set the state of a feature
38 *
39 * @param {FeatureManagementInterfaces.ContributedFeatureState} feature - Posted feature state object. Should specify the effective value.
40 * @param {string} featureId - Contribution id of the feature
41 * @param {string} userScope - User-Scope at which to set the value. Should be "me" for the current user or "host" for all users.
42 * @param {string} reason - Reason for changing the state
43 * @param {string} reasonCode - Short reason code
44 */
45 setFeatureState(feature: FeatureManagementInterfaces.ContributedFeatureState, featureId: string, userScope: string, reason?: string, reasonCode?: string): Promise<FeatureManagementInterfaces.ContributedFeatureState>;
46 /**
47 * Get the state of the specified feature for the given named scope
48 *
49 * @param {string} featureId - Contribution id of the feature
50 * @param {string} userScope - User-Scope at which to get the value. Should be "me" for the current user or "host" for all users.
51 * @param {string} scopeName - Scope at which to get the feature setting for (e.g. "project" or "team")
52 * @param {string} scopeValue - Value of the scope (e.g. the project or team id)
53 */
54 getFeatureStateForScope(featureId: string, userScope: string, scopeName: string, scopeValue: string): Promise<FeatureManagementInterfaces.ContributedFeatureState>;
55 /**
56 * Set the state of a feature at a specific scope
57 *
58 * @param {FeatureManagementInterfaces.ContributedFeatureState} feature - Posted feature state object. Should specify the effective value.
59 * @param {string} featureId - Contribution id of the feature
60 * @param {string} userScope - User-Scope at which to set the value. Should be "me" for the current user or "host" for all users.
61 * @param {string} scopeName - Scope at which to get the feature setting for (e.g. "project" or "team")
62 * @param {string} scopeValue - Value of the scope (e.g. the project or team id)
63 * @param {string} reason - Reason for changing the state
64 * @param {string} reasonCode - Short reason code
65 */
66 setFeatureStateForScope(feature: FeatureManagementInterfaces.ContributedFeatureState, featureId: string, userScope: string, scopeName: string, scopeValue: string, reason?: string, reasonCode?: string): Promise<FeatureManagementInterfaces.ContributedFeatureState>;
67 /**
68 * Get the effective state for a list of feature ids
69 *
70 * @param {FeatureManagementInterfaces.ContributedFeatureStateQuery} query - Features to query along with current scope values
71 */
72 queryFeatureStates(query: FeatureManagementInterfaces.ContributedFeatureStateQuery): Promise<FeatureManagementInterfaces.ContributedFeatureStateQuery>;
73 /**
74 * Get the states of the specified features for the default scope
75 *
76 * @param {FeatureManagementInterfaces.ContributedFeatureStateQuery} query - Query describing the features to query.
77 * @param {string} userScope
78 */
79 queryFeatureStatesForDefaultScope(query: FeatureManagementInterfaces.ContributedFeatureStateQuery, userScope: string): Promise<FeatureManagementInterfaces.ContributedFeatureStateQuery>;
80 /**
81 * Get the states of the specified features for the specific named scope
82 *
83 * @param {FeatureManagementInterfaces.ContributedFeatureStateQuery} query - Query describing the features to query.
84 * @param {string} userScope
85 * @param {string} scopeName
86 * @param {string} scopeValue
87 */
88 queryFeatureStatesForNamedScope(query: FeatureManagementInterfaces.ContributedFeatureStateQuery, userScope: string, scopeName: string, scopeValue: string): Promise<FeatureManagementInterfaces.ContributedFeatureStateQuery>;
89}