Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function getWebApiWithProxy(
serviceUri: string,
accessToken?: string
): vsts.WebApi {
if (!accessToken) {
accessToken = getSystemAccessToken();
}
const credentialHandler = vsts.getBasicHandler("vsts", accessToken);
const options: IRequestOptions = {
proxy: tl.getHttpProxyConfiguration(serviceUri),
};
return new vsts.WebApi(serviceUri, credentialHandler, options);
}
export function getWebApiWithProxy(serviceUri: string, accessToken?: string): vsts.WebApi {
if (!accessToken) {
accessToken = getSystemAccessToken();
}
const credentialHandler = vsts.getBasicHandler('vsts', accessToken);
const options: IRequestOptions = {
proxy: tl.getHttpProxyConfiguration(serviceUri),
allowRetries: true,
maxRetries: 5
};
return new vsts.WebApi(serviceUri, credentialHandler, options);
}
export function getWebApiWithProxy(serviceUri: string, accessToken: string): api.WebApi {
const credentialHandler = api.getBasicHandler('vsts', accessToken);
const options: IRequestOptions = {
proxy: tl.getHttpProxyConfiguration(serviceUri),
allowRetries: true,
maxRetries: 5
};
return new api.WebApi(serviceUri, credentialHandler, options);
}
export function getWebApiWithProxy(
serviceUri: string,
accessToken?: string
): vsts.WebApi {
if (!accessToken) {
accessToken = getSystemAccessToken();
}
const credentialHandler = vsts.getBasicHandler("vsts", accessToken);
const options: IRequestOptions = {
proxy: tl.getHttpProxyConfiguration(serviceUri),
allowRetries: true,
maxRetries: 5
};
return new vsts.WebApi(serviceUri, credentialHandler, options);
}