TFS 확장 위젯을 구현할 때 우리 팀은 일부 VSO API를 사용하여 TFVC 또는 Git 인 현재 버전 제어 도구를 확인합니다. 우리는 거기에 API가 있다는 것을 발견했습니다 VersionCtrlRestClient
프로젝트 정보를 반환 할 수 있습니다. 그러나 다음 코드는 항상 401 NOT AUTHORIZED 오류로 실패합니다.TFS 확장 프로그램을 만들려고 할 때 Visual Studio Team Services (VSO) SDK getProjectInfo가 실패합니다.
import VersionCtrlRestClient = require("TFS/VersionControl/TfvcRestClient");
versionCtrlClient.getProjectInfo("MyProjectName")
.then(projectInfo => {
var cont = $("#content");
cont.append("<pre>" + "TFVC---" + projectInfo.supportsGit + "</pre>");
cont.append("<pre>" + "GIT ---" + projectInfo.supportsGit + "</pre>");
cont.append("<pre>" + "GIT ---" + projectInfo.defaultSourceControlType + "</pre>");
});
우리의 확장은 이미 다음과 같은 범위로 등록하고 versionCtrlClient
에서 코드 변경 사항을 조회 할 API를 호출 괜찮습니다.
"scopes": [ "vso.profile", "vso.work", "vso.work_write", "vso.code", "vso.code_write", "vso.code_manage" ]
누가 문제인지 알고 API 호출을 "인증"하는 방법을 알고 있습니까?
추신. getProjectInfo
의 API 문서에서, 그것은
* [Obsolete - Use the Projects API instead] Retrieve the version control information for a given Team Project
을 말한다 그러나 우리는 새로운 API를 찾을 수있는 위치를 대체 ???