vso-extension-samples
Version:
Visual Studio Online Extension Samples
1,784 lines (1,600 loc) • 1.4 MB
TypeScript
// Type definitions for Microsoft Visual Studio Services v90.20151021.1634
// Project: http://www.visualstudio.com/integrate/extensions/overview
// Definitions by: Microsoft <vsointegration@microsoft.com>
/// <reference path='knockout.d.ts' />
/// <reference path='jquery.d.ts' />
/// <reference path='q.d.ts' />
//----------------------------------------------------------
// Common interfaces specific to WebPlatform area
//----------------------------------------------------------
/**
* VSS-specific options for VSS ajax requests
*/
interface IVssAjaxOptions {
/*
* Auth token manager that can be used to get and attach auth tokens to requests
*/
authTokenManager?: IAuthTokenManager<any>;
/**
* If true, textStatus and jqXHR are added to the success callback. In this case, spread (instead of then) needs to be used (default false).
*/
useAjaxResult?: boolean;
}
/**
* Event listener for VSS ajax events. Gets notified before and after each request
*/
interface IVssAjaxEventListener {
/**
* Method invoked before a request is sent
*
* @param requestId A unique id that can be used to track this particular request (id is unique among all clients)
* @param requestUrl Url of the request that is about to be issued
* @param ajaxOptions Ajax settings/options for the request
* @param vssRequestOptions Additional VSS-specific options supplied in the request
*/
beforeRequest?: (requestId: number, requestUrl: string, ajaxOptions: JQueryAjaxSettings, vssRequestOptions: IVssAjaxOptions) => void;
/**
* Method invoked when a response has been received
*
* @param requestId A unique id that can be used to track this particular request (id is unique among all clients)
* @param data The response data
* @param textStatus A string indicating status of the request
* @param jqXHR: The jQuery XHR object for the request
* @param vssRequestOptions Additional VSS-specific options supplied in the request
*/
responseReceived?: (requestId: number, data: any, textStatus: string, jqXHR: JQueryXHR, vssRequestOptions: IVssAjaxOptions) => void;
/**
* Method invoked after a response has been received and its callback/promise has been invoked
*
* @param requestId A unique id that can be used to track this particular request (id is unique among all clients)
* @param data The response data
* @param textStatus A string indicating status of the request
* @param jqXHR: The jQuery XHR object for the request
* @param vssRequestOptions Additional VSS-specific options supplied in the request
*/
postResponseCallback?: (requestId: number, data: any, textStatus: string, jqXHR: JQueryXHR, vssRequestOptions: IVssAjaxOptions) => void;
}
/**
* Interface for a class that can fetch auth tokens to be used in AJAX requests.
*/
interface IAuthTokenManager<TToken> {
/**
* Get the auth token to use for this request.
*
* @param refresh If true refresh the token (i.e. request a new one - don't use a cached token)
*/
getAuthToken(refresh?: boolean): IPromise<TToken>;
/**
* Gets the authorization header to use in a request from the given token
*
* @param sessionToken Used for token key.
* @return the value to use for the Authorization header in a request.
*/
getAuthorizationHeader(sessionToken: TToken): string;
}
/**
* A promise represents the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its then method,
* which registers callbacks to receive either a promise’s eventual value or the reason why the promise cannot be fulfilled.
*/
interface IPromise<T> {
/**
* Then method which accepts a fulfill delegate which returns a promise or nothing and a reject delegate which returns a promise or nothing. Then returns a new promise.
*/
then<U>(onFulfill: (value: T) => IPromise<U> | void, onReject?: (reason: any) => IPromise<U> | void): IPromise<U>;
/**
* Then method which accepts a fulfill delegate which returns a promise or nothing and a reject delegate which returns a reason value or nothing. Then returns a new promise.
*/
then<U>(onFulfill: (value: T) => IPromise<U> | void, onReject?: (reason: any) => U | void): IPromise<U>;
/**
* Then method which accepts a fulfill delegate which returns a value or nothing and a reject delegate which returns a promise or nothing. Then returns a new promise.
*/
then<U>(onFulfill: (value: T) => U | void, onReject?: (reason: any) => IPromise<U> | void): IPromise<U>;
/**
* Then method which accepts a fulfill delegate which returns a value or nothing and a reject delegate which returns a reason value or nothing. Then returns a new promise.
*/
then<U>(onFulfill: (value: T) => U | void, onReject?: (reason: any) => U | void): IPromise<U>;
}
declare var Sys;
interface EventTarget {
checked: boolean;
nodeType: number;
}
interface Date {
toGMTString(): string;
}
interface IErrorCallback {
(error: any): void;
}
interface IResultCallback extends Function {
}
interface IArgsFunctionR<TResult> {
(...args: any[]): TResult;
}
interface IFunctionPR<TParam, TResult> {
(param: TParam): TResult;
}
interface IFunctionPPR<TParam1, TParam2, TResult> {
(param1: TParam1, param2: TParam2): TResult;
}
interface IFunctionPPPR<TParam1, TParam2, TParam3, TResult> {
(param1: TParam1, param2: TParam2, param3: TParam3): TResult;
}
interface IComparer<T> extends IFunctionPPR<T, T, number> {
}
interface IDictionaryStringTo<T> {
[key: string]: T;
}
interface IDictionaryNumberTo<T> {
[key: number]: T;
}
interface IEventHandler extends Function {
}
interface IWebApiArrayResult {
count: number;
value: any[];
}
interface Window {
ActiveXObject: any;
DOMParser: any;
XSLTProcessor: any;
vsSdkOnLoad:() => void;
}
interface MSAjaxError extends Error {
popStackFrame: () => void;
}
interface TfsError extends Error {
status?: string;
stack?: string;
}
//These variables defined by server.
declare var exports: any;
declare var _disabledPlugins: string[];
interface IWebAccessPlugin {
namespace: string;
loadAfter: string;
}
declare var _plugins: IWebAccessPlugin[];
declare var _builtinPlugins: IWebAccessPlugin[];
interface IWebAccessPluginBase {
namespace: string;
base: string;
}
declare var _builtInBases: IWebAccessPluginBase[];
declare var _bases: IWebAccessPluginBase[];
interface IRequire {
(moduleName: string): any;
(moduleNames: string[], moduleFunc: Function): any;
config: (config: any, shouldOverwrite?: boolean) => void;
}
interface IDefine {
(moduleNames: string[], moduleFunc: Function): any;
(id: string, moduleNames: string[], moduleFunc: Function): any;
}
interface IDisposable {
dispose(): void;
}
interface IKeyValuePair<TKey, TValue> {
key: TKey;
value: TValue;
}
declare var require: IRequire;
declare var define: IDefine;
//----------------------------------------------------------
// Common interfaces specific to WebPlatform area
//----------------------------------------------------------
/**
* Interface for a single XDM channel
*/
interface IXDMChannel {
/**
* Invoke a method via RPC. Lookup the registered object on the remote end of the channel and invoke the specified method.
*
* @param method Name of the method to invoke
* @param instanceId unique id of the registered object
* @param params Arguments to the method to invoke
* @param instanceContextData Optional context data to pass to a registered object's factory method
*/
invokeRemoteMethod<T>(methodName: string, instanceId: string, params?: any[], instanceContextData?: Object): IPromise<T>;
/**
* Get a proxied object that represents the object registered with the given instance id on the remote side of this channel.
*
* @param instanceId unique id of the registered object
* @param contextData Optional context data to pass to a registered object's factory method
*/
getRemoteObjectProxy<T>(instanceId: string, contextData?: Object): IPromise<T>;
/**
* Get the object registry to handle messages from this specific channel.
* Upon receiving a message, this channel registry will be used first, then
* the global registry will be used if no handler is found here.
*/
getObjectRegistry(): IXDMObjectRegistry;
}
/**
* Registry of XDM channels kept per target frame/window
*/
interface IXDMChannelManager {
/**
* Add an XDM channel for the given target window/iframe
*
* @param window Target iframe window to communicate with
* @param targetOrigin Url of the target iframe (if known)
*/
addChannel(window: Window, targetOrigin?: string): IXDMChannel;
}
/**
* Registry of XDM objects that can be invoked by an XDM channel
*/
interface IXDMObjectRegistry {
/**
* Register an object (instance or factory method) exposed by this frame to callers in a remote frame
*
* @param instanceId unique id of the registered object
* @param instance Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance.
*/
register(instanceId: string, instance: Object | { (contextData?: any): Object; }): void;
/**
* Get an instance of an object registered with the given id
*
* @param instanceId unique id of the registered object
* @param contextData Optional context data to pass to the contructor of an object factory method
*/
getInstance<T>(instanceId: string, contextData?: Object): T;
}
/**
* Options for the extension's initialization method
*/
interface IExtensionInitializationOptions {
/**
* Set to true if the extension will explicitly call notifyLoadSucceeded or notifyLoadFailed
* itself to indicate that the extension is done loading (stops UI loading indicator in the host).
* If false (the default) the extension is considered ready as soon as init is called.
*/
explicitNotifyLoaded?: boolean;
/**
* Set to true if the extension is going to consume any VSS script libraries.
* For example, controls, REST clients, services, etc.
* This pulls in the script loader and configuration data from the host frame so that
* 'require' statements can be used to load VSO modules. A call to VSS.require will
* effectively turn this option on, even if not specified in the VSS.init handshake.
*/
usePlatformScripts?: boolean;
/**
* Set to true if the extension desires to use VSS platform CSS styles. If not explicitly set,
* the default value is the value of 'usePlatformScripts'.
*/
usePlatformStyles?: boolean;
/**
* Extension-specific AMD module loader configuration. This configuration
* will be merged with the VSO-specific configuration.
*/
moduleLoaderConfig?: ModuleLoaderConfiguration;
/**
* Optional callback method that gets invoked when this extension frame is reused by another contribution
* which shares the same URI of the contribution that originally caused this extension frame to be loaded.
*/
extensionReusedCallback?: (contribution: Contribution) => void;
}
/**
* Data passed from the host to an extension frame via the initial handshake
*/
interface IHostHandshakeData {
/**
* Static context information about the current page
*/
pageContext: PageContext;
/**
* Initial configuration for the extension frame
*/
initialConfig?: any;
/**
* Context information about the extension
*/
extensionContext: IExtensionContext;
/**
* The contribution that caused the extension frame to be loaded.
*/
contribution: Contribution;
}
/**
* Data passed to the host from an extension frame via the initial handshake
*/
interface IExtensionHandshakeData {
/**
* If true, consider the extension loaded upon completion of the initial handshake.
*/
notifyLoadSucceeded: boolean;
/**
* Optional callback method that gets invoked when this extension frame is reused by another contribution
* which shares the same URI of the contribution that originally caused this extension frame to be loaded.
*/
extensionReusedCallback?: (contribution: Contribution) => void;
}
/**
* Information about a control interface that is exposed across iframe boundaries
*/
interface IExternalControlInterfaceInfo {
methodNames: string[];
}
/**
* Context about the app that owns the content that is being hosted
*/
interface IExtensionContext {
/**
* Friendly unique id of the publisher
*/
publisherId: string;
/**
* Friendly id of the extension (unique within the publisher)
*/
extensionId: string;
/**
* Version of the extension
*/
version: string;
/**
* The base uri to be used with relative urls in contribution properties
*/
baseUri: string;
}
interface IDefaultGetServiceContext {
webContext: WebContext;
extensionContext: IExtensionContext;
}
/**
* Session token whose value can be added to the Authorization header in requests to VSO endpoints
*/
interface ISessionToken {
/**
* The registered VSS auth application id
*/
appId: string;
/**
* Name describing the token
*/
name: string;
/**
* Token value
*/
token: string;
}
/**
* A Contribution with its containing extension
*/
interface IExtensionContribution extends Contribution {
/**
* The extension that owns this contribution
*/
extension: Extension;
}
/**
* Information about an individual contribution that contributes one or more services registered by id.
*/
interface IServiceContribution extends IExtensionContribution {
/**
* Get the instance of an object registered by this contribution
*
* @param objectId Id of the registered object (defaults to the id property of the contribution)
* @param context Optional context to use when getting the object.
*/
getInstance<T>(objectId?: string, context?: any): IPromise<T>;
}
interface IHostDialogOptions {
height?: number;
width?: number;
draggable?: boolean;
resizable?: boolean;
title?: string;
modal?: boolean;
buttons?: IDictionaryStringTo<any>;
open?: Function;
close?: Function;
getDialogResult?: () => any;
okCallback?: (result: any) => void;
cancelCallback?: Function;
okText?: string;
cancelText?: string;
}
interface IExternalDialog {
/**
* Gets an object registered in the dialog's contribution control.
*
* @param instanceId Id of the instance to get
* @param contextData Optional data to pass to the extension for it to use when creating the instance
* @return Promise that is resolved to the instance (a proxy object that talks to the instance)
*/
getContributionInstance<T>(instanceId: string, contextData?: any): IPromise<T>;
/**
* Close the dialog
*/
close();
/**
* Update the title of the dialog
*
* @param title New dialog title
*/
setTitle(title: string);
/**
* Update the enablement of the OK button
*/
updateOkButton(enabled: boolean);
}
/**
* Service which manages showing dialogs in the parent frame
*/
interface IHostDialogService {
/**
* Open a modal dialog in the host frame which will get its content from a contributed control.
*
* @param contributionId The id of the control contribution to host in the dialog
* @param dialogOptions options.title - title of dialog
* @param contributionConfig Initial configuration to pass to the contribution control.
* @param postContent Optional data to post to the contribution endpoint. If not specified, a GET request will be performed.
*/
openDialog(contributionId: string, dialogOptions: IHostDialogOptions, contributionConfig?: Object, postContent?: Object): IPromise<IExternalDialog>;
}
/**
* Service which allows interaction with the browser location and navigation of the host frame
*/
interface IHostNavigationService {
/**
* Reloads the parent frame
*/
reload();
/**
* Add a callback to be invoked each time the hash navigation has changed
*
* @param callback Method invoked on each navigation hash change
*/
onHashChanged(callback: (hash: string) => void);
/**
* Gets the current hash.
*
* @return Hash part of the host page's url (url following #)
*/
getHash(): IPromise<string>;
/**
* Sets the provided hash from the hosted content.
*
* @param hash The new hash string to
*/
setHash(hash: string);
}
/**
* Service which allows for getting and setting of extension data
*/
interface IExtensionDataService {
/**
* Returns a promise for retrieving a setting at the provided key and scope
*
* @param key The key to retrieve a value for
* @param documentOptions The scope in which the value is stored - default value is account-wide
*/
getValue<T>(key: string, documentOptions?: IDocumentOptions): IPromise<T>;
/**
* Returns a promise for saving a setting at the provided key and scope
*
* @param key The key to save a value for
* @param value The value to save
* @param documentOptions The scope in which the value is stored - default value is account-wide
*/
setValue<T>(key: string, value: T, documentOptions?: IDocumentOptions): IPromise<T>;
/**
* Returns a promise for getting a document with the provided id in the provided collection
*
* @param collectionName The name of the collection where the document lives
* @param id The id of the document in the collection
* @param documentOptions The scope in which the value is stored - default value is account-wide
*/
getDocument(collectionName: string, id: string, documentOptions?: IDocumentOptions): IPromise<any>;
/**
* Returns a promise for getting all of the documents in the provided collection
*
* @param collectionName The name of the collection where the document lives
* @param documentOptions The scope in which the value is stored - default value is account-wide
*/
getDocuments(collectionName: string, documentOptions?: IDocumentOptions): IPromise<any[]>;
/**
* Returns a promise for creating a document in the provided collection
*
* @param collectionName The name of the collection where the document lives
* @param doc The document to store
* @param documentOptions The scope in which the value is stored - default value is account-wide
*/
createDocument(collectionName: string, doc: any, documentOptions?: IDocumentOptions): IPromise<any>;
/**
* Returns a promise for setting a document in the provided collection
* Creates the document if it does not exist, otherwise updates the existing document with the id provided
*
* @param collectionName The name of the collection where the document lives
* @param doc The document to store
* @param documentOptions The scope in which the value is stored - default value is account-wide
*/
setDocument(collectionName: string, doc: any, documentOptions?: IDocumentOptions): IPromise<any>;
/**
* Returns a promise for updating a document in the provided collection
* A document with the id provided must exist
*
* @param collectionName The name of the collection where the document lives
* @param doc The document to store
* @param documentOptions The scope in which the value is stored - default value is account-wide
*/
updateDocument(collectionName: string, doc: any, documentOptions?: IDocumentOptions): IPromise<any>;
/**
* Returns a promise for deleting the document at the provided scope, collection and id
*
* @param collectionName The name of the collection where the document lives
* @param id The id of the document in the collection
* @param documentOptions The scope in which the value is stored - default value is account-wide
*/
deleteDocument(collectionName: string, id: string, documentOptions?: IDocumentOptions): IPromise<void>;
}
/**
* Interface for options that can be supplied with document actions
*/
interface IDocumentOptions {
/**
* The scope of where the document is stored. Can be Account or User.
*/
scopeType: string;
/**
* The value of the scope where the document is stored. Can be Current or Me.
*/
scopeValue?: string;
/**
* The default value to return when using getValue(). If the document has no value,
* this value will be used instead.
*/
defaultValue?: any;
}
/**
* Interface for a registered object that contributes menu item(s)
*/
interface IContributedMenuSource {
/**
* Get an array of menu items for the given context
*
* @param context Menu-specific context information
* @return Array of menu items or a promise for the array
*/
getMenuItems(context: any): IContributedMenuItem[] | IPromise<IContributedMenuItem[]>;
/**
* Handle a menu item from this menu source being clicked. This is only invoked when the
* contributed menu item does not have an "action" method.
*
* @param actionContext Menu-specific context information
*/
execute(actionContext: any);
}
/**
* An individual contributed menu item
*/
interface IContributedMenuItem {
/**
* Menu-item specific identifier
*/
id?: string;
/**
* Text to display in the menu item
*/
text?: string;
/**
* Tooltip to display for the menu item
*/
title?: string;
/**
* Set to true if this menu item is just a separator
*/
separator?: boolean;
/**
* Set to true if this menu item should be disabled
*/
disabled?: boolean;
/**
* Url to an icon image or css class for the image cell
*/
icon?: string;
/**
* If true, do not render an icon or space for an icon.
*/
noIcon?: boolean;
/**
* If this menu item has a sub menu, these are the contributed child items
*/
childItems?: IContributedMenuItem[];
/**
* Id of the menu group that this item should be placed in.
*/
groupId?: string;
/**
* Method invoked when the menu item is clicked.
*
* @param actionContext Menu-specific context information
*/
action?: (actionContext: any) => void;
}
interface IContributedTab {
/**
* Determines if this tab should be displayed
* @param context Context information
* @return boolean Return true not to show this tab.
*/
isInvisible?: (context?: any) => boolean | IPromise<boolean>;
/**
* Page title, which will be displayed above the list of Tabs
* @param context Context information
* @return string The unescaped page title
*/
pageTitle: string | IPromise<string> | ((context?: any) => string | IPromise<string>);
/**
* Name of the tab
* @param context Context information
* @return string The unescaped text that appears as the name of the tab
*/
name: string | IPromise<string> | ((context?: any) => string | IPromise<string>);
/**
* Title text for the tab, i.e., the tooltip
* @param context Context information
* @return string The tooltip text
*/
title?: string | IPromise<string> | ((context?: any) => string | IPromise<string>);
/**
* URI to the page that this tab will display (i.e. in a frame)
*/
uri: string;
/**
* Function that is invoked when there is a new context available for the extension.
*/
updateContext: (context: any) => void | IPromise<void>;
}
//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
//----------------------------------------------------------
// Generated file, DO NOT EDIT.
// To regenerate this file, run "GenerateConstants.cmd" .
// Generated data for the following assemblies:
// Microsoft.TeamFoundation.Server.WebAccess.Platform
// Microsoft.VisualStudio.Services.WebApi
//----------------------------------------------------------
/**
* Model to represent a public access uri
*/
interface AccessPointModel {
/**
* Host name and port number of the url
*/
authority: string;
/**
* Url scheme (http, https, ...)
*/
scheme: string;
/**
* Full url
*/
uri: string;
}
/**
* Model used to configure how TFS reports usage data to Application Insights
*/
interface AppInsightsConfiguration {
/**
* If true, automatically call "trackPage" when the page is loaded
*/
autoTrackPage: boolean;
/**
* Optional data used to override the default values sent to trackPage
*/
customTrackPageData: AppInsightsCustomTrackPageData;
/**
* Set to false if app insights reporting is not enabled/configured
*/
enabled: boolean;
/**
* The url from which to retrieve app insights scripts
*/
insightsScriptUrl: string;
/**
* The instrumentation key used to track this deployment's usage
*/
instrumentationKey: string;
/**
* If true, include collection, project, and team info in the track-page urls
*/
trackProjectInfo: boolean;
}
/**
* Model that can be used to customize the values sent to AppInsights via "trackPage"
*/
interface AppInsightsCustomTrackPageData {
alias: string;
metrics: { [key: string]: number; };
pageName: string;
properties: { [key: string]: string; };
}
/**
* Web Access configuration data. This information is used to process requests on the server. This data is also placed in a json island on each page in order for JavaScript to know key configuration data required to things like construct proper urls
*/
interface ConfigurationContext {
/**
* MVC api configuration
*/
api: ConfigurationContextApis;
/**
* Optional name of the client (e.g. TEE) hosting the page
*/
clientHost: string;
isHosted: boolean;
/**
* Current mail settings for TFS
*/
mailSettings: TfsMailSettings;
/**
* Server resource paths
*/
paths: ConfigurationContextPaths;
}
/**
* MVC api configuration
*/
interface ConfigurationContextApis {
/**
* Specifies the path prefix for the area
*/
areaPrefix: string;
/**
* Specifies the path prefix for the controller
*/
controllerPrefix: string;
/**
* Api-version for legacy rpc-style web access api controllers See WebApiVersionClient for the version coming from the client/browser. The return value is a positive whole number >= 1.
*/
webApiVersion: string;
}
/**
* Paths to server resources
*/
interface ConfigurationContextPaths {
/**
* Relative path to the _content path of the web application
*/
resourcesPath: string;
/**
* Relative path to the root of the web application
*/
rootPath: string;
/**
* Relative path to unversioned 3rd party static content
*/
staticRoot3rdParty: string;
/**
* Relative path to versioned static content
*/
staticRootTfs: string;
}
declare enum ContextHostType {
Unknown = 0,
/**
* The Deployment Host
*/
Deployment = 1,
/**
* The Application Host
*/
Application = 2,
/**
* The Project Collection
*/
ProjectCollection = 4,
}
interface ContextIdentifier {
id: string;
name: string;
}
/**
* Page context configuration that can be contributed by remote services (different VSO services delivering content to the page)
*/
interface ContributedServiceContext {
/**
* Specifies the prefixes for CSS modules that should map to the current service. e.g. "VSS/LoaderPlugins/Css!EMS:ExtensionManagement" would map to ExtensionManagement.css under the themed content path of this service if "EMS" is in the CSSModulePrefixes list.
*/
cssModulePrefixes: string[];
/**
* Feature flag states to include by default in page data (avoids AJAX lookup)
*/
featureAvailability: FeatureAvailabilityContext;
/**
* Module loader configuration which may be merged-in with the parent host (if injected into the DOM) Because the config may be merged with the host config, each root area path must be explicitly defined here rather than relying on basePath as a catch-all.
*/
moduleLoaderConfig: ModuleLoaderConfiguration;
/**
* Paths to resources on this service
*/
paths: ConfigurationContextPaths;
/**
* Lookup of urls for different services (at different host levels)
*/
serviceLocations: ServiceLocations;
/**
* The root url of the service that can be used to resolve relative links when this content is hosted in another site.
*/
serviceRootUrl: string;
/**
* Instance id of the service
*/
serviceTypeId: string;
}
/**
* An individual contribution made by an extension
*/
interface Contribution {
/**
* List of constraints (filters) that should be applied to the availability of this contribution
*/
constraints: ContributionConstraint[];
description: string;
id: string;
/**
* Properties/attributes of this contribution
*/
properties: any;
/**
* The ids of the contribution(s) that this contribution targets. (parent contributions)
*/
targets: string[];
/**
* Id of the Contribution Type
*/
type: string;
}
/**
* Base class shared by contributions and contribution types
*/
interface ContributionBase {
/**
* Description of the contribution/type
*/
description: string;
/**
* Extension-relative identifier of the contribution/type
*/
id: string;
}
/**
* Specifies a constraint that can be used to dynamically include/exclude a given contribution
*/
interface ContributionConstraint {
/**
* An optional property that can be specified to group constraints together. All constraints within a group are AND'd together (all must be evaluate to True in order for the contribution to be included). Different groups of constraints are OR'd (only one group needs to evaluate to True for the contribution to be included).
*/
group: number;
/**
* If true, negate the result of the filter (include the contribution if the applied filter returns false instead of true)
*/
inverse: boolean;
/**
* Name of the IContributionFilter class
*/
name: string;
/**
* Properties that are fed to the contribution filter class
*/
properties: any;
}
/**
* Model for a contribution context object which is used for contributed content provided by this service (e.g. Hubs). The content may be included in the parent DOM or iframed. This context provides information about how to popluate the content.
*/
interface ContributionContext {
/**
* CSS class for the container element which will host this content. Typical usage is to just supply a unique CSS class on the element, register an enhancement for that class in a TypeScript module, and reference that TypeScript module in this ContributionContent object.
*/
containerCssClass: string;
/**
* Generic property bag which individual contributions can use to pass data to the client
*/
contributionData: any;
/**
* Specifies the prefixes for CSS modules that should map to the current service. e.g. "VSS/LoaderPlugins/Css!EMS:ExtensionManagement" would map to ExtensionManagement.css under the themed content path of this service if "EMS" is in the CSSModulePrefixes list.
*/
cssModulePrefixes: string[];
/**
* List of CSS scripts to include as links with the content. Relative paths are resolved to Themed CSS urls.
*/
cssReferences: string[];
/**
* The root url for CSS files for the given theme
*/
cssThemedRoot: string;
/**
* Module loader configuration which may be merged-in with the parent host (if injected into the DOM) Because the config may be merged with the host config, each root area path must be explicitly defined here rather than relying on basePath as a catch-all.
*/
moduleLoaderConfig: ModuleLoaderConfiguration;
/**
* List of script modules to reference. e.g. "VSS/Controls/Grids". A require statement is issued for these modules
*/
scriptModules: string[];
/**
* Lookup of urls for different services (at different host levels)
*/
serviceLocations: ServiceLocations;
/**
* The root url of the service that can be used to resolve relative links when this content is hosted in another site.
*/
serviceUrl: string;
/**
* The static root url for this service
*/
staticRootUrl: string;
}
/**
* Identifier for contributions and contribution types
*/
interface ContributionIdentifier {
/**
* The extension id
*/
extensionId: string;
/**
* The full/unique identifier of the contribution/contributionType
*/
id: string;
/**
* The publisher id
*/
publisherId: string;
/**
* The extension-relative contribution id
*/
relativeId: string;
}
/**
* Item representing a contribution path. Can be of type default, resource or bundle
*/
interface ContributionPath {
/**
* Type if this contribution path
*/
pathType: ContributionPathType;
/**
* Replace value for this contribution path
*/
value: string;
}
/**
* Type of the contribution path
*/
declare enum ContributionPathType {
Default = 0,
Resource = 1,
}
/**
* Description about a property of a contribution type
*/
interface ContributionPropertyDescription {
/**
* Description of the property
*/
description: string;
/**
* Name of the property
*/
name: string;
/**
* True if this property is required
*/
required: boolean;
/**
* The type of value used for this property
*/
type: ContributionPropertyType;
}
/**
* The type of value used for a property
*/
declare enum ContributionPropertyType {
/**
* Contribution type is unknown (value may be anything)
*/
Unknown = 0,
/**
* Value is a string
*/
String = 1,
/**
* Value is a Uri
*/
Uri = 2,
/**
* Value is a GUID
*/
Guid = 4,
/**
* Value is True or False
*/
Boolean = 8,
/**
* Value is an integer
*/
Integer = 16,
/**
* Value is a double
*/
Double = 32,
/**
* Value is a DateTime object
*/
DateTime = 64,
/**
* Value is a generic Dictionary/JObject/property bag
*/
Dictionary = 128,
/**
* Value is an array
*/
Array = 256,
/**
* Value is an arbitrary/custom object
*/
Object = 512,
}
/**
* A contribution type, given by a json schema
*/
interface ContributionType {
description: string;
id: string;
/**
* Controls whether or not contributions of this type have the type indexed for queries. This allows clients to find all extensions that have a contribution of this type. NOTE: Only TrustedPartners are allowed to specify indexed contribution types.
*/
indexed: boolean;
/**
* Friendly name of the contribution/type
*/
name: string;
/**
* Describes the allowed properties for this contribution type
*/
properties: { [key: string]: ContributionPropertyDescription; };
}
/**
* Contains lists of script and css references that need to be included on the page in order for the controls used by the page to work.
*/
interface CoreReferencesContext {
/**
* Core javascript files referenced on a page
*/
scripts: JavascriptFileReference[];
/**
* Core CSS files referenced on a page
*/
stylesheets: StylesheetReference[];
}
interface DaylightSavingsAdjustmentEntry {
/**
* Millisecond adjustment from UTC
*/
offset: number;
/**
* Date that the offset adjustment starts
*/
start: Date;
}
interface DiagnosticsContext {
/**
* Id of the current activity
*/
activityId: string;
allowStatsCollection: boolean;
debugMode: boolean;
sessionId: string;
tracePointCollectionEnabled: boolean;
tracePointProfileEnd: string;
tracePointProfileStart: string;
}
interface ExtendedHostContext {
authority: string;
hostType: ContextHostType;
id: string;
isAADAccount: boolean;
name: string;
relativeUri: string;
scheme: string;
uri: string;
}
/**
* Represents a VSO "extension" which is a container for contributions and contribution types
*/
interface Extension {
baseUri: string;
contributions: Contribution[];
contributionTypes: ContributionType[];
eventCallbacks: ExtensionEventCallbackCollection;
/**
* The friendly extension id for this extension - unique for a given publisher.
*/
extensionId: string;
/**
* The display name of the extension.
*/
extensionName: string;
/**
* Extension flags relevant to contribution consumers
*/
flags: ExtensionFlags;
/**
* Globally unique id for this extension (the same id is used for all versions of a single extension)
*/
id: string;
language: string;
manifestVersion: any;
/**
* Unique id of the publisher of this extension
*/
publisherId: string;
/**
* The display name of the publisher
*/
publisherName: string;
/**
* Unique id for this extension (the same id is used for all versions of a single extension)
*/
registrationId: string;
scopes: string[];
/**
* Version of this extension
*/
version: string;
}
/**
* Base class for an event callback for an extension
*/
interface ExtensionEventCallback {
/**
* The uri of the endpoint that is hit when an event occurs
*/
uri: string;
}
/**
* Collection of event callbacks - endpoints called when particular extension events occur.
*/
interface ExtensionEventCallbackCollection {
/**
* For multi-version extensions, defines an endpoint that gets called via an OPTIONS request to determine the particular version of the extension to be used
*/
versionCheck: ExtensionEventCallback;
}
/**
* Set of flags applied to extensions that are relevant to contribution consumers
*/
declare enum ExtensionFlags {
/**
* A built-in extension is installed for all VSO accounts by default
*/
BuiltIn = 1,
/**
* The extension comes from a fully-trusted publisher
*/
Trusted = 2,
}
/**
* Base class for extension properties which are shared by the extension manifest and the extension model
*/
interface ExtensionManifest {
/**
* Uri used as base for other relative uri's defined in extension
*/
baseUri: string;
/**
* List of contributions made by this extension
*/
contributions: Contribution[];
/**
* List of contribution types defined by this extension
*/
contributionTypes: ContributionType[];
/**
* Collection of endpoints that get called when particular extension events occur
*/
eventCallbacks: ExtensionEventCallbackCollection;
/**
* Language Culture Name set by the Gallery
*/
language: string;
/**
* Version of the extension manifest format/content
*/
manifestVersion: any;
/**
* List of all oauth scopes required by this extension
*/
scopes: string[];
}
/**
* The state of an extension
*/
interface ExtensionState {
extensionId: string;
extensionName: string;
flags: any;
lastUpdated: Date;
/**
* The time at which the version was last checked
*/
lastVersionCheck: Date;
publisherName: string;
/**
* Version of this extension
*/
version: string;
}
interface FeatureAvailabilityContext {
featureStates: { [key: string]: boolean; };
}
interface GlobalizationContext {
culture: string;
theme: string;
timeZoneId: string;
timezoneOffset: number;
}
interface HostContext {
id: string;
name: string;
relativeUri: string;
uri: string;
}
/**
* Model representing a hub in VSO pages' navigation menu
*/
interface Hub {
groupId: string;
id: string;
isSelected: boolean;
name: string;
order: any;
uri: string;
}
/**
* Model representing a hub group in VSO pages' navigation menu
*/
interface HubGroup {
hasHubs: boolean;
id: string;
name: string;
order: any;
uri: string;
}
/**
* Context information containing the relevant hubs and hub groups for a given context
*/
interface HubsContext {
hubGroups: HubGroup[];
hubGroupsCollectionContributionId: string;
hubs: Hub[];
selectedHubGroupId: string;
selectedHubId: string;
}
/**
* Model to represent a TeamFoundationIdentity
*/
interface IdentityModel {
/**
* Custom display name
*/
customDisplayName: string;
/**
* Display name
*/
displayName: string;
/**
* Email address
*/
email: string;
/**
* Unique team foundation id
*/
id: string;
/**
* Is the identity active
*/
isActive: boolean;
/**
* Is the identity a group/team
*/
isContainer: boolean;
/**
* The provider's display name for this identity
*/
providerDisplayName: string;
/**
* Unique name for this identity
*/
uniqueName: string;
}
/**
* Reference to a javascript file to include on a page
*/
interface JavascriptFileReference {
/**
* Condition to check in the case that Url lives on a CDN. The fallback script will be included if this check fails.
*/
fallbackCondition: string;
/**
* Fallback url to use in case Url lives on a CDN
*/
fallbackUrl: string;
/**
* Id of the reference (JQuery, JQueryUI, MicrosoftAjax, etc.)
*/
identifier: string;
/**
* Is this a core javascript file that needs to be included on every page
*/
isCoreModule: boolean;
/**
* Url of the javascript reference
*/
url: string;
}
/**
* Class used to wrap arrays in an object.
*/
interface JsonArrayWrapper {
__wrappedArray: string;
}
interface MicrosoftAjaxConfig {
cultureInfo: any;
}
/**
* AMD javascript module loader configuration
*/
interface ModuleLoaderConfiguration {
baseUrl: string;
contributionPaths: { [key: string]: ContributionPath; };
paths: { [key: string]: string; };
shim: { [key: string]: ModuleLoaderShimConfiguration; };
}
/**
* AMD javascript module loader shim configuration
*/
interface ModuleLoaderShimConfiguration {
deps: string[];
exports: string;
}
/**
* Structure to specify current navigation context of the executing request. The navigation context content's are generally obtained from the request URL. Some context specifiers such as "Account" can be implicit and might come from current IVssServiceHost.
*/
interface NavigationContext {
/**
* A token to show which area the request has been targeted to. By default there are two areas "Admin" and "Api". They can be specified in the URL as _admin and _api respectively.
*/
area: string;
/**
* Current action route value
*/
currentAction: string;
/**
* Current controller route value
*/
currentController: string;
/**
* Current parameters route value (the path after the controller and action in the url)
*/
currentParameters: string;
/**
* Flag to show top most navigation context. For example the URL http://server:port/collection/project/_controller/action sets the Project bit while the URL http://server:port/collection/project/_admin/_controller/action sets also sets the area property to Admin.
*/
topMostLevel: NavigationContextLevels;
}
/**
* Flags to show which tokens of the navigation context are present in the current request URL. The request url's context part are formed like http://server:port[/{collection}[/{project}[/{team}]]][/_admin]/_{controller}/{action} The tokens {collection}, {project} and {team} are navigation level tokens whereas _admin segment is a switch to show admin areas of the site.
*/
declare enum NavigationContextLevels {
None = 0,
/**
* Root level in Azure.
*/
Deployment = 1,
/**
* Root level in on premises. Neither of {collection}, {project} and {team} tokens have information
*/
Application = 2,
/**
* Flag to show {collection} token has information.
*/
Collection = 4,
/**
* Flag to show {project} token has information.
*/
Project = 8,
/**
* Flag to show {team} token has information.
*/
Team = 16,
/**
* Sugar for all application levels.
*/
ApplicationAll = 30,
/**
* Sugar for all levels
*/
All = 31,
}
/**
* Global context placed on each VSSF web page (through json island data) which gives enough information for core TypeScript modules/controls on the page to operate
*/
interface PageContext {
/**
* Configuration for reporting telemetry/usage data to App Insights
*/
appInsightsConfiguration: AppInsightsConfiguration;
/**
* Core javascript and css references
*/
coreReferences: CoreReferencesContext;
/**
* Specifies the prefixes for CSS modules that should map to the current service. e.g. "VSS/LoaderPlugins/Css!EMS:ExtensionManagement" would map to ExtensionManagement.css under the themed content path of this service if "EMS" is in the CSSModulePrefixes list.
*/
cssModulePrefixes: string[];
/**
* Diagnostic related information for the current page
*/
diagnostics: DiagnosticsContext;
/**
* Feature flag states to include by default in page data (avoids AJAX lookup)
*/
featureAvailability: FeatureAvailabilityContext;
/**
* Globalization data for the current page based on the current user's settings
*/
globalization: GlobalizationContext;
/**
* Configuration needed for Microsoft.Ajax library
*/
microsoftAjaxConfig: MicrosoftAjaxConfig;
/**
* The (AMD) module configuration
*/
moduleLoaderConfig: ModuleLoaderConfiguration;
/**
* Current navigation context.
*/
navigation: NavigationContext;
/**
* The service instance type id for the VSO service serving this page
*/
serviceInstanceId: string;
serviceLocations: ServiceLocations;
/**
* Contains global time zone configuration information (e.g. which dates DST changes)
*/
timeZonesConfiguration: TimeZonesConfiguration;
/**
* Web Access configuration
*/
webAccessConfiguration: ConfigurationContext;
/**
* The web context information for the given page request
*/
webContext: WebContext;
}
interface Scope {
description: string;
title: string;
value: string;
}
/**
* Holds a lookup of urls for different services (at different host levels)
*/
interface ServiceLocations {
locations: { [key: string]: { [key: number]: string; }; };
}
/**
* Reference to a CSS file to include on a page
*/
interface StylesheetReference {
/**
* Url of the high-contrast version of the CSS file
*/
highContrastUrl: string;
/**
* Is this a core stylesheet that needs to be included in child frames
*/
isCoreStylesheet: boolean;
/**
* Url of the CSS file
*/
url: string;
}
/**
* Information about the extension
*/
interface SupportedExtension {
/**
* Unique Identifier for this extension
*/
extension: string;
/**
* Unique Identifier for this publisher
*/
publisher: string;
/**
* Supported version for this extension
*/
version: string;
}
interface TeamContext {
id: string;
name: string;
userIsAdmin: boolean;
userIsMember: boolean;
}
/**
* Data contract to represent a given team foundation service host (account, collection, deployment)
*/
interface TeamFoundationServiceHostModel {
/**
* Type of host (deployment, account, collection)
*/
hostType: any;
/**
* Unique id of the host (collection id, account id, etc.)
*/
instanceId: string;
/**
* Name of the host (collection name, account name, etc.)
*/
name: string;
/**
* Path of the service host, relative to the root virtual directory (e.g. DefaultCollection)
*/
relVDir: string;
/**
* Path of the service host relative to the web application root (e.g. /tfs/DefaultCollection)
*/
vDir: string;
}
interface TfsMailSettings {
enabled: boolean;
from: string;
}
/**
* Internal structure to describe IVssServiceHost
*/
interface TfsServiceHostDescriptor {
hostType: any;
id: string;
name: string;
relVdir: string;
vdir: string;
}
interface TimeZonesConfiguration {
daylightSavingsAdjustments: DaylightSavingsAdjustmentEntry[];
}
interface UserContext {
email: string;
id: string;
limitedAccess: boolean;
name: string;
uniqueName: string;
}
/**
* Web Access configuration data. This information is used to process requests on the server. This data is also placed in a json island on each page in order for JavaScript to know key configuration data required to things like construct proper urls
*/
interface WebAccessConfiguration {
/**
* Optional name of the client (e.g. TEE) hosting the page
*/
clientHost: string;
/**
* Current mail settings for TFS
*/
mailSettings: TfsMailSettings;
/**
* Relative path to the _content path of the web application
*/
resourcesPath: string;
/**
* Relative path to the root of the web application
*/
rootPath: string;
/**
* Relativ