UNPKG

7.66 kBTypeScriptView Raw
1import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces');
2import alertm = require('./AlertApi');
3import buildm = require('./BuildApi');
4import corem = require('./CoreApi');
5import dashboardm = require('./DashboardApi');
6import extmgmtm = require("./ExtensionManagementApi");
7import featuremgmtm = require("./FeatureManagementApi");
8import filecontainerm = require('./FileContainerApi');
9import gallerym = require('./GalleryApi');
10import gitm = require('./GitApi');
11import locationsm = require('./LocationsApi');
12import managementm = require('./ManagementApi');
13import notificationm = require('./NotificationApi');
14import policym = require('./PolicyApi');
15import profilem = require('./ProfileApi');
16import projectm = require('./ProjectAnalysisApi');
17import releasem = require('./ReleaseApi');
18import securityrolesm = require('./SecurityRolesApi');
19import taskagentm = require('./TaskAgentApi');
20import taskm = require('./TaskApi');
21import testm = require('./TestApi');
22import testplanm = require('./TestPlanApi');
23import testresultsm = require('./TestResultsApi');
24import tfvcm = require('./TfvcApi');
25import wikim = require('./WikiApi');
26import workm = require('./WorkApi');
27import pipelinesm = require('./PipelinesApi');
28import cixm = require('./CIXApi');
29import workitemtrackingm = require('./WorkItemTrackingApi');
30import workitemtrackingprocessm = require('./WorkItemTrackingProcessApi');
31import workitemtrackingprocessdefinitionm = require('./WorkItemTrackingProcessDefinitionsApi');
32import * as rm from 'typed-rest-client/RestClient';
33import vsom = require('./VsoClient');
34import lim = require("./interfaces/LocationsInterfaces");
35/**
36 * Methods to return handler objects (see handlers folder)
37 */
38export declare function getBasicHandler(username: string, password: string, allowCrossOriginAuthentication?: boolean): VsoBaseInterfaces.IRequestHandler;
39export declare function getNtlmHandler(username: string, password: string, workstation?: string, domain?: string): VsoBaseInterfaces.IRequestHandler;
40export declare function getBearerHandler(token: string, allowCrossOriginAuthentication?: boolean): VsoBaseInterfaces.IRequestHandler;
41export declare function getPersonalAccessTokenHandler(token: string, allowCrossOriginAuthentication?: boolean): VsoBaseInterfaces.IRequestHandler;
42export declare function getHandlerFromToken(token: string, allowCrossOriginAuthentication?: boolean): VsoBaseInterfaces.IRequestHandler;
43export interface IWebApiRequestSettings {
44 productName: string;
45 productVersion: string;
46}
47export declare class WebApi {
48 serverUrl: string;
49 authHandler: VsoBaseInterfaces.IRequestHandler;
50 rest: rm.RestClient;
51 vsoClient: vsom.VsoClient;
52 options: VsoBaseInterfaces.IRequestOptions;
53 private _resourceAreas;
54 constructor(defaultUrl: string, authHandler: VsoBaseInterfaces.IRequestHandler, options?: VsoBaseInterfaces.IRequestOptions, requestSettings?: IWebApiRequestSettings);
55 /**
56 * Convenience factory to create with a bearer token.
57 * @param defaultServerUrl default server url to use when creating new apis from factory methods
58 * @param defaultAuthHandler default authentication credentials to use when creating new apis from factory methods
59 */
60 static createWithBearerToken(defaultUrl: string, token: string, options?: VsoBaseInterfaces.IRequestOptions): WebApi;
61 connect(): Promise<lim.ConnectionData>;
62 /**
63 * Each factory method can take a serverUrl and a list of handlers
64 * if these aren't provided, the default url and auth handler given to the constructor for this class will be used
65 */
66 getAlertApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<alertm.IAlertApi>;
67 getBuildApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<buildm.IBuildApi>;
68 getCoreApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<corem.ICoreApi>;
69 getDashboardApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<dashboardm.IDashboardApi>;
70 getExtensionManagementApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<extmgmtm.IExtensionManagementApi>;
71 getFeatureManagementApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<featuremgmtm.IFeatureManagementApi>;
72 getFileContainerApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<filecontainerm.IFileContainerApi>;
73 getGalleryApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<gallerym.IGalleryApi>;
74 getGitApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<gitm.IGitApi>;
75 getLocationsApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<locationsm.ILocationsApi>;
76 getManagementApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<managementm.IManagementApi>;
77 getNotificationApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<notificationm.INotificationApi>;
78 getPolicyApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<policym.IPolicyApi>;
79 getProfileApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<profilem.IProfileApi>;
80 getProjectAnalysisApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<projectm.IProjectAnalysisApi>;
81 getSecurityRolesApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<securityrolesm.ISecurityRolesApi>;
82 getReleaseApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<releasem.IReleaseApi>;
83 getTaskApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<taskm.ITaskApi>;
84 getTaskAgentApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<taskagentm.ITaskAgentApi>;
85 getTestApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<testm.ITestApi>;
86 getTestPlanApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<testplanm.ITestPlanApi>;
87 getTestResultsApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<testresultsm.ITestResultsApi>;
88 getTfvcApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<tfvcm.ITfvcApi>;
89 getWikiApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<wikim.IWikiApi>;
90 getWorkApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<workm.IWorkApi>;
91 getWorkItemTrackingApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<workitemtrackingm.IWorkItemTrackingApi>;
92 getWorkItemTrackingProcessApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<workitemtrackingprocessm.IWorkItemTrackingProcessApi>;
93 getWorkItemTrackingProcessDefinitionApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<workitemtrackingprocessdefinitionm.IWorkItemTrackingProcessDefinitionsApi>;
94 getPipelinesApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<pipelinesm.IPipelinesApi>;
95 getCixApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<cixm.ICixApi>;
96 /**
97 * Determines if the domain is exluded for proxy via the no_proxy env var
98 * @param url: the server url
99 */
100 isNoProxyHost: (_url: string) => boolean;
101 private _getResourceAreaUrl;
102 private _getResourceAreas;
103 private _readTaskLibSecrets;
104}