Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static async getRestClients(accountUrl: string, PAT: string): Promise {
const authHandler = vsts.getPersonalAccessTokenHandler(PAT);
const vstsWebApi = new vsts.WebApi(accountUrl, authHandler);
try {
return {
"witApi": await vstsWebApi.getWorkItemTrackingApi(),
"witProcessApi": await vstsWebApi.getWorkItemTrackingProcessApi(),
"witProcessDefinitionApi": await vstsWebApi.getWorkItemTrackingProcessDefinitionApi(),
}
}
catch (error) {
throw new KnownError(`Failed to connect to account '${accountUrl}' using personal access token '' provided, check url and token.`);
}
}