azure-devops-extension-api 4.246.0 → 4.247.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SECURITY.md +41 -0
- package/{AdvancedSecurity.Reporting → bin/AdvancedSecurity.Reporting}/Reporting.d.ts +48 -0
- package/bin/AdvancedSecurity.Reporting/Reporting.js +32 -0
- package/bin/AdvancedSecurity.Reporting/Reporting.min.js +1 -0
- package/{Alert → bin/Alert}/Alert.d.ts +8 -8
- package/{Contributions → bin/Contributions}/ContributionsClient.js +2 -2
- package/{Contributions → bin/Contributions}/ContributionsClient.min.js +1 -1
- package/{ExtensionManagement → bin/ExtensionManagement}/ExtensionManagementClient.js +7 -7
- package/{ExtensionManagement → bin/ExtensionManagement}/ExtensionManagementClient.min.js +1 -1
- package/bin/LICENSE +21 -0
- package/bin/README.md +2 -0
- package/{TaskAgent → bin/TaskAgent}/TaskAgent.d.ts +8 -0
- package/{Test → bin/Test}/Test.d.ts +31 -7
- package/{TestPlan → bin/TestPlan}/TestPlan.d.ts +6 -2
- package/{TestResults → bin/TestResults}/TestResultsClient.d.ts +8 -0
- package/{TestResults → bin/TestResults}/TestResultsClient.js +23 -0
- package/{TestResults → bin/TestResults}/TestResultsClient.min.js +1 -1
- package/bin/package.json +37 -0
- package/buildpackage.js +80 -0
- package/package.json +1 -1
- package/src/Accounts/Accounts.ts +134 -0
- package/src/Accounts/AccountsClient.ts +83 -0
- package/src/Accounts/index.ts +2 -0
- package/src/AdvancedSecurity.Reporting/Reporting.ts +180 -0
- package/src/AdvancedSecurity.Reporting/ReportingClient.ts +47 -0
- package/src/Alert/Alert.ts +1037 -0
- package/src/Alert/AlertClient.ts +330 -0
- package/src/Boards/Boards.ts +684 -0
- package/src/Boards/BoardsClient.ts +593 -0
- package/src/Boards/index.ts +2 -0
- package/src/Build/Build.ts +3416 -0
- package/src/Build/BuildClient.ts +2740 -0
- package/src/Build/BuildServices.ts +39 -0
- package/src/Build/index.ts +3 -0
- package/src/Comments/Comments.ts +330 -0
- package/src/Comments/index.ts +1 -0
- package/src/Common/Client.ts +37 -0
- package/src/Common/CommonServices.ts +853 -0
- package/src/Common/Context.d.ts +46 -0
- package/src/Common/Fetch.ts +239 -0
- package/src/Common/RestClientBase.ts +186 -0
- package/src/Common/System.ts +36 -0
- package/src/Common/SystemData.ts +135 -0
- package/src/Common/Util/Serialization.ts +59 -0
- package/src/Common/Util/Url.ts +773 -0
- package/src/Common/index.ts +3 -0
- package/src/Contributions/Contributions.ts +708 -0
- package/src/Contributions/ContributionsClient.ts +109 -0
- package/src/Contributions/index.ts +2 -0
- package/src/Core/Core.ts +579 -0
- package/src/Core/CoreClient.ts +765 -0
- package/src/Core/index.ts +2 -0
- package/src/Dashboard/Dashboard.ts +419 -0
- package/src/Dashboard/DashboardClient.ts +370 -0
- package/src/Dashboard/WidgetConfigHelpers.ts +43 -0
- package/src/Dashboard/WidgetContracts.ts +226 -0
- package/src/Dashboard/WidgetHelpers.ts +145 -0
- package/src/Dashboard/index.ts +5 -0
- package/src/DistributedTaskCommon/DistributedTaskCommon.ts +108 -0
- package/src/DistributedTaskCommon/index.ts +1 -0
- package/src/ExtensionManagement/ExtensionManagement.ts +1205 -0
- package/src/ExtensionManagement/ExtensionManagementClient.ts +646 -0
- package/src/ExtensionManagement/index.ts +2 -0
- package/src/Favorite/Favorite.ts +136 -0
- package/src/Favorite/FavoriteClient.ts +301 -0
- package/src/FeatureAvailability/FeatureAvailability.ts +20 -0
- package/src/FeatureAvailability/FeatureAvailabilityClient.ts +153 -0
- package/src/FeatureAvailability/index.ts +2 -0
- package/src/FeatureManagement/FeatureManagement.ts +166 -0
- package/src/FeatureManagement/FeatureManagementClient.ts +246 -0
- package/src/FeatureManagement/index.ts +2 -0
- package/src/FileContainer/FileContainer.ts +205 -0
- package/src/FileContainer/FileContainerClient.ts +154 -0
- package/src/FileContainer/index.ts +2 -0
- package/src/FormInput/FormInput.ts +288 -0
- package/src/FormInput/index.ts +1 -0
- package/src/Gallery/Gallery.ts +1977 -0
- package/src/Gallery/GalleryClient.ts +2251 -0
- package/src/Gallery/index.ts +2 -0
- package/src/Git/CodeEditorTypes.ts +335 -0
- package/src/Git/Git.ts +4058 -0
- package/src/Git/GitClient.ts +4750 -0
- package/src/Git/GitServices.ts +18 -0
- package/src/Git/index.ts +4 -0
- package/src/Graph/Graph.ts +572 -0
- package/src/Graph/GraphClient.ts +846 -0
- package/src/Graph/index.ts +2 -0
- package/src/Identities/Identities.ts +261 -0
- package/src/Identities/IdentityProvider.ts +90 -0
- package/src/Identities/IdentityService.ts +89 -0
- package/src/Identities/index.ts +3 -0
- package/src/Locations/Locations.ts +165 -0
- package/src/Locations/LocationsClient.ts +220 -0
- package/src/Locations/index.ts +2 -0
- package/src/Management/Management.ts +172 -0
- package/src/Management/ManagementClient.ts +348 -0
- package/src/Notification/Notification.ts +1460 -0
- package/src/Notification/NotificationClient.ts +477 -0
- package/src/Notification/index.ts +2 -0
- package/src/Operations/Operations.ts +86 -0
- package/src/Operations/OperationsClient.ts +42 -0
- package/src/Operations/index.ts +2 -0
- package/src/Pipelines/Pipelines.ts +354 -0
- package/src/Pipelines/PipelinesClient.ts +306 -0
- package/src/Policy/Policy.ts +173 -0
- package/src/Policy/PolicyClient.ts +315 -0
- package/src/Policy/index.ts +2 -0
- package/src/Profile/Profile.ts +187 -0
- package/src/Profile/ProfileClient.ts +328 -0
- package/src/Profile/index.ts +2 -0
- package/src/ProjectAnalysis/ProjectAnalysis.ts +74 -0
- package/src/ProjectAnalysis/ProjectAnalysisClient.ts +124 -0
- package/src/ProjectAnalysis/index.ts +2 -0
- package/src/Release/Release.ts +4237 -0
- package/src/Release/ReleaseClient.ts +2450 -0
- package/src/Release/index.ts +2 -0
- package/src/ResourceUsage/ResourceUsage.ts +19 -0
- package/src/ResourceUsage/ResourceUsageClient.ts +48 -0
- package/src/ServiceEndpoint/ServiceEndpoint.ts +930 -0
- package/src/ServiceEndpoint/ServiceEndpointClient.ts +617 -0
- package/src/ServiceEndpoint/index.ts +2 -0
- package/src/ServiceHooks/ServiceHooks.ts +759 -0
- package/src/ServiceHooks/ServiceHooksClient.ts +499 -0
- package/src/ServiceHooks/index.ts +2 -0
- package/src/TaskAgent/TaskAgent.ts +3896 -0
- package/src/TaskAgent/TaskAgentClient.ts +3918 -0
- package/src/TaskAgent/index.ts +2 -0
- package/src/Test/Test.ts +5853 -0
- package/src/Test/TestClient.ts +2201 -0
- package/src/Test/index.ts +2 -0
- package/src/TestPlan/TestPlan.ts +1384 -0
- package/src/TestPlan/TestPlanClient.ts +1367 -0
- package/src/TestPlan/index.ts +2 -0
- package/{AdvancedSecurity.Reporting/Reporting.js → src/TestResults/TestResults.ts} +7 -5
- package/src/TestResults/TestResultsClient.ts +3450 -0
- package/src/TestResults/index.ts +2 -0
- package/src/Tfvc/Tfvc.ts +770 -0
- package/src/Tfvc/TfvcClient.ts +757 -0
- package/src/Tfvc/index.ts +2 -0
- package/src/WebApi/WebApi.ts +452 -0
- package/src/WebApi/index.ts +1 -0
- package/src/Wiki/Wiki.ts +352 -0
- package/src/Wiki/WikiClient.ts +712 -0
- package/src/Wiki/index.ts +2 -0
- package/src/Work/Work.ts +1367 -0
- package/src/Work/WorkClient.ts +1489 -0
- package/src/Work/index.ts +2 -0
- package/src/WorkItemTracking/WorkItemTracking.ts +2215 -0
- package/src/WorkItemTracking/WorkItemTrackingClient.ts +2032 -0
- package/src/WorkItemTracking/WorkItemTrackingServices.ts +329 -0
- package/src/WorkItemTracking/index.ts +3 -0
- package/src/WorkItemTrackingProcess/WorkItemTrackingProcess.ts +1295 -0
- package/src/WorkItemTrackingProcess/WorkItemTrackingProcessClient.ts +1455 -0
- package/src/WorkItemTrackingProcess/index.ts +2 -0
- package/src/WorkItemTrackingProcessDefinitions/WorkItemTrackingProcessDefinitions.ts +606 -0
- package/src/WorkItemTrackingProcessDefinitions/WorkItemTrackingProcessDefinitionsClient.ts +1175 -0
- package/src/WorkItemTrackingProcessDefinitions/index.ts +2 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +21 -0
- package/AdvancedSecurity.Reporting/Reporting.min.js +0 -1
- /package/{Accounts → bin/Accounts}/Accounts.d.ts +0 -0
- /package/{Accounts → bin/Accounts}/Accounts.js +0 -0
- /package/{Accounts → bin/Accounts}/Accounts.min.js +0 -0
- /package/{Accounts → bin/Accounts}/AccountsClient.d.ts +0 -0
- /package/{Accounts → bin/Accounts}/AccountsClient.js +0 -0
- /package/{Accounts → bin/Accounts}/AccountsClient.min.js +0 -0
- /package/{Accounts → bin/Accounts}/index.d.ts +0 -0
- /package/{Accounts → bin/Accounts}/index.js +0 -0
- /package/{Accounts → bin/Accounts}/index.min.js +0 -0
- /package/{AdvancedSecurity.Reporting → bin/AdvancedSecurity.Reporting}/ReportingClient.d.ts +0 -0
- /package/{AdvancedSecurity.Reporting → bin/AdvancedSecurity.Reporting}/ReportingClient.js +0 -0
- /package/{AdvancedSecurity.Reporting → bin/AdvancedSecurity.Reporting}/ReportingClient.min.js +0 -0
- /package/{Alert → bin/Alert}/Alert.js +0 -0
- /package/{Alert → bin/Alert}/Alert.min.js +0 -0
- /package/{Alert → bin/Alert}/AlertClient.d.ts +0 -0
- /package/{Alert → bin/Alert}/AlertClient.js +0 -0
- /package/{Alert → bin/Alert}/AlertClient.min.js +0 -0
- /package/{Boards → bin/Boards}/Boards.d.ts +0 -0
- /package/{Boards → bin/Boards}/Boards.js +0 -0
- /package/{Boards → bin/Boards}/Boards.min.js +0 -0
- /package/{Boards → bin/Boards}/BoardsClient.d.ts +0 -0
- /package/{Boards → bin/Boards}/BoardsClient.js +0 -0
- /package/{Boards → bin/Boards}/BoardsClient.min.js +0 -0
- /package/{Boards → bin/Boards}/index.d.ts +0 -0
- /package/{Boards → bin/Boards}/index.js +0 -0
- /package/{Boards → bin/Boards}/index.min.js +0 -0
- /package/{Build → bin/Build}/Build.d.ts +0 -0
- /package/{Build → bin/Build}/Build.js +0 -0
- /package/{Build → bin/Build}/Build.min.js +0 -0
- /package/{Build → bin/Build}/BuildClient.d.ts +0 -0
- /package/{Build → bin/Build}/BuildClient.js +0 -0
- /package/{Build → bin/Build}/BuildClient.min.js +0 -0
- /package/{Build → bin/Build}/BuildServices.d.ts +0 -0
- /package/{Build → bin/Build}/BuildServices.js +0 -0
- /package/{Build → bin/Build}/BuildServices.min.js +0 -0
- /package/{Build → bin/Build}/index.d.ts +0 -0
- /package/{Build → bin/Build}/index.js +0 -0
- /package/{Build → bin/Build}/index.min.js +0 -0
- /package/{Comments → bin/Comments}/Comments.d.ts +0 -0
- /package/{Comments → bin/Comments}/Comments.js +0 -0
- /package/{Comments → bin/Comments}/Comments.min.js +0 -0
- /package/{Comments → bin/Comments}/index.d.ts +0 -0
- /package/{Comments → bin/Comments}/index.js +0 -0
- /package/{Comments → bin/Comments}/index.min.js +0 -0
- /package/{Common → bin/Common}/Client.d.ts +0 -0
- /package/{Common → bin/Common}/Client.js +0 -0
- /package/{Common → bin/Common}/Client.min.js +0 -0
- /package/{Common → bin/Common}/CommonServices.d.ts +0 -0
- /package/{Common → bin/Common}/CommonServices.js +0 -0
- /package/{Common → bin/Common}/CommonServices.min.js +0 -0
- /package/{Common → bin/Common}/Context.d.ts +0 -0
- /package/{Common → bin/Common}/Fetch.d.ts +0 -0
- /package/{Common → bin/Common}/Fetch.js +0 -0
- /package/{Common → bin/Common}/Fetch.min.js +0 -0
- /package/{Common → bin/Common}/RestClientBase.d.ts +0 -0
- /package/{Common → bin/Common}/RestClientBase.js +0 -0
- /package/{Common → bin/Common}/RestClientBase.min.js +0 -0
- /package/{Common → bin/Common}/System.d.ts +0 -0
- /package/{Common → bin/Common}/System.js +0 -0
- /package/{Common → bin/Common}/System.min.js +0 -0
- /package/{Common → bin/Common}/SystemData.d.ts +0 -0
- /package/{Common → bin/Common}/SystemData.js +0 -0
- /package/{Common → bin/Common}/SystemData.min.js +0 -0
- /package/{Common → bin/Common}/Util/Serialization.d.ts +0 -0
- /package/{Common → bin/Common}/Util/Serialization.js +0 -0
- /package/{Common → bin/Common}/Util/Serialization.min.js +0 -0
- /package/{Common → bin/Common}/Util/Url.d.ts +0 -0
- /package/{Common → bin/Common}/Util/Url.js +0 -0
- /package/{Common → bin/Common}/Util/Url.min.js +0 -0
- /package/{Common → bin/Common}/index.d.ts +0 -0
- /package/{Common → bin/Common}/index.js +0 -0
- /package/{Common → bin/Common}/index.min.js +0 -0
- /package/{Contributions → bin/Contributions}/Contributions.d.ts +0 -0
- /package/{Contributions → bin/Contributions}/Contributions.js +0 -0
- /package/{Contributions → bin/Contributions}/Contributions.min.js +0 -0
- /package/{Contributions → bin/Contributions}/ContributionsClient.d.ts +0 -0
- /package/{Contributions → bin/Contributions}/index.d.ts +0 -0
- /package/{Contributions → bin/Contributions}/index.js +0 -0
- /package/{Contributions → bin/Contributions}/index.min.js +0 -0
- /package/{Core → bin/Core}/Core.d.ts +0 -0
- /package/{Core → bin/Core}/Core.js +0 -0
- /package/{Core → bin/Core}/Core.min.js +0 -0
- /package/{Core → bin/Core}/CoreClient.d.ts +0 -0
- /package/{Core → bin/Core}/CoreClient.js +0 -0
- /package/{Core → bin/Core}/CoreClient.min.js +0 -0
- /package/{Core → bin/Core}/index.d.ts +0 -0
- /package/{Core → bin/Core}/index.js +0 -0
- /package/{Core → bin/Core}/index.min.js +0 -0
- /package/{Dashboard → bin/Dashboard}/Dashboard.d.ts +0 -0
- /package/{Dashboard → bin/Dashboard}/Dashboard.js +0 -0
- /package/{Dashboard → bin/Dashboard}/Dashboard.min.js +0 -0
- /package/{Dashboard → bin/Dashboard}/DashboardClient.d.ts +0 -0
- /package/{Dashboard → bin/Dashboard}/DashboardClient.js +0 -0
- /package/{Dashboard → bin/Dashboard}/DashboardClient.min.js +0 -0
- /package/{Dashboard → bin/Dashboard}/WidgetConfigHelpers.d.ts +0 -0
- /package/{Dashboard → bin/Dashboard}/WidgetConfigHelpers.js +0 -0
- /package/{Dashboard → bin/Dashboard}/WidgetConfigHelpers.min.js +0 -0
- /package/{Dashboard → bin/Dashboard}/WidgetContracts.d.ts +0 -0
- /package/{Dashboard → bin/Dashboard}/WidgetContracts.js +0 -0
- /package/{Dashboard → bin/Dashboard}/WidgetContracts.min.js +0 -0
- /package/{Dashboard → bin/Dashboard}/WidgetHelpers.d.ts +0 -0
- /package/{Dashboard → bin/Dashboard}/WidgetHelpers.js +0 -0
- /package/{Dashboard → bin/Dashboard}/WidgetHelpers.min.js +0 -0
- /package/{Dashboard → bin/Dashboard}/index.d.ts +0 -0
- /package/{Dashboard → bin/Dashboard}/index.js +0 -0
- /package/{Dashboard → bin/Dashboard}/index.min.js +0 -0
- /package/{DistributedTaskCommon → bin/DistributedTaskCommon}/DistributedTaskCommon.d.ts +0 -0
- /package/{DistributedTaskCommon → bin/DistributedTaskCommon}/DistributedTaskCommon.js +0 -0
- /package/{DistributedTaskCommon → bin/DistributedTaskCommon}/DistributedTaskCommon.min.js +0 -0
- /package/{DistributedTaskCommon → bin/DistributedTaskCommon}/index.d.ts +0 -0
- /package/{DistributedTaskCommon → bin/DistributedTaskCommon}/index.js +0 -0
- /package/{DistributedTaskCommon → bin/DistributedTaskCommon}/index.min.js +0 -0
- /package/{ExtensionManagement → bin/ExtensionManagement}/ExtensionManagement.d.ts +0 -0
- /package/{ExtensionManagement → bin/ExtensionManagement}/ExtensionManagement.js +0 -0
- /package/{ExtensionManagement → bin/ExtensionManagement}/ExtensionManagement.min.js +0 -0
- /package/{ExtensionManagement → bin/ExtensionManagement}/ExtensionManagementClient.d.ts +0 -0
- /package/{ExtensionManagement → bin/ExtensionManagement}/index.d.ts +0 -0
- /package/{ExtensionManagement → bin/ExtensionManagement}/index.js +0 -0
- /package/{ExtensionManagement → bin/ExtensionManagement}/index.min.js +0 -0
- /package/{Favorite → bin/Favorite}/Favorite.d.ts +0 -0
- /package/{Favorite → bin/Favorite}/Favorite.js +0 -0
- /package/{Favorite → bin/Favorite}/Favorite.min.js +0 -0
- /package/{Favorite → bin/Favorite}/FavoriteClient.d.ts +0 -0
- /package/{Favorite → bin/Favorite}/FavoriteClient.js +0 -0
- /package/{Favorite → bin/Favorite}/FavoriteClient.min.js +0 -0
- /package/{FeatureAvailability → bin/FeatureAvailability}/FeatureAvailability.d.ts +0 -0
- /package/{FeatureAvailability → bin/FeatureAvailability}/FeatureAvailability.js +0 -0
- /package/{FeatureAvailability → bin/FeatureAvailability}/FeatureAvailability.min.js +0 -0
- /package/{FeatureAvailability → bin/FeatureAvailability}/FeatureAvailabilityClient.d.ts +0 -0
- /package/{FeatureAvailability → bin/FeatureAvailability}/FeatureAvailabilityClient.js +0 -0
- /package/{FeatureAvailability → bin/FeatureAvailability}/FeatureAvailabilityClient.min.js +0 -0
- /package/{FeatureAvailability → bin/FeatureAvailability}/index.d.ts +0 -0
- /package/{FeatureAvailability → bin/FeatureAvailability}/index.js +0 -0
- /package/{FeatureAvailability → bin/FeatureAvailability}/index.min.js +0 -0
- /package/{FeatureManagement → bin/FeatureManagement}/FeatureManagement.d.ts +0 -0
- /package/{FeatureManagement → bin/FeatureManagement}/FeatureManagement.js +0 -0
- /package/{FeatureManagement → bin/FeatureManagement}/FeatureManagement.min.js +0 -0
- /package/{FeatureManagement → bin/FeatureManagement}/FeatureManagementClient.d.ts +0 -0
- /package/{FeatureManagement → bin/FeatureManagement}/FeatureManagementClient.js +0 -0
- /package/{FeatureManagement → bin/FeatureManagement}/FeatureManagementClient.min.js +0 -0
- /package/{FeatureManagement → bin/FeatureManagement}/index.d.ts +0 -0
- /package/{FeatureManagement → bin/FeatureManagement}/index.js +0 -0
- /package/{FeatureManagement → bin/FeatureManagement}/index.min.js +0 -0
- /package/{FileContainer → bin/FileContainer}/FileContainer.d.ts +0 -0
- /package/{FileContainer → bin/FileContainer}/FileContainer.js +0 -0
- /package/{FileContainer → bin/FileContainer}/FileContainer.min.js +0 -0
- /package/{FileContainer → bin/FileContainer}/FileContainerClient.d.ts +0 -0
- /package/{FileContainer → bin/FileContainer}/FileContainerClient.js +0 -0
- /package/{FileContainer → bin/FileContainer}/FileContainerClient.min.js +0 -0
- /package/{FileContainer → bin/FileContainer}/index.d.ts +0 -0
- /package/{FileContainer → bin/FileContainer}/index.js +0 -0
- /package/{FileContainer → bin/FileContainer}/index.min.js +0 -0
- /package/{FormInput → bin/FormInput}/FormInput.d.ts +0 -0
- /package/{FormInput → bin/FormInput}/FormInput.js +0 -0
- /package/{FormInput → bin/FormInput}/FormInput.min.js +0 -0
- /package/{FormInput → bin/FormInput}/index.d.ts +0 -0
- /package/{FormInput → bin/FormInput}/index.js +0 -0
- /package/{FormInput → bin/FormInput}/index.min.js +0 -0
- /package/{Gallery → bin/Gallery}/Gallery.d.ts +0 -0
- /package/{Gallery → bin/Gallery}/Gallery.js +0 -0
- /package/{Gallery → bin/Gallery}/Gallery.min.js +0 -0
- /package/{Gallery → bin/Gallery}/GalleryClient.d.ts +0 -0
- /package/{Gallery → bin/Gallery}/GalleryClient.js +0 -0
- /package/{Gallery → bin/Gallery}/GalleryClient.min.js +0 -0
- /package/{Gallery → bin/Gallery}/index.d.ts +0 -0
- /package/{Gallery → bin/Gallery}/index.js +0 -0
- /package/{Gallery → bin/Gallery}/index.min.js +0 -0
- /package/{Git → bin/Git}/CodeEditorTypes.d.ts +0 -0
- /package/{Git → bin/Git}/CodeEditorTypes.js +0 -0
- /package/{Git → bin/Git}/CodeEditorTypes.min.js +0 -0
- /package/{Git → bin/Git}/Git.d.ts +0 -0
- /package/{Git → bin/Git}/Git.js +0 -0
- /package/{Git → bin/Git}/Git.min.js +0 -0
- /package/{Git → bin/Git}/GitClient.d.ts +0 -0
- /package/{Git → bin/Git}/GitClient.js +0 -0
- /package/{Git → bin/Git}/GitClient.min.js +0 -0
- /package/{Git → bin/Git}/GitServices.d.ts +0 -0
- /package/{Git → bin/Git}/GitServices.js +0 -0
- /package/{Git → bin/Git}/GitServices.min.js +0 -0
- /package/{Git → bin/Git}/index.d.ts +0 -0
- /package/{Git → bin/Git}/index.js +0 -0
- /package/{Git → bin/Git}/index.min.js +0 -0
- /package/{Graph → bin/Graph}/Graph.d.ts +0 -0
- /package/{Graph → bin/Graph}/Graph.js +0 -0
- /package/{Graph → bin/Graph}/Graph.min.js +0 -0
- /package/{Graph → bin/Graph}/GraphClient.d.ts +0 -0
- /package/{Graph → bin/Graph}/GraphClient.js +0 -0
- /package/{Graph → bin/Graph}/GraphClient.min.js +0 -0
- /package/{Graph → bin/Graph}/index.d.ts +0 -0
- /package/{Graph → bin/Graph}/index.js +0 -0
- /package/{Graph → bin/Graph}/index.min.js +0 -0
- /package/{Identities → bin/Identities}/Identities.d.ts +0 -0
- /package/{Identities → bin/Identities}/Identities.js +0 -0
- /package/{Identities → bin/Identities}/Identities.min.js +0 -0
- /package/{Identities → bin/Identities}/IdentityProvider.d.ts +0 -0
- /package/{Identities → bin/Identities}/IdentityProvider.js +0 -0
- /package/{Identities → bin/Identities}/IdentityProvider.min.js +0 -0
- /package/{Identities → bin/Identities}/IdentityService.d.ts +0 -0
- /package/{Identities → bin/Identities}/IdentityService.js +0 -0
- /package/{Identities → bin/Identities}/IdentityService.min.js +0 -0
- /package/{Identities → bin/Identities}/index.d.ts +0 -0
- /package/{Identities → bin/Identities}/index.js +0 -0
- /package/{Identities → bin/Identities}/index.min.js +0 -0
- /package/{Locations → bin/Locations}/Locations.d.ts +0 -0
- /package/{Locations → bin/Locations}/Locations.js +0 -0
- /package/{Locations → bin/Locations}/Locations.min.js +0 -0
- /package/{Locations → bin/Locations}/LocationsClient.d.ts +0 -0
- /package/{Locations → bin/Locations}/LocationsClient.js +0 -0
- /package/{Locations → bin/Locations}/LocationsClient.min.js +0 -0
- /package/{Locations → bin/Locations}/index.d.ts +0 -0
- /package/{Locations → bin/Locations}/index.js +0 -0
- /package/{Locations → bin/Locations}/index.min.js +0 -0
- /package/{Management → bin/Management}/Management.d.ts +0 -0
- /package/{Management → bin/Management}/Management.js +0 -0
- /package/{Management → bin/Management}/Management.min.js +0 -0
- /package/{Management → bin/Management}/ManagementClient.d.ts +0 -0
- /package/{Management → bin/Management}/ManagementClient.js +0 -0
- /package/{Management → bin/Management}/ManagementClient.min.js +0 -0
- /package/{Notification → bin/Notification}/Notification.d.ts +0 -0
- /package/{Notification → bin/Notification}/Notification.js +0 -0
- /package/{Notification → bin/Notification}/Notification.min.js +0 -0
- /package/{Notification → bin/Notification}/NotificationClient.d.ts +0 -0
- /package/{Notification → bin/Notification}/NotificationClient.js +0 -0
- /package/{Notification → bin/Notification}/NotificationClient.min.js +0 -0
- /package/{Notification → bin/Notification}/index.d.ts +0 -0
- /package/{Notification → bin/Notification}/index.js +0 -0
- /package/{Notification → bin/Notification}/index.min.js +0 -0
- /package/{Operations → bin/Operations}/Operations.d.ts +0 -0
- /package/{Operations → bin/Operations}/Operations.js +0 -0
- /package/{Operations → bin/Operations}/Operations.min.js +0 -0
- /package/{Operations → bin/Operations}/OperationsClient.d.ts +0 -0
- /package/{Operations → bin/Operations}/OperationsClient.js +0 -0
- /package/{Operations → bin/Operations}/OperationsClient.min.js +0 -0
- /package/{Operations → bin/Operations}/index.d.ts +0 -0
- /package/{Operations → bin/Operations}/index.js +0 -0
- /package/{Operations → bin/Operations}/index.min.js +0 -0
- /package/{Pipelines → bin/Pipelines}/Pipelines.d.ts +0 -0
- /package/{Pipelines → bin/Pipelines}/Pipelines.js +0 -0
- /package/{Pipelines → bin/Pipelines}/Pipelines.min.js +0 -0
- /package/{Pipelines → bin/Pipelines}/PipelinesClient.d.ts +0 -0
- /package/{Pipelines → bin/Pipelines}/PipelinesClient.js +0 -0
- /package/{Pipelines → bin/Pipelines}/PipelinesClient.min.js +0 -0
- /package/{Policy → bin/Policy}/Policy.d.ts +0 -0
- /package/{Policy → bin/Policy}/Policy.js +0 -0
- /package/{Policy → bin/Policy}/Policy.min.js +0 -0
- /package/{Policy → bin/Policy}/PolicyClient.d.ts +0 -0
- /package/{Policy → bin/Policy}/PolicyClient.js +0 -0
- /package/{Policy → bin/Policy}/PolicyClient.min.js +0 -0
- /package/{Policy → bin/Policy}/index.d.ts +0 -0
- /package/{Policy → bin/Policy}/index.js +0 -0
- /package/{Policy → bin/Policy}/index.min.js +0 -0
- /package/{Profile → bin/Profile}/Profile.d.ts +0 -0
- /package/{Profile → bin/Profile}/Profile.js +0 -0
- /package/{Profile → bin/Profile}/Profile.min.js +0 -0
- /package/{Profile → bin/Profile}/ProfileClient.d.ts +0 -0
- /package/{Profile → bin/Profile}/ProfileClient.js +0 -0
- /package/{Profile → bin/Profile}/ProfileClient.min.js +0 -0
- /package/{Profile → bin/Profile}/index.d.ts +0 -0
- /package/{Profile → bin/Profile}/index.js +0 -0
- /package/{Profile → bin/Profile}/index.min.js +0 -0
- /package/{ProjectAnalysis → bin/ProjectAnalysis}/ProjectAnalysis.d.ts +0 -0
- /package/{ProjectAnalysis → bin/ProjectAnalysis}/ProjectAnalysis.js +0 -0
- /package/{ProjectAnalysis → bin/ProjectAnalysis}/ProjectAnalysis.min.js +0 -0
- /package/{ProjectAnalysis → bin/ProjectAnalysis}/ProjectAnalysisClient.d.ts +0 -0
- /package/{ProjectAnalysis → bin/ProjectAnalysis}/ProjectAnalysisClient.js +0 -0
- /package/{ProjectAnalysis → bin/ProjectAnalysis}/ProjectAnalysisClient.min.js +0 -0
- /package/{ProjectAnalysis → bin/ProjectAnalysis}/index.d.ts +0 -0
- /package/{ProjectAnalysis → bin/ProjectAnalysis}/index.js +0 -0
- /package/{ProjectAnalysis → bin/ProjectAnalysis}/index.min.js +0 -0
- /package/{Release → bin/Release}/Release.d.ts +0 -0
- /package/{Release → bin/Release}/Release.js +0 -0
- /package/{Release → bin/Release}/Release.min.js +0 -0
- /package/{Release → bin/Release}/ReleaseClient.d.ts +0 -0
- /package/{Release → bin/Release}/ReleaseClient.js +0 -0
- /package/{Release → bin/Release}/ReleaseClient.min.js +0 -0
- /package/{Release → bin/Release}/index.d.ts +0 -0
- /package/{Release → bin/Release}/index.js +0 -0
- /package/{Release → bin/Release}/index.min.js +0 -0
- /package/{ResourceUsage → bin/ResourceUsage}/ResourceUsage.d.ts +0 -0
- /package/{ResourceUsage → bin/ResourceUsage}/ResourceUsage.js +0 -0
- /package/{ResourceUsage → bin/ResourceUsage}/ResourceUsage.min.js +0 -0
- /package/{ResourceUsage → bin/ResourceUsage}/ResourceUsageClient.d.ts +0 -0
- /package/{ResourceUsage → bin/ResourceUsage}/ResourceUsageClient.js +0 -0
- /package/{ResourceUsage → bin/ResourceUsage}/ResourceUsageClient.min.js +0 -0
- /package/{ServiceEndpoint → bin/ServiceEndpoint}/ServiceEndpoint.d.ts +0 -0
- /package/{ServiceEndpoint → bin/ServiceEndpoint}/ServiceEndpoint.js +0 -0
- /package/{ServiceEndpoint → bin/ServiceEndpoint}/ServiceEndpoint.min.js +0 -0
- /package/{ServiceEndpoint → bin/ServiceEndpoint}/ServiceEndpointClient.d.ts +0 -0
- /package/{ServiceEndpoint → bin/ServiceEndpoint}/ServiceEndpointClient.js +0 -0
- /package/{ServiceEndpoint → bin/ServiceEndpoint}/ServiceEndpointClient.min.js +0 -0
- /package/{ServiceEndpoint → bin/ServiceEndpoint}/index.d.ts +0 -0
- /package/{ServiceEndpoint → bin/ServiceEndpoint}/index.js +0 -0
- /package/{ServiceEndpoint → bin/ServiceEndpoint}/index.min.js +0 -0
- /package/{ServiceHooks → bin/ServiceHooks}/ServiceHooks.d.ts +0 -0
- /package/{ServiceHooks → bin/ServiceHooks}/ServiceHooks.js +0 -0
- /package/{ServiceHooks → bin/ServiceHooks}/ServiceHooks.min.js +0 -0
- /package/{ServiceHooks → bin/ServiceHooks}/ServiceHooksClient.d.ts +0 -0
- /package/{ServiceHooks → bin/ServiceHooks}/ServiceHooksClient.js +0 -0
- /package/{ServiceHooks → bin/ServiceHooks}/ServiceHooksClient.min.js +0 -0
- /package/{ServiceHooks → bin/ServiceHooks}/index.d.ts +0 -0
- /package/{ServiceHooks → bin/ServiceHooks}/index.js +0 -0
- /package/{ServiceHooks → bin/ServiceHooks}/index.min.js +0 -0
- /package/{TaskAgent → bin/TaskAgent}/TaskAgent.js +0 -0
- /package/{TaskAgent → bin/TaskAgent}/TaskAgent.min.js +0 -0
- /package/{TaskAgent → bin/TaskAgent}/TaskAgentClient.d.ts +0 -0
- /package/{TaskAgent → bin/TaskAgent}/TaskAgentClient.js +0 -0
- /package/{TaskAgent → bin/TaskAgent}/TaskAgentClient.min.js +0 -0
- /package/{TaskAgent → bin/TaskAgent}/index.d.ts +0 -0
- /package/{TaskAgent → bin/TaskAgent}/index.js +0 -0
- /package/{TaskAgent → bin/TaskAgent}/index.min.js +0 -0
- /package/{Test → bin/Test}/Test.js +0 -0
- /package/{Test → bin/Test}/Test.min.js +0 -0
- /package/{Test → bin/Test}/TestClient.d.ts +0 -0
- /package/{Test → bin/Test}/TestClient.js +0 -0
- /package/{Test → bin/Test}/TestClient.min.js +0 -0
- /package/{Test → bin/Test}/index.d.ts +0 -0
- /package/{Test → bin/Test}/index.js +0 -0
- /package/{Test → bin/Test}/index.min.js +0 -0
- /package/{TestPlan → bin/TestPlan}/TestPlan.js +0 -0
- /package/{TestPlan → bin/TestPlan}/TestPlan.min.js +0 -0
- /package/{TestPlan → bin/TestPlan}/TestPlanClient.d.ts +0 -0
- /package/{TestPlan → bin/TestPlan}/TestPlanClient.js +0 -0
- /package/{TestPlan → bin/TestPlan}/TestPlanClient.min.js +0 -0
- /package/{TestPlan → bin/TestPlan}/index.d.ts +0 -0
- /package/{TestPlan → bin/TestPlan}/index.js +0 -0
- /package/{TestPlan → bin/TestPlan}/index.min.js +0 -0
- /package/{TestResults → bin/TestResults}/TestResults.d.ts +0 -0
- /package/{TestResults → bin/TestResults}/TestResults.js +0 -0
- /package/{TestResults → bin/TestResults}/TestResults.min.js +0 -0
- /package/{TestResults → bin/TestResults}/index.d.ts +0 -0
- /package/{TestResults → bin/TestResults}/index.js +0 -0
- /package/{TestResults → bin/TestResults}/index.min.js +0 -0
- /package/{Tfvc → bin/Tfvc}/Tfvc.d.ts +0 -0
- /package/{Tfvc → bin/Tfvc}/Tfvc.js +0 -0
- /package/{Tfvc → bin/Tfvc}/Tfvc.min.js +0 -0
- /package/{Tfvc → bin/Tfvc}/TfvcClient.d.ts +0 -0
- /package/{Tfvc → bin/Tfvc}/TfvcClient.js +0 -0
- /package/{Tfvc → bin/Tfvc}/TfvcClient.min.js +0 -0
- /package/{Tfvc → bin/Tfvc}/index.d.ts +0 -0
- /package/{Tfvc → bin/Tfvc}/index.js +0 -0
- /package/{Tfvc → bin/Tfvc}/index.min.js +0 -0
- /package/{WebApi → bin/WebApi}/WebApi.d.ts +0 -0
- /package/{WebApi → bin/WebApi}/WebApi.js +0 -0
- /package/{WebApi → bin/WebApi}/WebApi.min.js +0 -0
- /package/{WebApi → bin/WebApi}/index.d.ts +0 -0
- /package/{WebApi → bin/WebApi}/index.js +0 -0
- /package/{WebApi → bin/WebApi}/index.min.js +0 -0
- /package/{Wiki → bin/Wiki}/Wiki.d.ts +0 -0
- /package/{Wiki → bin/Wiki}/Wiki.js +0 -0
- /package/{Wiki → bin/Wiki}/Wiki.min.js +0 -0
- /package/{Wiki → bin/Wiki}/WikiClient.d.ts +0 -0
- /package/{Wiki → bin/Wiki}/WikiClient.js +0 -0
- /package/{Wiki → bin/Wiki}/WikiClient.min.js +0 -0
- /package/{Wiki → bin/Wiki}/index.d.ts +0 -0
- /package/{Wiki → bin/Wiki}/index.js +0 -0
- /package/{Wiki → bin/Wiki}/index.min.js +0 -0
- /package/{Work → bin/Work}/Work.d.ts +0 -0
- /package/{Work → bin/Work}/Work.js +0 -0
- /package/{Work → bin/Work}/Work.min.js +0 -0
- /package/{Work → bin/Work}/WorkClient.d.ts +0 -0
- /package/{Work → bin/Work}/WorkClient.js +0 -0
- /package/{Work → bin/Work}/WorkClient.min.js +0 -0
- /package/{Work → bin/Work}/index.d.ts +0 -0
- /package/{Work → bin/Work}/index.js +0 -0
- /package/{Work → bin/Work}/index.min.js +0 -0
- /package/{WorkItemTracking → bin/WorkItemTracking}/WorkItemTracking.d.ts +0 -0
- /package/{WorkItemTracking → bin/WorkItemTracking}/WorkItemTracking.js +0 -0
- /package/{WorkItemTracking → bin/WorkItemTracking}/WorkItemTracking.min.js +0 -0
- /package/{WorkItemTracking → bin/WorkItemTracking}/WorkItemTrackingClient.d.ts +0 -0
- /package/{WorkItemTracking → bin/WorkItemTracking}/WorkItemTrackingClient.js +0 -0
- /package/{WorkItemTracking → bin/WorkItemTracking}/WorkItemTrackingClient.min.js +0 -0
- /package/{WorkItemTracking → bin/WorkItemTracking}/WorkItemTrackingServices.d.ts +0 -0
- /package/{WorkItemTracking → bin/WorkItemTracking}/WorkItemTrackingServices.js +0 -0
- /package/{WorkItemTracking → bin/WorkItemTracking}/WorkItemTrackingServices.min.js +0 -0
- /package/{WorkItemTracking → bin/WorkItemTracking}/index.d.ts +0 -0
- /package/{WorkItemTracking → bin/WorkItemTracking}/index.js +0 -0
- /package/{WorkItemTracking → bin/WorkItemTracking}/index.min.js +0 -0
- /package/{WorkItemTrackingProcess → bin/WorkItemTrackingProcess}/WorkItemTrackingProcess.d.ts +0 -0
- /package/{WorkItemTrackingProcess → bin/WorkItemTrackingProcess}/WorkItemTrackingProcess.js +0 -0
- /package/{WorkItemTrackingProcess → bin/WorkItemTrackingProcess}/WorkItemTrackingProcess.min.js +0 -0
- /package/{WorkItemTrackingProcess → bin/WorkItemTrackingProcess}/WorkItemTrackingProcessClient.d.ts +0 -0
- /package/{WorkItemTrackingProcess → bin/WorkItemTrackingProcess}/WorkItemTrackingProcessClient.js +0 -0
- /package/{WorkItemTrackingProcess → bin/WorkItemTrackingProcess}/WorkItemTrackingProcessClient.min.js +0 -0
- /package/{WorkItemTrackingProcess → bin/WorkItemTrackingProcess}/index.d.ts +0 -0
- /package/{WorkItemTrackingProcess → bin/WorkItemTrackingProcess}/index.js +0 -0
- /package/{WorkItemTrackingProcess → bin/WorkItemTrackingProcess}/index.min.js +0 -0
- /package/{WorkItemTrackingProcessDefinitions → bin/WorkItemTrackingProcessDefinitions}/WorkItemTrackingProcessDefinitions.d.ts +0 -0
- /package/{WorkItemTrackingProcessDefinitions → bin/WorkItemTrackingProcessDefinitions}/WorkItemTrackingProcessDefinitions.js +0 -0
- /package/{WorkItemTrackingProcessDefinitions → bin/WorkItemTrackingProcessDefinitions}/WorkItemTrackingProcessDefinitions.min.js +0 -0
- /package/{WorkItemTrackingProcessDefinitions → bin/WorkItemTrackingProcessDefinitions}/WorkItemTrackingProcessDefinitionsClient.d.ts +0 -0
- /package/{WorkItemTrackingProcessDefinitions → bin/WorkItemTrackingProcessDefinitions}/WorkItemTrackingProcessDefinitionsClient.js +0 -0
- /package/{WorkItemTrackingProcessDefinitions → bin/WorkItemTrackingProcessDefinitions}/WorkItemTrackingProcessDefinitionsClient.min.js +0 -0
- /package/{WorkItemTrackingProcessDefinitions → bin/WorkItemTrackingProcessDefinitions}/index.d.ts +0 -0
- /package/{WorkItemTrackingProcessDefinitions → bin/WorkItemTrackingProcessDefinitions}/index.js +0 -0
- /package/{WorkItemTrackingProcessDefinitions → bin/WorkItemTrackingProcessDefinitions}/index.min.js +0 -0
- /package/{index.d.ts → bin/index.d.ts} +0 -0
- /package/{index.js → bin/index.js} +0 -0
- /package/{index.min.js → bin/index.min.js} +0 -0
|
@@ -0,0 +1,4750 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ---------------------------------------------------------
|
|
3
|
+
* Copyright(C) Microsoft Corporation. All rights reserved.
|
|
4
|
+
* ---------------------------------------------------------
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { IVssRestClientOptions } from "../Common/Context";
|
|
8
|
+
import { RestClientBase } from "../Common/RestClientBase";
|
|
9
|
+
import { deserializeVssJsonObject } from "../Common/Util/Serialization";
|
|
10
|
+
|
|
11
|
+
import * as TfsCore from "../Core/Core";
|
|
12
|
+
import * as Git from "../Git/Git";
|
|
13
|
+
import * as Policy from "../Policy/Policy";
|
|
14
|
+
import * as WebApi from "../WebApi/WebApi";
|
|
15
|
+
|
|
16
|
+
export class GitRestClient extends RestClientBase {
|
|
17
|
+
constructor(options: IVssRestClientOptions) {
|
|
18
|
+
super(options);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public static readonly RESOURCE_AREA_ID = "4e080c62-fa21-4fbc-8fef-2a10a2b38049";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* DELETE Deletes Enablement status and BillableCommitters data from DB. Deleting the enablement data will effectively disable it for the repositories affected.
|
|
25
|
+
*
|
|
26
|
+
* @param allProjects -
|
|
27
|
+
* @param includeBillableCommitters -
|
|
28
|
+
* @param projectIds -
|
|
29
|
+
*/
|
|
30
|
+
public async deleteEnablementStatus(
|
|
31
|
+
allProjects: boolean,
|
|
32
|
+
includeBillableCommitters?: boolean,
|
|
33
|
+
projectIds?: string[]
|
|
34
|
+
): Promise<void> {
|
|
35
|
+
|
|
36
|
+
const queryValues: any = {
|
|
37
|
+
'$allProjects': allProjects,
|
|
38
|
+
'$includeBillableCommitters': includeBillableCommitters,
|
|
39
|
+
projectIds: projectIds
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return this.beginRequest<void>({
|
|
43
|
+
apiVersion: "7.2-preview.1",
|
|
44
|
+
method: "DELETE",
|
|
45
|
+
routeTemplate: "_apis/git/advsecEnablement",
|
|
46
|
+
queryParams: queryValues
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* GET Enablement status for project's repositories.
|
|
52
|
+
*
|
|
53
|
+
* @param projectIds - Null defaults to all projects in the host, list of project's repos status to return
|
|
54
|
+
* @param billingDate - UTC expected, Null defaults to UtcNow(), can be provided for a point in time status
|
|
55
|
+
* @param skip - Skip X rows of resultset to simulate paging.
|
|
56
|
+
* @param take - Return Y rows of resultset to simulate paging.
|
|
57
|
+
*/
|
|
58
|
+
public async getEnablementStatus(
|
|
59
|
+
projectIds?: string[],
|
|
60
|
+
billingDate?: Date,
|
|
61
|
+
skip?: number,
|
|
62
|
+
take?: number
|
|
63
|
+
): Promise<Git.AdvSecEnablementStatus[]> {
|
|
64
|
+
|
|
65
|
+
const queryValues: any = {
|
|
66
|
+
projectIds: projectIds,
|
|
67
|
+
'$billingDate': billingDate,
|
|
68
|
+
'$skip': skip,
|
|
69
|
+
'$take': take
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return this.beginRequest<Git.AdvSecEnablementStatus[]>({
|
|
73
|
+
apiVersion: "7.2-preview.1",
|
|
74
|
+
routeTemplate: "_apis/git/advsecEnablement",
|
|
75
|
+
queryParams: queryValues
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @param enableOnCreateHost -
|
|
81
|
+
*/
|
|
82
|
+
public async getEnableOnCreateHost(
|
|
83
|
+
enableOnCreateHost: boolean
|
|
84
|
+
): Promise<boolean> {
|
|
85
|
+
|
|
86
|
+
const queryValues: any = {
|
|
87
|
+
'$enableOnCreateHost': enableOnCreateHost
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return this.beginRequest<boolean>({
|
|
91
|
+
apiVersion: "7.2-preview.1",
|
|
92
|
+
routeTemplate: "_apis/git/advsecEnablement",
|
|
93
|
+
queryParams: queryValues
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @param enableOnCreateProjectId -
|
|
99
|
+
*/
|
|
100
|
+
public async getEnableOnCreateProject(
|
|
101
|
+
enableOnCreateProjectId: string
|
|
102
|
+
): Promise<boolean> {
|
|
103
|
+
|
|
104
|
+
const queryValues: any = {
|
|
105
|
+
'$enableOnCreateProjectId': enableOnCreateProjectId
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return this.beginRequest<boolean>({
|
|
109
|
+
apiVersion: "7.2-preview.1",
|
|
110
|
+
routeTemplate: "_apis/git/advsecEnablement",
|
|
111
|
+
queryParams: queryValues
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @param enableOnCreateHost -
|
|
117
|
+
*/
|
|
118
|
+
public async setEnableOnCreateHost(
|
|
119
|
+
enableOnCreateHost: boolean
|
|
120
|
+
): Promise<void> {
|
|
121
|
+
|
|
122
|
+
const queryValues: any = {
|
|
123
|
+
'$enableOnCreateHost': enableOnCreateHost
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
return this.beginRequest<void>({
|
|
127
|
+
apiVersion: "7.2-preview.1",
|
|
128
|
+
method: "PUT",
|
|
129
|
+
routeTemplate: "_apis/git/advsecEnablement",
|
|
130
|
+
queryParams: queryValues
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @param enableOnCreateProjectId -
|
|
136
|
+
* @param enableOnStatus -
|
|
137
|
+
*/
|
|
138
|
+
public async setEnableOnCreateProject(
|
|
139
|
+
enableOnCreateProjectId: string,
|
|
140
|
+
enableOnStatus: boolean
|
|
141
|
+
): Promise<void> {
|
|
142
|
+
|
|
143
|
+
const queryValues: any = {
|
|
144
|
+
'$enableOnCreateProjectId': enableOnCreateProjectId,
|
|
145
|
+
'$enableOnStatus': enableOnStatus
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
return this.beginRequest<void>({
|
|
149
|
+
apiVersion: "7.2-preview.1",
|
|
150
|
+
method: "PUT",
|
|
151
|
+
routeTemplate: "_apis/git/advsecEnablement",
|
|
152
|
+
queryParams: queryValues
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* POST Enablement status for repositories.
|
|
158
|
+
*
|
|
159
|
+
* @param enablementUpdates -
|
|
160
|
+
*/
|
|
161
|
+
public async updateEnablementStatus(
|
|
162
|
+
enablementUpdates: Git.AdvSecEnablementUpdate[]
|
|
163
|
+
): Promise<void> {
|
|
164
|
+
|
|
165
|
+
return this.beginRequest<void>({
|
|
166
|
+
apiVersion: "7.2-preview.1",
|
|
167
|
+
method: "POST",
|
|
168
|
+
routeTemplate: "_apis/git/advsecEnablement",
|
|
169
|
+
body: enablementUpdates
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Get estimated billable pushers for an Organization for last 90 days.
|
|
175
|
+
*
|
|
176
|
+
*/
|
|
177
|
+
public async getEstimatedBillablePushersOrg(
|
|
178
|
+
): Promise<Git.BillablePusher[]> {
|
|
179
|
+
|
|
180
|
+
return this.beginRequest<Git.BillablePusher[]>({
|
|
181
|
+
apiVersion: "7.2-preview.1",
|
|
182
|
+
routeTemplate: "_apis/git/advsecEstimate"
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Get estimated billable pushers for a project for last 90 days.
|
|
188
|
+
*
|
|
189
|
+
* @param project - Project ID or project name
|
|
190
|
+
*/
|
|
191
|
+
public async getEstimatedBillablePushersProject(
|
|
192
|
+
project: string
|
|
193
|
+
): Promise<Git.BillablePusher[]> {
|
|
194
|
+
|
|
195
|
+
return this.beginRequest<Git.BillablePusher[]>({
|
|
196
|
+
apiVersion: "7.2-preview.1",
|
|
197
|
+
routeTemplate: "{project}/_apis/git/advsecEstimate",
|
|
198
|
+
routeValues: {
|
|
199
|
+
project: project
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Get estimated billable committers for a repository for the last 90 days.
|
|
206
|
+
*
|
|
207
|
+
* @param project - Project ID or project name
|
|
208
|
+
* @param repositoryId -
|
|
209
|
+
*/
|
|
210
|
+
public async getEstimatedBillableCommittersRepo(
|
|
211
|
+
project: string,
|
|
212
|
+
repositoryId: string
|
|
213
|
+
): Promise<Git.BillableCommitter[]> {
|
|
214
|
+
|
|
215
|
+
return this.beginRequest<Git.BillableCommitter[]>({
|
|
216
|
+
apiVersion: "7.2-preview.1",
|
|
217
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/advsecEstimate",
|
|
218
|
+
routeValues: {
|
|
219
|
+
project: project,
|
|
220
|
+
repositoryId: repositoryId
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* GET Advanced Security Permission status.
|
|
227
|
+
*
|
|
228
|
+
* @param projectName -
|
|
229
|
+
* @param repositoryId - Repository user is trying to access
|
|
230
|
+
* @param permission - Permission being requestd, must be "viewAlert" "dismissAlert" "manage" "viewEnablement" or "repoRead"
|
|
231
|
+
*/
|
|
232
|
+
public async getPermission(
|
|
233
|
+
projectName?: string,
|
|
234
|
+
repositoryId?: string,
|
|
235
|
+
permission?: string
|
|
236
|
+
): Promise<boolean> {
|
|
237
|
+
|
|
238
|
+
const queryValues: any = {
|
|
239
|
+
'$projectName': projectName,
|
|
240
|
+
'$repositoryId': repositoryId,
|
|
241
|
+
'$permission': permission
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
return this.beginRequest<boolean>({
|
|
245
|
+
apiVersion: "7.2-preview.1",
|
|
246
|
+
routeTemplate: "_apis/git/advsecPermissions",
|
|
247
|
+
queryParams: queryValues
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Create an annotated tag.
|
|
253
|
+
*
|
|
254
|
+
* @param tagObject - Object containing details of tag to be created.
|
|
255
|
+
* @param project - Project ID or project name
|
|
256
|
+
* @param repositoryId - ID or name of the repository.
|
|
257
|
+
*/
|
|
258
|
+
public async createAnnotatedTag(
|
|
259
|
+
tagObject: Git.GitAnnotatedTag,
|
|
260
|
+
project: string,
|
|
261
|
+
repositoryId: string
|
|
262
|
+
): Promise<Git.GitAnnotatedTag> {
|
|
263
|
+
|
|
264
|
+
return this.beginRequest<Git.GitAnnotatedTag>({
|
|
265
|
+
apiVersion: "7.2-preview.1",
|
|
266
|
+
method: "POST",
|
|
267
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/annotatedTags/{objectId}",
|
|
268
|
+
routeValues: {
|
|
269
|
+
project: project,
|
|
270
|
+
repositoryId: repositoryId
|
|
271
|
+
},
|
|
272
|
+
body: tagObject
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Get an annotated tag.
|
|
278
|
+
*
|
|
279
|
+
* @param project - Project ID or project name
|
|
280
|
+
* @param repositoryId - ID or name of the repository.
|
|
281
|
+
* @param objectId - ObjectId (Sha1Id) of tag to get.
|
|
282
|
+
*/
|
|
283
|
+
public async getAnnotatedTag(
|
|
284
|
+
project: string,
|
|
285
|
+
repositoryId: string,
|
|
286
|
+
objectId: string
|
|
287
|
+
): Promise<Git.GitAnnotatedTag> {
|
|
288
|
+
|
|
289
|
+
return this.beginRequest<Git.GitAnnotatedTag>({
|
|
290
|
+
apiVersion: "7.2-preview.1",
|
|
291
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/annotatedTags/{objectId}",
|
|
292
|
+
routeValues: {
|
|
293
|
+
project: project,
|
|
294
|
+
repositoryId: repositoryId,
|
|
295
|
+
objectId: objectId
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Retrieve actual billable committers for Advanced Security service for a given date.
|
|
302
|
+
*
|
|
303
|
+
* @param project - Project ID or project name
|
|
304
|
+
* @param billingDate - UTC expected. If not specified defaults to the previous billing day.
|
|
305
|
+
* @param skip - Skip X rows of resultset to simulate paging.
|
|
306
|
+
* @param take - Return Y rows of resultset to simulate paging.
|
|
307
|
+
*/
|
|
308
|
+
public async getBillableCommitters(
|
|
309
|
+
project: string,
|
|
310
|
+
billingDate?: Date,
|
|
311
|
+
skip?: number,
|
|
312
|
+
take?: number
|
|
313
|
+
): Promise<Git.BillableCommitter[]> {
|
|
314
|
+
|
|
315
|
+
const queryValues: any = {
|
|
316
|
+
'$billingDate': billingDate,
|
|
317
|
+
'$skip': skip,
|
|
318
|
+
'$take': take
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
return this.beginRequest<Git.BillableCommitter[]>({
|
|
322
|
+
apiVersion: "7.2-preview.1",
|
|
323
|
+
routeTemplate: "{project}/_apis/git/billableCommitters",
|
|
324
|
+
routeValues: {
|
|
325
|
+
project: project
|
|
326
|
+
},
|
|
327
|
+
queryParams: queryValues
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Retrieve detailed actual billable committers for Advanced Security service for a given date. Detailed results intentionally does not filter out soft deleted projects and repositories to help diagnose billing issues.
|
|
333
|
+
*
|
|
334
|
+
* @param project - Project ID or project name
|
|
335
|
+
* @param includeDetails - Return all the details on the billable committers.
|
|
336
|
+
* @param billingDate - UTC expected. If not specified defaults to the previous billing day.
|
|
337
|
+
*/
|
|
338
|
+
public async getBillableCommittersDetail(
|
|
339
|
+
project: string,
|
|
340
|
+
includeDetails: string,
|
|
341
|
+
billingDate?: Date
|
|
342
|
+
): Promise<Git.BillableCommitterDetail[]> {
|
|
343
|
+
|
|
344
|
+
const queryValues: any = {
|
|
345
|
+
'$includeDetails': includeDetails,
|
|
346
|
+
'$billingDate': billingDate
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
return this.beginRequest<Git.BillableCommitterDetail[]>({
|
|
350
|
+
apiVersion: "7.2-preview.1",
|
|
351
|
+
routeTemplate: "{project}/_apis/git/billableCommitters",
|
|
352
|
+
routeValues: {
|
|
353
|
+
project: project
|
|
354
|
+
},
|
|
355
|
+
queryParams: queryValues
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Get a single blob.
|
|
361
|
+
*
|
|
362
|
+
* @param repositoryId - The name or ID of the repository.
|
|
363
|
+
* @param sha1 - SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint.
|
|
364
|
+
* @param project - Project ID or project name
|
|
365
|
+
* @param download - If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip
|
|
366
|
+
* @param fileName - Provide a fileName to use for a download.
|
|
367
|
+
* @param resolveLfs - If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types
|
|
368
|
+
*/
|
|
369
|
+
public async getBlob(
|
|
370
|
+
repositoryId: string,
|
|
371
|
+
sha1: string,
|
|
372
|
+
project?: string,
|
|
373
|
+
download?: boolean,
|
|
374
|
+
fileName?: string,
|
|
375
|
+
resolveLfs?: boolean
|
|
376
|
+
): Promise<Git.GitBlobRef> {
|
|
377
|
+
|
|
378
|
+
const queryValues: any = {
|
|
379
|
+
download: download,
|
|
380
|
+
fileName: fileName,
|
|
381
|
+
resolveLfs: resolveLfs
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
return this.beginRequest<Git.GitBlobRef>({
|
|
385
|
+
apiVersion: "7.2-preview.1",
|
|
386
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Blobs/{sha1}",
|
|
387
|
+
routeValues: {
|
|
388
|
+
project: project,
|
|
389
|
+
repositoryId: repositoryId,
|
|
390
|
+
sha1: sha1
|
|
391
|
+
},
|
|
392
|
+
queryParams: queryValues
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Get a single blob.
|
|
398
|
+
*
|
|
399
|
+
* @param repositoryId - The name or ID of the repository.
|
|
400
|
+
* @param sha1 - SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint.
|
|
401
|
+
* @param project - Project ID or project name
|
|
402
|
+
* @param download - If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip
|
|
403
|
+
* @param fileName - Provide a fileName to use for a download.
|
|
404
|
+
* @param resolveLfs - If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types
|
|
405
|
+
*/
|
|
406
|
+
public async getBlobContent(
|
|
407
|
+
repositoryId: string,
|
|
408
|
+
sha1: string,
|
|
409
|
+
project?: string,
|
|
410
|
+
download?: boolean,
|
|
411
|
+
fileName?: string,
|
|
412
|
+
resolveLfs?: boolean
|
|
413
|
+
): Promise<ArrayBuffer> {
|
|
414
|
+
|
|
415
|
+
const queryValues: any = {
|
|
416
|
+
download: download,
|
|
417
|
+
fileName: fileName,
|
|
418
|
+
resolveLfs: resolveLfs
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
return this.beginRequest<ArrayBuffer>({
|
|
422
|
+
apiVersion: "7.2-preview.1",
|
|
423
|
+
httpResponseType: "application/octet-stream",
|
|
424
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Blobs/{sha1}",
|
|
425
|
+
routeValues: {
|
|
426
|
+
project: project,
|
|
427
|
+
repositoryId: repositoryId,
|
|
428
|
+
sha1: sha1
|
|
429
|
+
},
|
|
430
|
+
queryParams: queryValues
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Gets one or more blobs in a zip file download.
|
|
436
|
+
*
|
|
437
|
+
* @param blobIds - Blob IDs (SHA1 hashes) to be returned in the zip file.
|
|
438
|
+
* @param repositoryId - The name or ID of the repository.
|
|
439
|
+
* @param project - Project ID or project name
|
|
440
|
+
* @param filename -
|
|
441
|
+
*/
|
|
442
|
+
public async getBlobsZip(
|
|
443
|
+
blobIds: string[],
|
|
444
|
+
repositoryId: string,
|
|
445
|
+
project?: string,
|
|
446
|
+
filename?: string
|
|
447
|
+
): Promise<ArrayBuffer> {
|
|
448
|
+
|
|
449
|
+
const queryValues: any = {
|
|
450
|
+
filename: filename
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
return this.beginRequest<ArrayBuffer>({
|
|
454
|
+
apiVersion: "7.2-preview.1",
|
|
455
|
+
method: "POST",
|
|
456
|
+
httpResponseType: "application/zip",
|
|
457
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Blobs/{sha1}",
|
|
458
|
+
routeValues: {
|
|
459
|
+
project: project,
|
|
460
|
+
repositoryId: repositoryId
|
|
461
|
+
},
|
|
462
|
+
queryParams: queryValues,
|
|
463
|
+
body: blobIds
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Get a single blob.
|
|
469
|
+
*
|
|
470
|
+
* @param repositoryId - The name or ID of the repository.
|
|
471
|
+
* @param sha1 - SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint.
|
|
472
|
+
* @param project - Project ID or project name
|
|
473
|
+
* @param download - If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip
|
|
474
|
+
* @param fileName - Provide a fileName to use for a download.
|
|
475
|
+
* @param resolveLfs - If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types
|
|
476
|
+
*/
|
|
477
|
+
public async getBlobZip(
|
|
478
|
+
repositoryId: string,
|
|
479
|
+
sha1: string,
|
|
480
|
+
project?: string,
|
|
481
|
+
download?: boolean,
|
|
482
|
+
fileName?: string,
|
|
483
|
+
resolveLfs?: boolean
|
|
484
|
+
): Promise<ArrayBuffer> {
|
|
485
|
+
|
|
486
|
+
const queryValues: any = {
|
|
487
|
+
download: download,
|
|
488
|
+
fileName: fileName,
|
|
489
|
+
resolveLfs: resolveLfs
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
return this.beginRequest<ArrayBuffer>({
|
|
493
|
+
apiVersion: "7.2-preview.1",
|
|
494
|
+
httpResponseType: "application/zip",
|
|
495
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Blobs/{sha1}",
|
|
496
|
+
routeValues: {
|
|
497
|
+
project: project,
|
|
498
|
+
repositoryId: repositoryId,
|
|
499
|
+
sha1: sha1
|
|
500
|
+
},
|
|
501
|
+
queryParams: queryValues
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Retrieve statistics about a single branch.
|
|
507
|
+
*
|
|
508
|
+
* @param repositoryId - The name or ID of the repository.
|
|
509
|
+
* @param name - Name of the branch.
|
|
510
|
+
* @param project - Project ID or project name
|
|
511
|
+
* @param baseVersionDescriptor - Identifies the commit or branch to use as the base.
|
|
512
|
+
*/
|
|
513
|
+
public async getBranch(
|
|
514
|
+
repositoryId: string,
|
|
515
|
+
name: string,
|
|
516
|
+
project?: string,
|
|
517
|
+
baseVersionDescriptor?: Git.GitVersionDescriptor
|
|
518
|
+
): Promise<Git.GitBranchStats> {
|
|
519
|
+
|
|
520
|
+
const queryValues: any = {
|
|
521
|
+
name: name,
|
|
522
|
+
baseVersionDescriptor: baseVersionDescriptor
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
return this.beginRequest<Git.GitBranchStats>({
|
|
526
|
+
apiVersion: "7.2-preview.2",
|
|
527
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/stats/branches",
|
|
528
|
+
routeValues: {
|
|
529
|
+
project: project,
|
|
530
|
+
repositoryId: repositoryId
|
|
531
|
+
},
|
|
532
|
+
queryParams: queryValues
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Retrieve statistics about all branches within a repository.
|
|
538
|
+
*
|
|
539
|
+
* @param repositoryId - The name or ID of the repository.
|
|
540
|
+
* @param project - Project ID or project name
|
|
541
|
+
* @param baseVersionDescriptor - Identifies the commit or branch to use as the base.
|
|
542
|
+
*/
|
|
543
|
+
public async getBranches(
|
|
544
|
+
repositoryId: string,
|
|
545
|
+
project?: string,
|
|
546
|
+
baseVersionDescriptor?: Git.GitVersionDescriptor
|
|
547
|
+
): Promise<Git.GitBranchStats[]> {
|
|
548
|
+
|
|
549
|
+
const queryValues: any = {
|
|
550
|
+
baseVersionDescriptor: baseVersionDescriptor
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
return this.beginRequest<Git.GitBranchStats[]>({
|
|
554
|
+
apiVersion: "7.2-preview.2",
|
|
555
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/stats/branches",
|
|
556
|
+
routeValues: {
|
|
557
|
+
project: project,
|
|
558
|
+
repositoryId: repositoryId
|
|
559
|
+
},
|
|
560
|
+
queryParams: queryValues
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Retrieve statistics for multiple commits
|
|
566
|
+
*
|
|
567
|
+
* @param searchCriteria - Base Commit and List of Target Commits to compare.
|
|
568
|
+
* @param repositoryId - The name or ID of the repository.
|
|
569
|
+
* @param project - Project ID or project name
|
|
570
|
+
*/
|
|
571
|
+
public async getBranchStatsBatch(
|
|
572
|
+
searchCriteria: Git.GitQueryBranchStatsCriteria,
|
|
573
|
+
repositoryId: string,
|
|
574
|
+
project?: string
|
|
575
|
+
): Promise<Git.GitBranchStats[]> {
|
|
576
|
+
|
|
577
|
+
return this.beginRequest<Git.GitBranchStats[]>({
|
|
578
|
+
apiVersion: "7.2-preview.2",
|
|
579
|
+
method: "POST",
|
|
580
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/stats/branches",
|
|
581
|
+
routeValues: {
|
|
582
|
+
project: project,
|
|
583
|
+
repositoryId: repositoryId
|
|
584
|
+
},
|
|
585
|
+
body: searchCriteria
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Retrieve changes for a particular commit.
|
|
591
|
+
*
|
|
592
|
+
* @param commitId - The id of the commit.
|
|
593
|
+
* @param repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified.
|
|
594
|
+
* @param project - Project ID or project name
|
|
595
|
+
* @param top - The maximum number of changes to return.
|
|
596
|
+
* @param skip - The number of changes to skip.
|
|
597
|
+
*/
|
|
598
|
+
public async getChanges(
|
|
599
|
+
commitId: string,
|
|
600
|
+
repositoryId: string,
|
|
601
|
+
project?: string,
|
|
602
|
+
top?: number,
|
|
603
|
+
skip?: number
|
|
604
|
+
): Promise<Git.GitCommitChanges> {
|
|
605
|
+
|
|
606
|
+
const queryValues: any = {
|
|
607
|
+
top: top,
|
|
608
|
+
skip: skip
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
return this.beginRequest<Git.GitCommitChanges>({
|
|
612
|
+
apiVersion: "7.2-preview.1",
|
|
613
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/Changes",
|
|
614
|
+
routeValues: {
|
|
615
|
+
project: project,
|
|
616
|
+
commitId: commitId,
|
|
617
|
+
repositoryId: repositoryId
|
|
618
|
+
},
|
|
619
|
+
queryParams: queryValues
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Retrieve one conflict for a cherry pick by ID
|
|
625
|
+
*
|
|
626
|
+
* @param repositoryId -
|
|
627
|
+
* @param cherryPickId -
|
|
628
|
+
* @param conflictId -
|
|
629
|
+
* @param project - Project ID or project name
|
|
630
|
+
*/
|
|
631
|
+
public async getCherryPickConflict(
|
|
632
|
+
repositoryId: string,
|
|
633
|
+
cherryPickId: number,
|
|
634
|
+
conflictId: number,
|
|
635
|
+
project?: string
|
|
636
|
+
): Promise<Git.GitConflict> {
|
|
637
|
+
|
|
638
|
+
return this.beginRequest<Git.GitConflict>({
|
|
639
|
+
apiVersion: "7.2-preview.1",
|
|
640
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}/conflicts/{conflictId}",
|
|
641
|
+
routeValues: {
|
|
642
|
+
project: project,
|
|
643
|
+
repositoryId: repositoryId,
|
|
644
|
+
cherryPickId: cherryPickId,
|
|
645
|
+
conflictId: conflictId
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Retrieve all conflicts for a cherry pick
|
|
652
|
+
*
|
|
653
|
+
* @param repositoryId -
|
|
654
|
+
* @param cherryPickId -
|
|
655
|
+
* @param project - Project ID or project name
|
|
656
|
+
* @param continuationToken -
|
|
657
|
+
* @param top -
|
|
658
|
+
* @param excludeResolved -
|
|
659
|
+
* @param onlyResolved -
|
|
660
|
+
* @param includeObsolete -
|
|
661
|
+
*/
|
|
662
|
+
public async getCherryPickConflicts(
|
|
663
|
+
repositoryId: string,
|
|
664
|
+
cherryPickId: number,
|
|
665
|
+
project?: string,
|
|
666
|
+
continuationToken?: string,
|
|
667
|
+
top?: number,
|
|
668
|
+
excludeResolved?: boolean,
|
|
669
|
+
onlyResolved?: boolean,
|
|
670
|
+
includeObsolete?: boolean
|
|
671
|
+
): Promise<WebApi.PagedList<Git.GitConflict>> {
|
|
672
|
+
|
|
673
|
+
const queryValues: any = {
|
|
674
|
+
continuationToken: continuationToken,
|
|
675
|
+
'$top': top,
|
|
676
|
+
excludeResolved: excludeResolved,
|
|
677
|
+
onlyResolved: onlyResolved,
|
|
678
|
+
includeObsolete: includeObsolete
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
return this.beginRequest<Response>({
|
|
682
|
+
apiVersion: "7.2-preview.1",
|
|
683
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}/conflicts/{conflictId}",
|
|
684
|
+
routeValues: {
|
|
685
|
+
project: project,
|
|
686
|
+
repositoryId: repositoryId,
|
|
687
|
+
cherryPickId: cherryPickId
|
|
688
|
+
},
|
|
689
|
+
queryParams: queryValues,
|
|
690
|
+
returnRawResponse: true
|
|
691
|
+
}).then(async response => {
|
|
692
|
+
const body = <WebApi.PagedList<Git.GitConflict>>await response.text().then(deserializeVssJsonObject);
|
|
693
|
+
body.continuationToken = response.headers.get("x-ms-continuationtoken");
|
|
694
|
+
return body;
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Update merge conflict resolution
|
|
700
|
+
*
|
|
701
|
+
* @param conflict -
|
|
702
|
+
* @param repositoryId -
|
|
703
|
+
* @param cherryPickId -
|
|
704
|
+
* @param conflictId -
|
|
705
|
+
* @param project - Project ID or project name
|
|
706
|
+
*/
|
|
707
|
+
public async updateCherryPickConflict(
|
|
708
|
+
conflict: Git.GitConflict,
|
|
709
|
+
repositoryId: string,
|
|
710
|
+
cherryPickId: number,
|
|
711
|
+
conflictId: number,
|
|
712
|
+
project?: string
|
|
713
|
+
): Promise<Git.GitConflict> {
|
|
714
|
+
|
|
715
|
+
return this.beginRequest<Git.GitConflict>({
|
|
716
|
+
apiVersion: "7.2-preview.1",
|
|
717
|
+
method: "PATCH",
|
|
718
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}/conflicts/{conflictId}",
|
|
719
|
+
routeValues: {
|
|
720
|
+
project: project,
|
|
721
|
+
repositoryId: repositoryId,
|
|
722
|
+
cherryPickId: cherryPickId,
|
|
723
|
+
conflictId: conflictId
|
|
724
|
+
},
|
|
725
|
+
body: conflict
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Update multiple merge conflict resolutions
|
|
731
|
+
*
|
|
732
|
+
* @param conflictUpdates -
|
|
733
|
+
* @param repositoryId -
|
|
734
|
+
* @param cherryPickId -
|
|
735
|
+
* @param project - Project ID or project name
|
|
736
|
+
*/
|
|
737
|
+
public async updateCherryPickConflicts(
|
|
738
|
+
conflictUpdates: Git.GitConflict[],
|
|
739
|
+
repositoryId: string,
|
|
740
|
+
cherryPickId: number,
|
|
741
|
+
project?: string
|
|
742
|
+
): Promise<Git.GitConflictUpdateResult[]> {
|
|
743
|
+
|
|
744
|
+
return this.beginRequest<Git.GitConflictUpdateResult[]>({
|
|
745
|
+
apiVersion: "7.2-preview.1",
|
|
746
|
+
method: "PATCH",
|
|
747
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}/conflicts/{conflictId}",
|
|
748
|
+
routeValues: {
|
|
749
|
+
project: project,
|
|
750
|
+
repositoryId: repositoryId,
|
|
751
|
+
cherryPickId: cherryPickId
|
|
752
|
+
},
|
|
753
|
+
body: conflictUpdates
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* Given a commitId, returns a list of commits that are in the same cherry-pick family.
|
|
759
|
+
*
|
|
760
|
+
* @param repositoryNameOrId -
|
|
761
|
+
* @param commitId -
|
|
762
|
+
* @param project - Project ID or project name
|
|
763
|
+
* @param includeLinks -
|
|
764
|
+
*/
|
|
765
|
+
public async getCherryPickRelationships(
|
|
766
|
+
repositoryNameOrId: string,
|
|
767
|
+
commitId: string,
|
|
768
|
+
project?: string,
|
|
769
|
+
includeLinks?: boolean
|
|
770
|
+
): Promise<Git.GitCommitRef[]> {
|
|
771
|
+
|
|
772
|
+
const queryValues: any = {
|
|
773
|
+
includeLinks: includeLinks
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
return this.beginRequest<Git.GitCommitRef[]>({
|
|
777
|
+
apiVersion: "7.2-preview.1",
|
|
778
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/cherryPickRelationships/{commitId}",
|
|
779
|
+
routeValues: {
|
|
780
|
+
project: project,
|
|
781
|
+
repositoryNameOrId: repositoryNameOrId,
|
|
782
|
+
commitId: commitId
|
|
783
|
+
},
|
|
784
|
+
queryParams: queryValues
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* Cherry pick a specific commit or commits that are associated to a pull request into a new branch.
|
|
790
|
+
*
|
|
791
|
+
* @param cherryPickToCreate -
|
|
792
|
+
* @param project - Project ID or project name
|
|
793
|
+
* @param repositoryId - ID of the repository.
|
|
794
|
+
*/
|
|
795
|
+
public async createCherryPick(
|
|
796
|
+
cherryPickToCreate: Git.GitAsyncRefOperationParameters,
|
|
797
|
+
project: string,
|
|
798
|
+
repositoryId: string
|
|
799
|
+
): Promise<Git.GitCherryPick> {
|
|
800
|
+
|
|
801
|
+
return this.beginRequest<Git.GitCherryPick>({
|
|
802
|
+
apiVersion: "7.2-preview.2",
|
|
803
|
+
method: "POST",
|
|
804
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}",
|
|
805
|
+
routeValues: {
|
|
806
|
+
project: project,
|
|
807
|
+
repositoryId: repositoryId
|
|
808
|
+
},
|
|
809
|
+
body: cherryPickToCreate
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* Retrieve information about a cherry pick operation by cherry pick Id.
|
|
815
|
+
*
|
|
816
|
+
* @param project - Project ID or project name
|
|
817
|
+
* @param cherryPickId - ID of the cherry pick.
|
|
818
|
+
* @param repositoryId - ID of the repository.
|
|
819
|
+
*/
|
|
820
|
+
public async getCherryPick(
|
|
821
|
+
project: string,
|
|
822
|
+
cherryPickId: number,
|
|
823
|
+
repositoryId: string
|
|
824
|
+
): Promise<Git.GitCherryPick> {
|
|
825
|
+
|
|
826
|
+
return this.beginRequest<Git.GitCherryPick>({
|
|
827
|
+
apiVersion: "7.2-preview.2",
|
|
828
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}",
|
|
829
|
+
routeValues: {
|
|
830
|
+
project: project,
|
|
831
|
+
cherryPickId: cherryPickId,
|
|
832
|
+
repositoryId: repositoryId
|
|
833
|
+
}
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Retrieve information about a cherry pick operation for a specific branch. This operation is expensive due to the underlying object structure, so this API only looks at the 1000 most recent cherry pick operations.
|
|
839
|
+
*
|
|
840
|
+
* @param project - Project ID or project name
|
|
841
|
+
* @param repositoryId - ID of the repository.
|
|
842
|
+
* @param refName - The GitAsyncRefOperationParameters generatedRefName used for the cherry pick operation.
|
|
843
|
+
*/
|
|
844
|
+
public async getCherryPickForRefName(
|
|
845
|
+
project: string,
|
|
846
|
+
repositoryId: string,
|
|
847
|
+
refName: string
|
|
848
|
+
): Promise<Git.GitCherryPick> {
|
|
849
|
+
|
|
850
|
+
const queryValues: any = {
|
|
851
|
+
refName: refName
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
return this.beginRequest<Git.GitCherryPick>({
|
|
855
|
+
apiVersion: "7.2-preview.2",
|
|
856
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}",
|
|
857
|
+
routeValues: {
|
|
858
|
+
project: project,
|
|
859
|
+
repositoryId: repositoryId
|
|
860
|
+
},
|
|
861
|
+
queryParams: queryValues
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Find the closest common commit (the merge base) between base and target commits, and get the diff between either the base and target commits or common and target commits.
|
|
867
|
+
*
|
|
868
|
+
* @param repositoryId - The name or ID of the repository.
|
|
869
|
+
* @param project - Project ID or project name
|
|
870
|
+
* @param diffCommonCommit - If true, diff between common and target commits. If false, diff between base and target commits.
|
|
871
|
+
* @param top - Maximum number of changes to return. Defaults to 100.
|
|
872
|
+
* @param skip - Number of changes to skip
|
|
873
|
+
* @param baseVersionDescriptor - Descriptor for base commit.
|
|
874
|
+
* @param targetVersionDescriptor - Descriptor for target commit.
|
|
875
|
+
*/
|
|
876
|
+
public async getCommitDiffs(
|
|
877
|
+
repositoryId: string,
|
|
878
|
+
project?: string,
|
|
879
|
+
diffCommonCommit?: boolean,
|
|
880
|
+
top?: number,
|
|
881
|
+
skip?: number,
|
|
882
|
+
baseVersionDescriptor?: Git.GitBaseVersionDescriptor,
|
|
883
|
+
targetVersionDescriptor?: Git.GitTargetVersionDescriptor
|
|
884
|
+
): Promise<Git.GitCommitDiffs> {
|
|
885
|
+
|
|
886
|
+
const queryValues: any = {
|
|
887
|
+
diffCommonCommit: diffCommonCommit,
|
|
888
|
+
'$top': top,
|
|
889
|
+
'$skip': skip,
|
|
890
|
+
};
|
|
891
|
+
if (baseVersionDescriptor) {
|
|
892
|
+
queryValues.baseVersionType = baseVersionDescriptor.versionType;
|
|
893
|
+
queryValues.baseVersion = baseVersionDescriptor.version;
|
|
894
|
+
queryValues.baseVersionOptions = baseVersionDescriptor.versionOptions;
|
|
895
|
+
}
|
|
896
|
+
if (targetVersionDescriptor) {
|
|
897
|
+
queryValues.targetVersionType = targetVersionDescriptor.versionType;
|
|
898
|
+
queryValues.targetVersion = targetVersionDescriptor.version;
|
|
899
|
+
queryValues.targetVersionOptions = targetVersionDescriptor.versionOptions;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
return this.beginRequest<Git.GitCommitDiffs>({
|
|
903
|
+
apiVersion: "7.2-preview.1",
|
|
904
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/diffs/commits",
|
|
905
|
+
routeValues: {
|
|
906
|
+
project: project,
|
|
907
|
+
repositoryId: repositoryId
|
|
908
|
+
},
|
|
909
|
+
queryParams: queryValues
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* Retrieve a particular commit.
|
|
915
|
+
*
|
|
916
|
+
* @param commitId - The id of the commit.
|
|
917
|
+
* @param repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified.
|
|
918
|
+
* @param project - Project ID or project name
|
|
919
|
+
* @param changeCount - The number of changes to include in the result.
|
|
920
|
+
*/
|
|
921
|
+
public async getCommit(
|
|
922
|
+
commitId: string,
|
|
923
|
+
repositoryId: string,
|
|
924
|
+
project?: string,
|
|
925
|
+
changeCount?: number
|
|
926
|
+
): Promise<Git.GitCommit> {
|
|
927
|
+
|
|
928
|
+
const queryValues: any = {
|
|
929
|
+
changeCount: changeCount
|
|
930
|
+
};
|
|
931
|
+
|
|
932
|
+
return this.beginRequest<Git.GitCommit>({
|
|
933
|
+
apiVersion: "7.2-preview.2",
|
|
934
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Commits/{commitId}",
|
|
935
|
+
routeValues: {
|
|
936
|
+
project: project,
|
|
937
|
+
commitId: commitId,
|
|
938
|
+
repositoryId: repositoryId
|
|
939
|
+
},
|
|
940
|
+
queryParams: queryValues
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* Retrieve git commits for a project
|
|
946
|
+
*
|
|
947
|
+
* @param repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified.
|
|
948
|
+
* @param searchCriteria -
|
|
949
|
+
* @param project - Project ID or project name
|
|
950
|
+
*/
|
|
951
|
+
public async getCommits(
|
|
952
|
+
repositoryId: string,
|
|
953
|
+
searchCriteria: Git.GitQueryCommitsCriteria,
|
|
954
|
+
project?: string
|
|
955
|
+
): Promise<Git.GitCommitRef[]> {
|
|
956
|
+
|
|
957
|
+
const queryValues: any = {
|
|
958
|
+
searchCriteria: searchCriteria
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
return this.beginRequest<Git.GitCommitRef[]>({
|
|
962
|
+
apiVersion: "7.2-preview.2",
|
|
963
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Commits/{commitId}",
|
|
964
|
+
routeValues: {
|
|
965
|
+
project: project,
|
|
966
|
+
repositoryId: repositoryId
|
|
967
|
+
},
|
|
968
|
+
queryParams: queryValues
|
|
969
|
+
});
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* Retrieve a list of commits associated with a particular push.
|
|
974
|
+
*
|
|
975
|
+
* @param repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified.
|
|
976
|
+
* @param pushId - The id of the push.
|
|
977
|
+
* @param project - Project ID or project name
|
|
978
|
+
* @param top - The maximum number of commits to return ("get the top x commits").
|
|
979
|
+
* @param skip - The number of commits to skip.
|
|
980
|
+
* @param includeLinks - Set to false to avoid including REST Url links for resources. Defaults to true.
|
|
981
|
+
*/
|
|
982
|
+
public async getPushCommits(
|
|
983
|
+
repositoryId: string,
|
|
984
|
+
pushId: number,
|
|
985
|
+
project?: string,
|
|
986
|
+
top?: number,
|
|
987
|
+
skip?: number,
|
|
988
|
+
includeLinks?: boolean
|
|
989
|
+
): Promise<Git.GitCommitRef[]> {
|
|
990
|
+
|
|
991
|
+
const queryValues: any = {
|
|
992
|
+
pushId: pushId,
|
|
993
|
+
top: top,
|
|
994
|
+
skip: skip,
|
|
995
|
+
includeLinks: includeLinks
|
|
996
|
+
};
|
|
997
|
+
|
|
998
|
+
return this.beginRequest<Git.GitCommitRef[]>({
|
|
999
|
+
apiVersion: "7.2-preview.2",
|
|
1000
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Commits/{commitId}",
|
|
1001
|
+
routeValues: {
|
|
1002
|
+
project: project,
|
|
1003
|
+
repositoryId: repositoryId
|
|
1004
|
+
},
|
|
1005
|
+
queryParams: queryValues
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* Retrieve git commits for a project matching the search criteria
|
|
1011
|
+
*
|
|
1012
|
+
* @param searchCriteria - Search options
|
|
1013
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1014
|
+
* @param project - Project ID or project name
|
|
1015
|
+
* @param skip - Number of commits to skip. The value cannot exceed 3,000,000.
|
|
1016
|
+
* @param top - Maximum number of commits to return. The value cannot exceed 50,000.
|
|
1017
|
+
* @param includeStatuses - True to include additional commit status information.
|
|
1018
|
+
*/
|
|
1019
|
+
public async getCommitsBatch(
|
|
1020
|
+
searchCriteria: Git.GitQueryCommitsCriteria,
|
|
1021
|
+
repositoryId: string,
|
|
1022
|
+
project?: string,
|
|
1023
|
+
skip?: number,
|
|
1024
|
+
top?: number,
|
|
1025
|
+
includeStatuses?: boolean
|
|
1026
|
+
): Promise<Git.GitCommitRef[]> {
|
|
1027
|
+
|
|
1028
|
+
const queryValues: any = {
|
|
1029
|
+
'$skip': skip,
|
|
1030
|
+
'$top': top,
|
|
1031
|
+
includeStatuses: includeStatuses
|
|
1032
|
+
};
|
|
1033
|
+
|
|
1034
|
+
return this.beginRequest<Git.GitCommitRef[]>({
|
|
1035
|
+
apiVersion: "7.2-preview.2",
|
|
1036
|
+
method: "POST",
|
|
1037
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/CommitsBatch",
|
|
1038
|
+
routeValues: {
|
|
1039
|
+
project: project,
|
|
1040
|
+
repositoryId: repositoryId
|
|
1041
|
+
},
|
|
1042
|
+
queryParams: queryValues,
|
|
1043
|
+
body: searchCriteria
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* Retrieve deleted git repositories.
|
|
1049
|
+
*
|
|
1050
|
+
* @param project - Project ID or project name
|
|
1051
|
+
*/
|
|
1052
|
+
public async getDeletedRepositories(
|
|
1053
|
+
project: string
|
|
1054
|
+
): Promise<Git.GitDeletedRepository[]> {
|
|
1055
|
+
|
|
1056
|
+
return this.beginRequest<Git.GitDeletedRepository[]>({
|
|
1057
|
+
apiVersion: "7.2-preview.1",
|
|
1058
|
+
routeTemplate: "{project}/_apis/git/DeletedRepositories",
|
|
1059
|
+
routeValues: {
|
|
1060
|
+
project: project
|
|
1061
|
+
}
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
/**
|
|
1066
|
+
* Get the file diffs for each of the specified files
|
|
1067
|
+
*
|
|
1068
|
+
* @param fileDiffsCriteria - List of file parameters objects
|
|
1069
|
+
* @param project - Project ID or project name
|
|
1070
|
+
* @param repositoryId - The name or ID of the repository
|
|
1071
|
+
*/
|
|
1072
|
+
public async getFileDiffs(
|
|
1073
|
+
fileDiffsCriteria: Git.FileDiffsCriteria,
|
|
1074
|
+
project: string,
|
|
1075
|
+
repositoryId: string
|
|
1076
|
+
): Promise<Git.FileDiff[]> {
|
|
1077
|
+
|
|
1078
|
+
return this.beginRequest<Git.FileDiff[]>({
|
|
1079
|
+
apiVersion: "7.2-preview.1",
|
|
1080
|
+
method: "POST",
|
|
1081
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/FileDiffs",
|
|
1082
|
+
routeValues: {
|
|
1083
|
+
project: project,
|
|
1084
|
+
repositoryId: repositoryId
|
|
1085
|
+
},
|
|
1086
|
+
body: fileDiffsCriteria
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* Retrieve all forks of a repository in the collection.
|
|
1092
|
+
*
|
|
1093
|
+
* @param repositoryNameOrId - The name or ID of the repository.
|
|
1094
|
+
* @param collectionId - Team project collection ID.
|
|
1095
|
+
* @param project - Project ID or project name
|
|
1096
|
+
* @param includeLinks - True to include links.
|
|
1097
|
+
*/
|
|
1098
|
+
public async getForks(
|
|
1099
|
+
repositoryNameOrId: string,
|
|
1100
|
+
collectionId: string,
|
|
1101
|
+
project?: string,
|
|
1102
|
+
includeLinks?: boolean
|
|
1103
|
+
): Promise<Git.GitRepositoryRef[]> {
|
|
1104
|
+
|
|
1105
|
+
const queryValues: any = {
|
|
1106
|
+
includeLinks: includeLinks
|
|
1107
|
+
};
|
|
1108
|
+
|
|
1109
|
+
return this.beginRequest<Git.GitRepositoryRef[]>({
|
|
1110
|
+
apiVersion: "7.2-preview.1",
|
|
1111
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/forks/{collectionId}",
|
|
1112
|
+
routeValues: {
|
|
1113
|
+
project: project,
|
|
1114
|
+
repositoryNameOrId: repositoryNameOrId,
|
|
1115
|
+
collectionId: collectionId
|
|
1116
|
+
},
|
|
1117
|
+
queryParams: queryValues
|
|
1118
|
+
});
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
/**
|
|
1122
|
+
* Request that another repository's refs be fetched into this one. It syncs two existing forks. To create a fork, please see the \<a href="https://docs.microsoft.com/en-us/rest/api/vsts/git/repositories/create?view=azure-devops-rest-5.1"\> repositories endpoint\</a\>
|
|
1123
|
+
*
|
|
1124
|
+
* @param syncParams - Source repository and ref mapping.
|
|
1125
|
+
* @param repositoryNameOrId - The name or ID of the repository.
|
|
1126
|
+
* @param project - Project ID or project name
|
|
1127
|
+
* @param includeLinks - True to include links
|
|
1128
|
+
*/
|
|
1129
|
+
public async createForkSyncRequest(
|
|
1130
|
+
syncParams: Git.GitForkSyncRequestParameters,
|
|
1131
|
+
repositoryNameOrId: string,
|
|
1132
|
+
project?: string,
|
|
1133
|
+
includeLinks?: boolean
|
|
1134
|
+
): Promise<Git.GitForkSyncRequest> {
|
|
1135
|
+
|
|
1136
|
+
const queryValues: any = {
|
|
1137
|
+
includeLinks: includeLinks
|
|
1138
|
+
};
|
|
1139
|
+
|
|
1140
|
+
return this.beginRequest<Git.GitForkSyncRequest>({
|
|
1141
|
+
apiVersion: "7.2-preview.1",
|
|
1142
|
+
method: "POST",
|
|
1143
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/forkSyncRequests/{forkSyncOperationId}",
|
|
1144
|
+
routeValues: {
|
|
1145
|
+
project: project,
|
|
1146
|
+
repositoryNameOrId: repositoryNameOrId
|
|
1147
|
+
},
|
|
1148
|
+
queryParams: queryValues,
|
|
1149
|
+
body: syncParams
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
/**
|
|
1154
|
+
* Get a specific fork sync operation's details.
|
|
1155
|
+
*
|
|
1156
|
+
* @param repositoryNameOrId - The name or ID of the repository.
|
|
1157
|
+
* @param forkSyncOperationId - OperationId of the sync request.
|
|
1158
|
+
* @param project - Project ID or project name
|
|
1159
|
+
* @param includeLinks - True to include links.
|
|
1160
|
+
*/
|
|
1161
|
+
public async getForkSyncRequest(
|
|
1162
|
+
repositoryNameOrId: string,
|
|
1163
|
+
forkSyncOperationId: number,
|
|
1164
|
+
project?: string,
|
|
1165
|
+
includeLinks?: boolean
|
|
1166
|
+
): Promise<Git.GitForkSyncRequest> {
|
|
1167
|
+
|
|
1168
|
+
const queryValues: any = {
|
|
1169
|
+
includeLinks: includeLinks
|
|
1170
|
+
};
|
|
1171
|
+
|
|
1172
|
+
return this.beginRequest<Git.GitForkSyncRequest>({
|
|
1173
|
+
apiVersion: "7.2-preview.1",
|
|
1174
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/forkSyncRequests/{forkSyncOperationId}",
|
|
1175
|
+
routeValues: {
|
|
1176
|
+
project: project,
|
|
1177
|
+
repositoryNameOrId: repositoryNameOrId,
|
|
1178
|
+
forkSyncOperationId: forkSyncOperationId
|
|
1179
|
+
},
|
|
1180
|
+
queryParams: queryValues
|
|
1181
|
+
});
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* Retrieve all requested fork sync operations on this repository.
|
|
1186
|
+
*
|
|
1187
|
+
* @param repositoryNameOrId - The name or ID of the repository.
|
|
1188
|
+
* @param project - Project ID or project name
|
|
1189
|
+
* @param includeAbandoned - True to include abandoned requests.
|
|
1190
|
+
* @param includeLinks - True to include links.
|
|
1191
|
+
*/
|
|
1192
|
+
public async getForkSyncRequests(
|
|
1193
|
+
repositoryNameOrId: string,
|
|
1194
|
+
project?: string,
|
|
1195
|
+
includeAbandoned?: boolean,
|
|
1196
|
+
includeLinks?: boolean
|
|
1197
|
+
): Promise<Git.GitForkSyncRequest[]> {
|
|
1198
|
+
|
|
1199
|
+
const queryValues: any = {
|
|
1200
|
+
includeAbandoned: includeAbandoned,
|
|
1201
|
+
includeLinks: includeLinks
|
|
1202
|
+
};
|
|
1203
|
+
|
|
1204
|
+
return this.beginRequest<Git.GitForkSyncRequest[]>({
|
|
1205
|
+
apiVersion: "7.2-preview.1",
|
|
1206
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/forkSyncRequests/{forkSyncOperationId}",
|
|
1207
|
+
routeValues: {
|
|
1208
|
+
project: project,
|
|
1209
|
+
repositoryNameOrId: repositoryNameOrId
|
|
1210
|
+
},
|
|
1211
|
+
queryParams: queryValues
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
/**
|
|
1216
|
+
* Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.
|
|
1217
|
+
*
|
|
1218
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1219
|
+
* @param path - The item path.
|
|
1220
|
+
* @param project - Project ID or project name
|
|
1221
|
+
* @param scopePath - The path scope. The default is null.
|
|
1222
|
+
* @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
|
|
1223
|
+
* @param includeContentMetadata - Set to true to include content metadata. Default is false.
|
|
1224
|
+
* @param latestProcessedChange - Set to true to include the latest changes. Default is false.
|
|
1225
|
+
* @param download - Set to true to download the response as a file. Default is false.
|
|
1226
|
+
* @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
|
|
1227
|
+
* @param includeContent - Set to true to include item content when requesting json. Default is false.
|
|
1228
|
+
* @param resolveHfs - Set to true to resolve Git HFS pointer files to return actual content from Git HFS. Default is true.
|
|
1229
|
+
* @param sanitize - Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false.
|
|
1230
|
+
*/
|
|
1231
|
+
public async getHfsItem(
|
|
1232
|
+
repositoryId: string,
|
|
1233
|
+
path: string,
|
|
1234
|
+
project?: string,
|
|
1235
|
+
scopePath?: string,
|
|
1236
|
+
recursionLevel?: Git.VersionControlRecursionType,
|
|
1237
|
+
includeContentMetadata?: boolean,
|
|
1238
|
+
latestProcessedChange?: boolean,
|
|
1239
|
+
download?: boolean,
|
|
1240
|
+
versionDescriptor?: Git.GitVersionDescriptor,
|
|
1241
|
+
includeContent?: boolean,
|
|
1242
|
+
resolveHfs?: boolean,
|
|
1243
|
+
sanitize?: boolean
|
|
1244
|
+
): Promise<Git.GitItem> {
|
|
1245
|
+
|
|
1246
|
+
const queryValues: any = {
|
|
1247
|
+
path: path,
|
|
1248
|
+
scopePath: scopePath,
|
|
1249
|
+
recursionLevel: recursionLevel,
|
|
1250
|
+
includeContentMetadata: includeContentMetadata,
|
|
1251
|
+
latestProcessedChange: latestProcessedChange,
|
|
1252
|
+
download: download,
|
|
1253
|
+
versionDescriptor: versionDescriptor,
|
|
1254
|
+
includeContent: includeContent,
|
|
1255
|
+
resolveHfs: resolveHfs,
|
|
1256
|
+
sanitize: sanitize
|
|
1257
|
+
};
|
|
1258
|
+
|
|
1259
|
+
return this.beginRequest<Git.GitItem>({
|
|
1260
|
+
apiVersion: "7.2-preview.1",
|
|
1261
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/HfsItems/{*path}",
|
|
1262
|
+
routeValues: {
|
|
1263
|
+
project: project,
|
|
1264
|
+
repositoryId: repositoryId
|
|
1265
|
+
},
|
|
1266
|
+
queryParams: queryValues
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.
|
|
1272
|
+
*
|
|
1273
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1274
|
+
* @param path - The item path.
|
|
1275
|
+
* @param project - Project ID or project name
|
|
1276
|
+
* @param scopePath - The path scope. The default is null.
|
|
1277
|
+
* @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
|
|
1278
|
+
* @param includeContentMetadata - Set to true to include content metadata. Default is false.
|
|
1279
|
+
* @param latestProcessedChange - Set to true to include the latest changes. Default is false.
|
|
1280
|
+
* @param download - Set to true to download the response as a file. Default is false.
|
|
1281
|
+
* @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
|
|
1282
|
+
* @param includeContent - Set to true to include item content when requesting json. Default is false.
|
|
1283
|
+
* @param resolveHfs - Set to true to resolve Git HFS pointer files to return actual content from Git HFS. Default is true.
|
|
1284
|
+
* @param sanitize - Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false.
|
|
1285
|
+
*/
|
|
1286
|
+
public async getHfsItemContent(
|
|
1287
|
+
repositoryId: string,
|
|
1288
|
+
path: string,
|
|
1289
|
+
project?: string,
|
|
1290
|
+
scopePath?: string,
|
|
1291
|
+
recursionLevel?: Git.VersionControlRecursionType,
|
|
1292
|
+
includeContentMetadata?: boolean,
|
|
1293
|
+
latestProcessedChange?: boolean,
|
|
1294
|
+
download?: boolean,
|
|
1295
|
+
versionDescriptor?: Git.GitVersionDescriptor,
|
|
1296
|
+
includeContent?: boolean,
|
|
1297
|
+
resolveHfs?: boolean,
|
|
1298
|
+
sanitize?: boolean
|
|
1299
|
+
): Promise<ArrayBuffer> {
|
|
1300
|
+
|
|
1301
|
+
const queryValues: any = {
|
|
1302
|
+
path: path,
|
|
1303
|
+
scopePath: scopePath,
|
|
1304
|
+
recursionLevel: recursionLevel,
|
|
1305
|
+
includeContentMetadata: includeContentMetadata,
|
|
1306
|
+
latestProcessedChange: latestProcessedChange,
|
|
1307
|
+
download: download,
|
|
1308
|
+
versionDescriptor: versionDescriptor,
|
|
1309
|
+
includeContent: includeContent,
|
|
1310
|
+
resolveHfs: resolveHfs,
|
|
1311
|
+
sanitize: sanitize
|
|
1312
|
+
};
|
|
1313
|
+
|
|
1314
|
+
return this.beginRequest<ArrayBuffer>({
|
|
1315
|
+
apiVersion: "7.2-preview.1",
|
|
1316
|
+
httpResponseType: "application/octet-stream",
|
|
1317
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/HfsItems/{*path}",
|
|
1318
|
+
routeValues: {
|
|
1319
|
+
project: project,
|
|
1320
|
+
repositoryId: repositoryId
|
|
1321
|
+
},
|
|
1322
|
+
queryParams: queryValues
|
|
1323
|
+
});
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* Get Item Metadata and/or Content for a collection of items. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download.
|
|
1328
|
+
*
|
|
1329
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1330
|
+
* @param project - Project ID or project name
|
|
1331
|
+
* @param scopePath - The path scope. The default is null.
|
|
1332
|
+
* @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
|
|
1333
|
+
* @param includeContentMetadata - Set to true to include content metadata. Default is false.
|
|
1334
|
+
* @param latestProcessedChange - Set to true to include the latest changes. Default is false.
|
|
1335
|
+
* @param download - Set to true to download the response as a file. Default is false.
|
|
1336
|
+
* @param includeLinks - Set to true to include links to items. Default is false.
|
|
1337
|
+
* @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
|
|
1338
|
+
* @param zipForUnix - Set to true to keep the file permissions for unix (and POSIX) systems like executables and symlinks
|
|
1339
|
+
*/
|
|
1340
|
+
public async getHfsItems(
|
|
1341
|
+
repositoryId: string,
|
|
1342
|
+
project?: string,
|
|
1343
|
+
scopePath?: string,
|
|
1344
|
+
recursionLevel?: Git.VersionControlRecursionType,
|
|
1345
|
+
includeContentMetadata?: boolean,
|
|
1346
|
+
latestProcessedChange?: boolean,
|
|
1347
|
+
download?: boolean,
|
|
1348
|
+
includeLinks?: boolean,
|
|
1349
|
+
versionDescriptor?: Git.GitVersionDescriptor,
|
|
1350
|
+
zipForUnix?: boolean
|
|
1351
|
+
): Promise<Git.GitItem[]> {
|
|
1352
|
+
|
|
1353
|
+
const queryValues: any = {
|
|
1354
|
+
scopePath: scopePath,
|
|
1355
|
+
recursionLevel: recursionLevel,
|
|
1356
|
+
includeContentMetadata: includeContentMetadata,
|
|
1357
|
+
latestProcessedChange: latestProcessedChange,
|
|
1358
|
+
download: download,
|
|
1359
|
+
includeLinks: includeLinks,
|
|
1360
|
+
versionDescriptor: versionDescriptor,
|
|
1361
|
+
zipForUnix: zipForUnix
|
|
1362
|
+
};
|
|
1363
|
+
|
|
1364
|
+
return this.beginRequest<Git.GitItem[]>({
|
|
1365
|
+
apiVersion: "7.2-preview.1",
|
|
1366
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/HfsItems/{*path}",
|
|
1367
|
+
routeValues: {
|
|
1368
|
+
project: project,
|
|
1369
|
+
repositoryId: repositoryId
|
|
1370
|
+
},
|
|
1371
|
+
queryParams: queryValues
|
|
1372
|
+
});
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.
|
|
1377
|
+
*
|
|
1378
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1379
|
+
* @param path - The item path.
|
|
1380
|
+
* @param project - Project ID or project name
|
|
1381
|
+
* @param scopePath - The path scope. The default is null.
|
|
1382
|
+
* @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
|
|
1383
|
+
* @param includeContentMetadata - Set to true to include content metadata. Default is false.
|
|
1384
|
+
* @param latestProcessedChange - Set to true to include the latest changes. Default is false.
|
|
1385
|
+
* @param download - Set to true to download the response as a file. Default is false.
|
|
1386
|
+
* @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
|
|
1387
|
+
* @param includeContent - Set to true to include item content when requesting json. Default is false.
|
|
1388
|
+
* @param resolveHfs - Set to true to resolve Git HFS pointer files to return actual content from Git HFS. Default is true.
|
|
1389
|
+
* @param sanitize - Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false.
|
|
1390
|
+
*/
|
|
1391
|
+
public async getHfsItemText(
|
|
1392
|
+
repositoryId: string,
|
|
1393
|
+
path: string,
|
|
1394
|
+
project?: string,
|
|
1395
|
+
scopePath?: string,
|
|
1396
|
+
recursionLevel?: Git.VersionControlRecursionType,
|
|
1397
|
+
includeContentMetadata?: boolean,
|
|
1398
|
+
latestProcessedChange?: boolean,
|
|
1399
|
+
download?: boolean,
|
|
1400
|
+
versionDescriptor?: Git.GitVersionDescriptor,
|
|
1401
|
+
includeContent?: boolean,
|
|
1402
|
+
resolveHfs?: boolean,
|
|
1403
|
+
sanitize?: boolean
|
|
1404
|
+
): Promise<string> {
|
|
1405
|
+
|
|
1406
|
+
const queryValues: any = {
|
|
1407
|
+
path: path,
|
|
1408
|
+
scopePath: scopePath,
|
|
1409
|
+
recursionLevel: recursionLevel,
|
|
1410
|
+
includeContentMetadata: includeContentMetadata,
|
|
1411
|
+
latestProcessedChange: latestProcessedChange,
|
|
1412
|
+
download: download,
|
|
1413
|
+
versionDescriptor: versionDescriptor,
|
|
1414
|
+
includeContent: includeContent,
|
|
1415
|
+
resolveHfs: resolveHfs,
|
|
1416
|
+
sanitize: sanitize
|
|
1417
|
+
};
|
|
1418
|
+
|
|
1419
|
+
return this.beginRequest<string>({
|
|
1420
|
+
apiVersion: "7.2-preview.1",
|
|
1421
|
+
httpResponseType: "text/plain",
|
|
1422
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/HfsItems/{*path}",
|
|
1423
|
+
routeValues: {
|
|
1424
|
+
project: project,
|
|
1425
|
+
repositoryId: repositoryId
|
|
1426
|
+
},
|
|
1427
|
+
queryParams: queryValues
|
|
1428
|
+
});
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
/**
|
|
1432
|
+
* Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.
|
|
1433
|
+
*
|
|
1434
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1435
|
+
* @param path - The item path.
|
|
1436
|
+
* @param project - Project ID or project name
|
|
1437
|
+
* @param scopePath - The path scope. The default is null.
|
|
1438
|
+
* @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
|
|
1439
|
+
* @param includeContentMetadata - Set to true to include content metadata. Default is false.
|
|
1440
|
+
* @param latestProcessedChange - Set to true to include the latest changes. Default is false.
|
|
1441
|
+
* @param download - Set to true to download the response as a file. Default is false.
|
|
1442
|
+
* @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
|
|
1443
|
+
* @param includeContent - Set to true to include item content when requesting json. Default is false.
|
|
1444
|
+
* @param resolveHfs - Set to true to resolve Git HFS pointer files to return actual content from Git HFS. Default is true.
|
|
1445
|
+
* @param sanitize - Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false.
|
|
1446
|
+
*/
|
|
1447
|
+
public async getHfsItemZip(
|
|
1448
|
+
repositoryId: string,
|
|
1449
|
+
path: string,
|
|
1450
|
+
project?: string,
|
|
1451
|
+
scopePath?: string,
|
|
1452
|
+
recursionLevel?: Git.VersionControlRecursionType,
|
|
1453
|
+
includeContentMetadata?: boolean,
|
|
1454
|
+
latestProcessedChange?: boolean,
|
|
1455
|
+
download?: boolean,
|
|
1456
|
+
versionDescriptor?: Git.GitVersionDescriptor,
|
|
1457
|
+
includeContent?: boolean,
|
|
1458
|
+
resolveHfs?: boolean,
|
|
1459
|
+
sanitize?: boolean
|
|
1460
|
+
): Promise<ArrayBuffer> {
|
|
1461
|
+
|
|
1462
|
+
const queryValues: any = {
|
|
1463
|
+
path: path,
|
|
1464
|
+
scopePath: scopePath,
|
|
1465
|
+
recursionLevel: recursionLevel,
|
|
1466
|
+
includeContentMetadata: includeContentMetadata,
|
|
1467
|
+
latestProcessedChange: latestProcessedChange,
|
|
1468
|
+
download: download,
|
|
1469
|
+
versionDescriptor: versionDescriptor,
|
|
1470
|
+
includeContent: includeContent,
|
|
1471
|
+
resolveHfs: resolveHfs,
|
|
1472
|
+
sanitize: sanitize
|
|
1473
|
+
};
|
|
1474
|
+
|
|
1475
|
+
return this.beginRequest<ArrayBuffer>({
|
|
1476
|
+
apiVersion: "7.2-preview.1",
|
|
1477
|
+
httpResponseType: "application/zip",
|
|
1478
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/HfsItems/{*path}",
|
|
1479
|
+
routeValues: {
|
|
1480
|
+
project: project,
|
|
1481
|
+
repositoryId: repositoryId
|
|
1482
|
+
},
|
|
1483
|
+
queryParams: queryValues
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
/**
|
|
1488
|
+
* Create an import request.
|
|
1489
|
+
*
|
|
1490
|
+
* @param importRequest - The import request to create.
|
|
1491
|
+
* @param project - Project ID or project name
|
|
1492
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1493
|
+
*/
|
|
1494
|
+
public async createImportRequest(
|
|
1495
|
+
importRequest: Git.GitImportRequest,
|
|
1496
|
+
project: string,
|
|
1497
|
+
repositoryId: string
|
|
1498
|
+
): Promise<Git.GitImportRequest> {
|
|
1499
|
+
|
|
1500
|
+
return this.beginRequest<Git.GitImportRequest>({
|
|
1501
|
+
apiVersion: "7.2-preview.1",
|
|
1502
|
+
method: "POST",
|
|
1503
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/importRequests/{importRequestId}",
|
|
1504
|
+
routeValues: {
|
|
1505
|
+
project: project,
|
|
1506
|
+
repositoryId: repositoryId
|
|
1507
|
+
},
|
|
1508
|
+
body: importRequest
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
/**
|
|
1513
|
+
* Retrieve a particular import request.
|
|
1514
|
+
*
|
|
1515
|
+
* @param project - Project ID or project name
|
|
1516
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1517
|
+
* @param importRequestId - The unique identifier for the import request.
|
|
1518
|
+
*/
|
|
1519
|
+
public async getImportRequest(
|
|
1520
|
+
project: string,
|
|
1521
|
+
repositoryId: string,
|
|
1522
|
+
importRequestId: number
|
|
1523
|
+
): Promise<Git.GitImportRequest> {
|
|
1524
|
+
|
|
1525
|
+
return this.beginRequest<Git.GitImportRequest>({
|
|
1526
|
+
apiVersion: "7.2-preview.1",
|
|
1527
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/importRequests/{importRequestId}",
|
|
1528
|
+
routeValues: {
|
|
1529
|
+
project: project,
|
|
1530
|
+
repositoryId: repositoryId,
|
|
1531
|
+
importRequestId: importRequestId
|
|
1532
|
+
}
|
|
1533
|
+
});
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
/**
|
|
1537
|
+
* Retrieve import requests for a repository.
|
|
1538
|
+
*
|
|
1539
|
+
* @param project - Project ID or project name
|
|
1540
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1541
|
+
* @param includeAbandoned - True to include abandoned import requests in the results.
|
|
1542
|
+
*/
|
|
1543
|
+
public async queryImportRequests(
|
|
1544
|
+
project: string,
|
|
1545
|
+
repositoryId: string,
|
|
1546
|
+
includeAbandoned?: boolean
|
|
1547
|
+
): Promise<Git.GitImportRequest[]> {
|
|
1548
|
+
|
|
1549
|
+
const queryValues: any = {
|
|
1550
|
+
includeAbandoned: includeAbandoned
|
|
1551
|
+
};
|
|
1552
|
+
|
|
1553
|
+
return this.beginRequest<Git.GitImportRequest[]>({
|
|
1554
|
+
apiVersion: "7.2-preview.1",
|
|
1555
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/importRequests/{importRequestId}",
|
|
1556
|
+
routeValues: {
|
|
1557
|
+
project: project,
|
|
1558
|
+
repositoryId: repositoryId
|
|
1559
|
+
},
|
|
1560
|
+
queryParams: queryValues
|
|
1561
|
+
});
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
/**
|
|
1565
|
+
* Retry or abandon a failed import request.
|
|
1566
|
+
*
|
|
1567
|
+
* @param importRequestToUpdate - The updated version of the import request. Currently, the only change allowed is setting the Status to Queued or Abandoned.
|
|
1568
|
+
* @param project - Project ID or project name
|
|
1569
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1570
|
+
* @param importRequestId - The unique identifier for the import request to update.
|
|
1571
|
+
*/
|
|
1572
|
+
public async updateImportRequest(
|
|
1573
|
+
importRequestToUpdate: Git.GitImportRequest,
|
|
1574
|
+
project: string,
|
|
1575
|
+
repositoryId: string,
|
|
1576
|
+
importRequestId: number
|
|
1577
|
+
): Promise<Git.GitImportRequest> {
|
|
1578
|
+
|
|
1579
|
+
return this.beginRequest<Git.GitImportRequest>({
|
|
1580
|
+
apiVersion: "7.2-preview.1",
|
|
1581
|
+
method: "PATCH",
|
|
1582
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/importRequests/{importRequestId}",
|
|
1583
|
+
routeValues: {
|
|
1584
|
+
project: project,
|
|
1585
|
+
repositoryId: repositoryId,
|
|
1586
|
+
importRequestId: importRequestId
|
|
1587
|
+
},
|
|
1588
|
+
body: importRequestToUpdate
|
|
1589
|
+
});
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
/**
|
|
1593
|
+
* Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.
|
|
1594
|
+
*
|
|
1595
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1596
|
+
* @param path - The item path.
|
|
1597
|
+
* @param project - Project ID or project name
|
|
1598
|
+
* @param scopePath - The path scope. The default is null.
|
|
1599
|
+
* @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
|
|
1600
|
+
* @param includeContentMetadata - Set to true to include content metadata. Default is false.
|
|
1601
|
+
* @param latestProcessedChange - Set to true to include the latest changes. Default is false.
|
|
1602
|
+
* @param download - Set to true to download the response as a file. Default is false.
|
|
1603
|
+
* @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
|
|
1604
|
+
* @param includeContent - Set to true to include item content when requesting json. Default is false.
|
|
1605
|
+
* @param resolveLfs - Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.
|
|
1606
|
+
* @param sanitize - Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false.
|
|
1607
|
+
*/
|
|
1608
|
+
public async getItem(
|
|
1609
|
+
repositoryId: string,
|
|
1610
|
+
path: string,
|
|
1611
|
+
project?: string,
|
|
1612
|
+
scopePath?: string,
|
|
1613
|
+
recursionLevel?: Git.VersionControlRecursionType,
|
|
1614
|
+
includeContentMetadata?: boolean,
|
|
1615
|
+
latestProcessedChange?: boolean,
|
|
1616
|
+
download?: boolean,
|
|
1617
|
+
versionDescriptor?: Git.GitVersionDescriptor,
|
|
1618
|
+
includeContent?: boolean,
|
|
1619
|
+
resolveLfs?: boolean,
|
|
1620
|
+
sanitize?: boolean
|
|
1621
|
+
): Promise<Git.GitItem> {
|
|
1622
|
+
|
|
1623
|
+
const queryValues: any = {
|
|
1624
|
+
path: path,
|
|
1625
|
+
scopePath: scopePath,
|
|
1626
|
+
recursionLevel: recursionLevel,
|
|
1627
|
+
includeContentMetadata: includeContentMetadata,
|
|
1628
|
+
latestProcessedChange: latestProcessedChange,
|
|
1629
|
+
download: download,
|
|
1630
|
+
versionDescriptor: versionDescriptor,
|
|
1631
|
+
includeContent: includeContent,
|
|
1632
|
+
resolveLfs: resolveLfs,
|
|
1633
|
+
sanitize: sanitize
|
|
1634
|
+
};
|
|
1635
|
+
|
|
1636
|
+
return this.beginRequest<Git.GitItem>({
|
|
1637
|
+
apiVersion: "7.2-preview.1",
|
|
1638
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Items/{*path}",
|
|
1639
|
+
routeValues: {
|
|
1640
|
+
project: project,
|
|
1641
|
+
repositoryId: repositoryId
|
|
1642
|
+
},
|
|
1643
|
+
queryParams: queryValues
|
|
1644
|
+
});
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
/**
|
|
1648
|
+
* Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.
|
|
1649
|
+
*
|
|
1650
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1651
|
+
* @param path - The item path.
|
|
1652
|
+
* @param project - Project ID or project name
|
|
1653
|
+
* @param scopePath - The path scope. The default is null.
|
|
1654
|
+
* @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
|
|
1655
|
+
* @param includeContentMetadata - Set to true to include content metadata. Default is false.
|
|
1656
|
+
* @param latestProcessedChange - Set to true to include the latest changes. Default is false.
|
|
1657
|
+
* @param download - Set to true to download the response as a file. Default is false.
|
|
1658
|
+
* @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
|
|
1659
|
+
* @param includeContent - Set to true to include item content when requesting json. Default is false.
|
|
1660
|
+
* @param resolveLfs - Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.
|
|
1661
|
+
* @param sanitize - Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false.
|
|
1662
|
+
*/
|
|
1663
|
+
public async getItemContent(
|
|
1664
|
+
repositoryId: string,
|
|
1665
|
+
path: string,
|
|
1666
|
+
project?: string,
|
|
1667
|
+
scopePath?: string,
|
|
1668
|
+
recursionLevel?: Git.VersionControlRecursionType,
|
|
1669
|
+
includeContentMetadata?: boolean,
|
|
1670
|
+
latestProcessedChange?: boolean,
|
|
1671
|
+
download?: boolean,
|
|
1672
|
+
versionDescriptor?: Git.GitVersionDescriptor,
|
|
1673
|
+
includeContent?: boolean,
|
|
1674
|
+
resolveLfs?: boolean,
|
|
1675
|
+
sanitize?: boolean
|
|
1676
|
+
): Promise<ArrayBuffer> {
|
|
1677
|
+
|
|
1678
|
+
const queryValues: any = {
|
|
1679
|
+
path: path,
|
|
1680
|
+
scopePath: scopePath,
|
|
1681
|
+
recursionLevel: recursionLevel,
|
|
1682
|
+
includeContentMetadata: includeContentMetadata,
|
|
1683
|
+
latestProcessedChange: latestProcessedChange,
|
|
1684
|
+
download: download,
|
|
1685
|
+
versionDescriptor: versionDescriptor,
|
|
1686
|
+
includeContent: includeContent,
|
|
1687
|
+
resolveLfs: resolveLfs,
|
|
1688
|
+
sanitize: sanitize
|
|
1689
|
+
};
|
|
1690
|
+
|
|
1691
|
+
return this.beginRequest<ArrayBuffer>({
|
|
1692
|
+
apiVersion: "7.2-preview.1",
|
|
1693
|
+
httpResponseType: "application/octet-stream",
|
|
1694
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Items/{*path}",
|
|
1695
|
+
routeValues: {
|
|
1696
|
+
project: project,
|
|
1697
|
+
repositoryId: repositoryId
|
|
1698
|
+
},
|
|
1699
|
+
queryParams: queryValues
|
|
1700
|
+
});
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
/**
|
|
1704
|
+
* Get Item Metadata and/or Content for a collection of items. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download.
|
|
1705
|
+
*
|
|
1706
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1707
|
+
* @param project - Project ID or project name
|
|
1708
|
+
* @param scopePath - The path scope. The default is null.
|
|
1709
|
+
* @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
|
|
1710
|
+
* @param includeContentMetadata - Set to true to include content metadata. Default is false.
|
|
1711
|
+
* @param latestProcessedChange - Set to true to include the latest changes. Default is false.
|
|
1712
|
+
* @param download - Set to true to download the response as a file. Default is false.
|
|
1713
|
+
* @param includeLinks - Set to true to include links to items. Default is false.
|
|
1714
|
+
* @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
|
|
1715
|
+
* @param zipForUnix - Set to true to keep the file permissions for unix (and POSIX) systems like executables and symlinks
|
|
1716
|
+
*/
|
|
1717
|
+
public async getItems(
|
|
1718
|
+
repositoryId: string,
|
|
1719
|
+
project?: string,
|
|
1720
|
+
scopePath?: string,
|
|
1721
|
+
recursionLevel?: Git.VersionControlRecursionType,
|
|
1722
|
+
includeContentMetadata?: boolean,
|
|
1723
|
+
latestProcessedChange?: boolean,
|
|
1724
|
+
download?: boolean,
|
|
1725
|
+
includeLinks?: boolean,
|
|
1726
|
+
versionDescriptor?: Git.GitVersionDescriptor,
|
|
1727
|
+
zipForUnix?: boolean
|
|
1728
|
+
): Promise<Git.GitItem[]> {
|
|
1729
|
+
|
|
1730
|
+
const queryValues: any = {
|
|
1731
|
+
scopePath: scopePath,
|
|
1732
|
+
recursionLevel: recursionLevel,
|
|
1733
|
+
includeContentMetadata: includeContentMetadata,
|
|
1734
|
+
latestProcessedChange: latestProcessedChange,
|
|
1735
|
+
download: download,
|
|
1736
|
+
includeLinks: includeLinks,
|
|
1737
|
+
versionDescriptor: versionDescriptor,
|
|
1738
|
+
zipForUnix: zipForUnix
|
|
1739
|
+
};
|
|
1740
|
+
|
|
1741
|
+
return this.beginRequest<Git.GitItem[]>({
|
|
1742
|
+
apiVersion: "7.2-preview.1",
|
|
1743
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Items/{*path}",
|
|
1744
|
+
routeValues: {
|
|
1745
|
+
project: project,
|
|
1746
|
+
repositoryId: repositoryId
|
|
1747
|
+
},
|
|
1748
|
+
queryParams: queryValues
|
|
1749
|
+
});
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
/**
|
|
1753
|
+
* Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.
|
|
1754
|
+
*
|
|
1755
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1756
|
+
* @param path - The item path.
|
|
1757
|
+
* @param project - Project ID or project name
|
|
1758
|
+
* @param scopePath - The path scope. The default is null.
|
|
1759
|
+
* @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
|
|
1760
|
+
* @param includeContentMetadata - Set to true to include content metadata. Default is false.
|
|
1761
|
+
* @param latestProcessedChange - Set to true to include the latest changes. Default is false.
|
|
1762
|
+
* @param download - Set to true to download the response as a file. Default is false.
|
|
1763
|
+
* @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
|
|
1764
|
+
* @param includeContent - Set to true to include item content when requesting json. Default is false.
|
|
1765
|
+
* @param resolveLfs - Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.
|
|
1766
|
+
* @param sanitize - Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false.
|
|
1767
|
+
*/
|
|
1768
|
+
public async getItemText(
|
|
1769
|
+
repositoryId: string,
|
|
1770
|
+
path: string,
|
|
1771
|
+
project?: string,
|
|
1772
|
+
scopePath?: string,
|
|
1773
|
+
recursionLevel?: Git.VersionControlRecursionType,
|
|
1774
|
+
includeContentMetadata?: boolean,
|
|
1775
|
+
latestProcessedChange?: boolean,
|
|
1776
|
+
download?: boolean,
|
|
1777
|
+
versionDescriptor?: Git.GitVersionDescriptor,
|
|
1778
|
+
includeContent?: boolean,
|
|
1779
|
+
resolveLfs?: boolean,
|
|
1780
|
+
sanitize?: boolean
|
|
1781
|
+
): Promise<string> {
|
|
1782
|
+
|
|
1783
|
+
const queryValues: any = {
|
|
1784
|
+
path: path,
|
|
1785
|
+
scopePath: scopePath,
|
|
1786
|
+
recursionLevel: recursionLevel,
|
|
1787
|
+
includeContentMetadata: includeContentMetadata,
|
|
1788
|
+
latestProcessedChange: latestProcessedChange,
|
|
1789
|
+
download: download,
|
|
1790
|
+
versionDescriptor: versionDescriptor,
|
|
1791
|
+
includeContent: includeContent,
|
|
1792
|
+
resolveLfs: resolveLfs,
|
|
1793
|
+
sanitize: sanitize
|
|
1794
|
+
};
|
|
1795
|
+
|
|
1796
|
+
return this.beginRequest<string>({
|
|
1797
|
+
apiVersion: "7.2-preview.1",
|
|
1798
|
+
httpResponseType: "text/plain",
|
|
1799
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Items/{*path}",
|
|
1800
|
+
routeValues: {
|
|
1801
|
+
project: project,
|
|
1802
|
+
repositoryId: repositoryId
|
|
1803
|
+
},
|
|
1804
|
+
queryParams: queryValues
|
|
1805
|
+
});
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
/**
|
|
1809
|
+
* Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download.
|
|
1810
|
+
*
|
|
1811
|
+
* @param repositoryId - The name or ID of the repository.
|
|
1812
|
+
* @param path - The item path.
|
|
1813
|
+
* @param project - Project ID or project name
|
|
1814
|
+
* @param scopePath - The path scope. The default is null.
|
|
1815
|
+
* @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
|
|
1816
|
+
* @param includeContentMetadata - Set to true to include content metadata. Default is false.
|
|
1817
|
+
* @param latestProcessedChange - Set to true to include the latest changes. Default is false.
|
|
1818
|
+
* @param download - Set to true to download the response as a file. Default is false.
|
|
1819
|
+
* @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
|
|
1820
|
+
* @param includeContent - Set to true to include item content when requesting json. Default is false.
|
|
1821
|
+
* @param resolveLfs - Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.
|
|
1822
|
+
* @param sanitize - Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false.
|
|
1823
|
+
*/
|
|
1824
|
+
public async getItemZip(
|
|
1825
|
+
repositoryId: string,
|
|
1826
|
+
path: string,
|
|
1827
|
+
project?: string,
|
|
1828
|
+
scopePath?: string,
|
|
1829
|
+
recursionLevel?: Git.VersionControlRecursionType,
|
|
1830
|
+
includeContentMetadata?: boolean,
|
|
1831
|
+
latestProcessedChange?: boolean,
|
|
1832
|
+
download?: boolean,
|
|
1833
|
+
versionDescriptor?: Git.GitVersionDescriptor,
|
|
1834
|
+
includeContent?: boolean,
|
|
1835
|
+
resolveLfs?: boolean,
|
|
1836
|
+
sanitize?: boolean
|
|
1837
|
+
): Promise<ArrayBuffer> {
|
|
1838
|
+
|
|
1839
|
+
const queryValues: any = {
|
|
1840
|
+
path: path,
|
|
1841
|
+
scopePath: scopePath,
|
|
1842
|
+
recursionLevel: recursionLevel,
|
|
1843
|
+
includeContentMetadata: includeContentMetadata,
|
|
1844
|
+
latestProcessedChange: latestProcessedChange,
|
|
1845
|
+
download: download,
|
|
1846
|
+
versionDescriptor: versionDescriptor,
|
|
1847
|
+
includeContent: includeContent,
|
|
1848
|
+
resolveLfs: resolveLfs,
|
|
1849
|
+
sanitize: sanitize
|
|
1850
|
+
};
|
|
1851
|
+
|
|
1852
|
+
return this.beginRequest<ArrayBuffer>({
|
|
1853
|
+
apiVersion: "7.2-preview.1",
|
|
1854
|
+
httpResponseType: "application/zip",
|
|
1855
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Items/{*path}",
|
|
1856
|
+
routeValues: {
|
|
1857
|
+
project: project,
|
|
1858
|
+
repositoryId: repositoryId
|
|
1859
|
+
},
|
|
1860
|
+
queryParams: queryValues
|
|
1861
|
+
});
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
/**
|
|
1865
|
+
* Post for retrieving a creating a batch out of a set of items in a repo / project given a list of paths or a long path
|
|
1866
|
+
*
|
|
1867
|
+
* @param requestData - Request data attributes: ItemDescriptors, IncludeContentMetadata, LatestProcessedChange, IncludeLinks. ItemDescriptors: Collection of items to fetch, including path, version, and recursion level. IncludeContentMetadata: Whether to include metadata for all items LatestProcessedChange: Whether to include shallow ref to commit that last changed each item. IncludeLinks: Whether to include the _links field on the shallow references.
|
|
1868
|
+
* @param repositoryId - The name or ID of the repository
|
|
1869
|
+
* @param project - Project ID or project name
|
|
1870
|
+
*/
|
|
1871
|
+
public async getItemsBatch(
|
|
1872
|
+
requestData: Git.GitItemRequestData,
|
|
1873
|
+
repositoryId: string,
|
|
1874
|
+
project?: string
|
|
1875
|
+
): Promise<Git.GitItem[][]> {
|
|
1876
|
+
|
|
1877
|
+
return this.beginRequest<Git.GitItem[][]>({
|
|
1878
|
+
apiVersion: "7.2-preview.1",
|
|
1879
|
+
method: "POST",
|
|
1880
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/ItemsBatch",
|
|
1881
|
+
routeValues: {
|
|
1882
|
+
project: project,
|
|
1883
|
+
repositoryId: repositoryId
|
|
1884
|
+
},
|
|
1885
|
+
body: requestData
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* Find the merge bases of two commits, optionally across forks. If otherRepositoryId is not specified, the merge bases will only be calculated within the context of the local repositoryNameOrId.
|
|
1891
|
+
*
|
|
1892
|
+
* @param repositoryNameOrId - ID or name of the local repository.
|
|
1893
|
+
* @param commitId - First commit, usually the tip of the target branch of the potential merge.
|
|
1894
|
+
* @param otherCommitId - Other commit, usually the tip of the source branch of the potential merge.
|
|
1895
|
+
* @param project - Project ID or project name
|
|
1896
|
+
* @param otherCollectionId - The collection ID where otherCommitId lives.
|
|
1897
|
+
* @param otherRepositoryId - The repository ID where otherCommitId lives.
|
|
1898
|
+
*/
|
|
1899
|
+
public async getMergeBases(
|
|
1900
|
+
repositoryNameOrId: string,
|
|
1901
|
+
commitId: string,
|
|
1902
|
+
otherCommitId: string,
|
|
1903
|
+
project?: string,
|
|
1904
|
+
otherCollectionId?: string,
|
|
1905
|
+
otherRepositoryId?: string
|
|
1906
|
+
): Promise<Git.GitCommitRef[]> {
|
|
1907
|
+
|
|
1908
|
+
const queryValues: any = {
|
|
1909
|
+
otherCommitId: otherCommitId,
|
|
1910
|
+
otherCollectionId: otherCollectionId,
|
|
1911
|
+
otherRepositoryId: otherRepositoryId
|
|
1912
|
+
};
|
|
1913
|
+
|
|
1914
|
+
return this.beginRequest<Git.GitCommitRef[]>({
|
|
1915
|
+
apiVersion: "7.2-preview.1",
|
|
1916
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/commits/{commitId}/mergeBases",
|
|
1917
|
+
routeValues: {
|
|
1918
|
+
project: project,
|
|
1919
|
+
repositoryNameOrId: repositoryNameOrId,
|
|
1920
|
+
commitId: commitId
|
|
1921
|
+
},
|
|
1922
|
+
queryParams: queryValues
|
|
1923
|
+
});
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
/**
|
|
1927
|
+
* Request a git merge operation. Currently we support merging only 2 commits.
|
|
1928
|
+
*
|
|
1929
|
+
* @param mergeParameters - Parents commitIds and merge commit messsage.
|
|
1930
|
+
* @param project - Project ID or project name
|
|
1931
|
+
* @param repositoryNameOrId - The name or ID of the repository.
|
|
1932
|
+
* @param includeLinks - True to include links
|
|
1933
|
+
*/
|
|
1934
|
+
public async createMergeRequest(
|
|
1935
|
+
mergeParameters: Git.GitMergeParameters,
|
|
1936
|
+
project: string,
|
|
1937
|
+
repositoryNameOrId: string,
|
|
1938
|
+
includeLinks?: boolean
|
|
1939
|
+
): Promise<Git.GitMerge> {
|
|
1940
|
+
|
|
1941
|
+
const queryValues: any = {
|
|
1942
|
+
includeLinks: includeLinks
|
|
1943
|
+
};
|
|
1944
|
+
|
|
1945
|
+
return this.beginRequest<Git.GitMerge>({
|
|
1946
|
+
apiVersion: "7.2-preview.1",
|
|
1947
|
+
method: "POST",
|
|
1948
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/merges/{mergeOperationId}",
|
|
1949
|
+
routeValues: {
|
|
1950
|
+
project: project,
|
|
1951
|
+
repositoryNameOrId: repositoryNameOrId
|
|
1952
|
+
},
|
|
1953
|
+
queryParams: queryValues,
|
|
1954
|
+
body: mergeParameters
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
/**
|
|
1959
|
+
* Get a specific merge operation's details.
|
|
1960
|
+
*
|
|
1961
|
+
* @param project - Project ID or project name
|
|
1962
|
+
* @param repositoryNameOrId - The name or ID of the repository.
|
|
1963
|
+
* @param mergeOperationId - OperationId of the merge request.
|
|
1964
|
+
* @param includeLinks - True to include links
|
|
1965
|
+
*/
|
|
1966
|
+
public async getMergeRequest(
|
|
1967
|
+
project: string,
|
|
1968
|
+
repositoryNameOrId: string,
|
|
1969
|
+
mergeOperationId: number,
|
|
1970
|
+
includeLinks?: boolean
|
|
1971
|
+
): Promise<Git.GitMerge> {
|
|
1972
|
+
|
|
1973
|
+
const queryValues: any = {
|
|
1974
|
+
includeLinks: includeLinks
|
|
1975
|
+
};
|
|
1976
|
+
|
|
1977
|
+
return this.beginRequest<Git.GitMerge>({
|
|
1978
|
+
apiVersion: "7.2-preview.1",
|
|
1979
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/merges/{mergeOperationId}",
|
|
1980
|
+
routeValues: {
|
|
1981
|
+
project: project,
|
|
1982
|
+
repositoryNameOrId: repositoryNameOrId,
|
|
1983
|
+
mergeOperationId: mergeOperationId
|
|
1984
|
+
},
|
|
1985
|
+
queryParams: queryValues
|
|
1986
|
+
});
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
/**
|
|
1990
|
+
* Attach a new file to a pull request.
|
|
1991
|
+
*
|
|
1992
|
+
* @param content - Content to upload
|
|
1993
|
+
* @param fileName - The name of the file.
|
|
1994
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
1995
|
+
* @param pullRequestId - ID of the pull request.
|
|
1996
|
+
* @param project - Project ID or project name
|
|
1997
|
+
*/
|
|
1998
|
+
public async createAttachment(
|
|
1999
|
+
content: any,
|
|
2000
|
+
fileName: string,
|
|
2001
|
+
repositoryId: string,
|
|
2002
|
+
pullRequestId: number,
|
|
2003
|
+
project?: string
|
|
2004
|
+
): Promise<Git.Attachment> {
|
|
2005
|
+
|
|
2006
|
+
return this.beginRequest<Git.Attachment>({
|
|
2007
|
+
apiVersion: "7.2-preview.1",
|
|
2008
|
+
method: "POST",
|
|
2009
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}",
|
|
2010
|
+
routeValues: {
|
|
2011
|
+
project: project,
|
|
2012
|
+
fileName: fileName,
|
|
2013
|
+
repositoryId: repositoryId,
|
|
2014
|
+
pullRequestId: pullRequestId
|
|
2015
|
+
},
|
|
2016
|
+
customHeaders: {
|
|
2017
|
+
"Content-Type": "application/octet-stream",
|
|
2018
|
+
},
|
|
2019
|
+
body: content,
|
|
2020
|
+
isRawData: true
|
|
2021
|
+
});
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
/**
|
|
2025
|
+
* Delete a pull request attachment.
|
|
2026
|
+
*
|
|
2027
|
+
* @param fileName - The name of the attachment to delete.
|
|
2028
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2029
|
+
* @param pullRequestId - ID of the pull request.
|
|
2030
|
+
* @param project - Project ID or project name
|
|
2031
|
+
*/
|
|
2032
|
+
public async deleteAttachment(
|
|
2033
|
+
fileName: string,
|
|
2034
|
+
repositoryId: string,
|
|
2035
|
+
pullRequestId: number,
|
|
2036
|
+
project?: string
|
|
2037
|
+
): Promise<void> {
|
|
2038
|
+
|
|
2039
|
+
return this.beginRequest<void>({
|
|
2040
|
+
apiVersion: "7.2-preview.1",
|
|
2041
|
+
method: "DELETE",
|
|
2042
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}",
|
|
2043
|
+
routeValues: {
|
|
2044
|
+
project: project,
|
|
2045
|
+
fileName: fileName,
|
|
2046
|
+
repositoryId: repositoryId,
|
|
2047
|
+
pullRequestId: pullRequestId
|
|
2048
|
+
}
|
|
2049
|
+
});
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
/**
|
|
2053
|
+
* Get the file content of a pull request attachment.
|
|
2054
|
+
*
|
|
2055
|
+
* @param fileName - The name of the attachment.
|
|
2056
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2057
|
+
* @param pullRequestId - ID of the pull request.
|
|
2058
|
+
* @param project - Project ID or project name
|
|
2059
|
+
*/
|
|
2060
|
+
public async getAttachmentContent(
|
|
2061
|
+
fileName: string,
|
|
2062
|
+
repositoryId: string,
|
|
2063
|
+
pullRequestId: number,
|
|
2064
|
+
project?: string
|
|
2065
|
+
): Promise<ArrayBuffer> {
|
|
2066
|
+
|
|
2067
|
+
return this.beginRequest<ArrayBuffer>({
|
|
2068
|
+
apiVersion: "7.2-preview.1",
|
|
2069
|
+
httpResponseType: "application/octet-stream",
|
|
2070
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}",
|
|
2071
|
+
routeValues: {
|
|
2072
|
+
project: project,
|
|
2073
|
+
fileName: fileName,
|
|
2074
|
+
repositoryId: repositoryId,
|
|
2075
|
+
pullRequestId: pullRequestId
|
|
2076
|
+
}
|
|
2077
|
+
});
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
/**
|
|
2081
|
+
* Get a list of files attached to a given pull request.
|
|
2082
|
+
*
|
|
2083
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2084
|
+
* @param pullRequestId - ID of the pull request.
|
|
2085
|
+
* @param project - Project ID or project name
|
|
2086
|
+
*/
|
|
2087
|
+
public async getAttachments(
|
|
2088
|
+
repositoryId: string,
|
|
2089
|
+
pullRequestId: number,
|
|
2090
|
+
project?: string
|
|
2091
|
+
): Promise<Git.Attachment[]> {
|
|
2092
|
+
|
|
2093
|
+
return this.beginRequest<Git.Attachment[]>({
|
|
2094
|
+
apiVersion: "7.2-preview.1",
|
|
2095
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}",
|
|
2096
|
+
routeValues: {
|
|
2097
|
+
project: project,
|
|
2098
|
+
repositoryId: repositoryId,
|
|
2099
|
+
pullRequestId: pullRequestId
|
|
2100
|
+
}
|
|
2101
|
+
});
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
/**
|
|
2105
|
+
* Get the file content of a pull request attachment.
|
|
2106
|
+
*
|
|
2107
|
+
* @param fileName - The name of the attachment.
|
|
2108
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2109
|
+
* @param pullRequestId - ID of the pull request.
|
|
2110
|
+
* @param project - Project ID or project name
|
|
2111
|
+
*/
|
|
2112
|
+
public async getAttachmentZip(
|
|
2113
|
+
fileName: string,
|
|
2114
|
+
repositoryId: string,
|
|
2115
|
+
pullRequestId: number,
|
|
2116
|
+
project?: string
|
|
2117
|
+
): Promise<ArrayBuffer> {
|
|
2118
|
+
|
|
2119
|
+
return this.beginRequest<ArrayBuffer>({
|
|
2120
|
+
apiVersion: "7.2-preview.1",
|
|
2121
|
+
httpResponseType: "application/zip",
|
|
2122
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}",
|
|
2123
|
+
routeValues: {
|
|
2124
|
+
project: project,
|
|
2125
|
+
fileName: fileName,
|
|
2126
|
+
repositoryId: repositoryId,
|
|
2127
|
+
pullRequestId: pullRequestId
|
|
2128
|
+
}
|
|
2129
|
+
});
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
/**
|
|
2133
|
+
* Add a like on a comment.
|
|
2134
|
+
*
|
|
2135
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
2136
|
+
* @param pullRequestId - ID of the pull request.
|
|
2137
|
+
* @param threadId - The ID of the thread that contains the comment.
|
|
2138
|
+
* @param commentId - The ID of the comment.
|
|
2139
|
+
* @param project - Project ID or project name
|
|
2140
|
+
*/
|
|
2141
|
+
public async createLike(
|
|
2142
|
+
repositoryId: string,
|
|
2143
|
+
pullRequestId: number,
|
|
2144
|
+
threadId: number,
|
|
2145
|
+
commentId: number,
|
|
2146
|
+
project?: string
|
|
2147
|
+
): Promise<void> {
|
|
2148
|
+
|
|
2149
|
+
return this.beginRequest<void>({
|
|
2150
|
+
apiVersion: "7.2-preview.1",
|
|
2151
|
+
method: "POST",
|
|
2152
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}/likes",
|
|
2153
|
+
routeValues: {
|
|
2154
|
+
project: project,
|
|
2155
|
+
repositoryId: repositoryId,
|
|
2156
|
+
pullRequestId: pullRequestId,
|
|
2157
|
+
threadId: threadId,
|
|
2158
|
+
commentId: commentId
|
|
2159
|
+
}
|
|
2160
|
+
});
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2163
|
+
/**
|
|
2164
|
+
* Delete a like on a comment.
|
|
2165
|
+
*
|
|
2166
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
2167
|
+
* @param pullRequestId - ID of the pull request.
|
|
2168
|
+
* @param threadId - The ID of the thread that contains the comment.
|
|
2169
|
+
* @param commentId - The ID of the comment.
|
|
2170
|
+
* @param project - Project ID or project name
|
|
2171
|
+
*/
|
|
2172
|
+
public async deleteLike(
|
|
2173
|
+
repositoryId: string,
|
|
2174
|
+
pullRequestId: number,
|
|
2175
|
+
threadId: number,
|
|
2176
|
+
commentId: number,
|
|
2177
|
+
project?: string
|
|
2178
|
+
): Promise<void> {
|
|
2179
|
+
|
|
2180
|
+
return this.beginRequest<void>({
|
|
2181
|
+
apiVersion: "7.2-preview.1",
|
|
2182
|
+
method: "DELETE",
|
|
2183
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}/likes",
|
|
2184
|
+
routeValues: {
|
|
2185
|
+
project: project,
|
|
2186
|
+
repositoryId: repositoryId,
|
|
2187
|
+
pullRequestId: pullRequestId,
|
|
2188
|
+
threadId: threadId,
|
|
2189
|
+
commentId: commentId
|
|
2190
|
+
}
|
|
2191
|
+
});
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
/**
|
|
2195
|
+
* Get likes for a comment.
|
|
2196
|
+
*
|
|
2197
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
2198
|
+
* @param pullRequestId - ID of the pull request.
|
|
2199
|
+
* @param threadId - The ID of the thread that contains the comment.
|
|
2200
|
+
* @param commentId - The ID of the comment.
|
|
2201
|
+
* @param project - Project ID or project name
|
|
2202
|
+
*/
|
|
2203
|
+
public async getLikes(
|
|
2204
|
+
repositoryId: string,
|
|
2205
|
+
pullRequestId: number,
|
|
2206
|
+
threadId: number,
|
|
2207
|
+
commentId: number,
|
|
2208
|
+
project?: string
|
|
2209
|
+
): Promise<WebApi.IdentityRef[]> {
|
|
2210
|
+
|
|
2211
|
+
return this.beginRequest<WebApi.IdentityRef[]>({
|
|
2212
|
+
apiVersion: "7.2-preview.1",
|
|
2213
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}/likes",
|
|
2214
|
+
routeValues: {
|
|
2215
|
+
project: project,
|
|
2216
|
+
repositoryId: repositoryId,
|
|
2217
|
+
pullRequestId: pullRequestId,
|
|
2218
|
+
threadId: threadId,
|
|
2219
|
+
commentId: commentId
|
|
2220
|
+
}
|
|
2221
|
+
});
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
/**
|
|
2225
|
+
* Get the commits for the specified iteration of a pull request.
|
|
2226
|
+
*
|
|
2227
|
+
* @param repositoryId - ID or name of the repository.
|
|
2228
|
+
* @param pullRequestId - ID of the pull request.
|
|
2229
|
+
* @param iterationId - ID of the iteration from which to get the commits.
|
|
2230
|
+
* @param project - Project ID or project name
|
|
2231
|
+
* @param top - Maximum number of commits to return. The maximum number of commits that can be returned per batch is 500.
|
|
2232
|
+
* @param skip - Number of commits to skip.
|
|
2233
|
+
*/
|
|
2234
|
+
public async getPullRequestIterationCommits(
|
|
2235
|
+
repositoryId: string,
|
|
2236
|
+
pullRequestId: number,
|
|
2237
|
+
iterationId: number,
|
|
2238
|
+
project?: string,
|
|
2239
|
+
top?: number,
|
|
2240
|
+
skip?: number
|
|
2241
|
+
): Promise<Git.GitCommitRef[]> {
|
|
2242
|
+
|
|
2243
|
+
const queryValues: any = {
|
|
2244
|
+
top: top,
|
|
2245
|
+
skip: skip
|
|
2246
|
+
};
|
|
2247
|
+
|
|
2248
|
+
return this.beginRequest<Git.GitCommitRef[]>({
|
|
2249
|
+
apiVersion: "7.2-preview.1",
|
|
2250
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/commits",
|
|
2251
|
+
routeValues: {
|
|
2252
|
+
project: project,
|
|
2253
|
+
repositoryId: repositoryId,
|
|
2254
|
+
pullRequestId: pullRequestId,
|
|
2255
|
+
iterationId: iterationId
|
|
2256
|
+
},
|
|
2257
|
+
queryParams: queryValues
|
|
2258
|
+
});
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2261
|
+
/**
|
|
2262
|
+
* Get the commits for the specified pull request.
|
|
2263
|
+
*
|
|
2264
|
+
* @param repositoryId - ID or name of the repository.
|
|
2265
|
+
* @param pullRequestId - ID of the pull request.
|
|
2266
|
+
* @param project - Project ID or project name
|
|
2267
|
+
*/
|
|
2268
|
+
public async getPullRequestCommits(
|
|
2269
|
+
repositoryId: string,
|
|
2270
|
+
pullRequestId: number,
|
|
2271
|
+
project?: string
|
|
2272
|
+
): Promise<WebApi.PagedList<Git.GitCommitRef>> {
|
|
2273
|
+
|
|
2274
|
+
return this.beginRequest<Response>({
|
|
2275
|
+
apiVersion: "7.2-preview.1",
|
|
2276
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/commits",
|
|
2277
|
+
routeValues: {
|
|
2278
|
+
project: project,
|
|
2279
|
+
repositoryId: repositoryId,
|
|
2280
|
+
pullRequestId: pullRequestId
|
|
2281
|
+
},
|
|
2282
|
+
returnRawResponse: true
|
|
2283
|
+
}).then(async response => {
|
|
2284
|
+
const body = <WebApi.PagedList<Git.GitCommitRef>>await response.text().then(deserializeVssJsonObject);
|
|
2285
|
+
body.continuationToken = response.headers.get("x-ms-continuationtoken");
|
|
2286
|
+
return body;
|
|
2287
|
+
});
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
/**
|
|
2291
|
+
* Retrieve one conflict for a pull request by ID
|
|
2292
|
+
*
|
|
2293
|
+
* @param repositoryId -
|
|
2294
|
+
* @param pullRequestId -
|
|
2295
|
+
* @param conflictId -
|
|
2296
|
+
* @param project - Project ID or project name
|
|
2297
|
+
*/
|
|
2298
|
+
public async getPullRequestConflict(
|
|
2299
|
+
repositoryId: string,
|
|
2300
|
+
pullRequestId: number,
|
|
2301
|
+
conflictId: number,
|
|
2302
|
+
project?: string
|
|
2303
|
+
): Promise<Git.GitConflict> {
|
|
2304
|
+
|
|
2305
|
+
return this.beginRequest<Git.GitConflict>({
|
|
2306
|
+
apiVersion: "7.2-preview.1",
|
|
2307
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/conflicts/{conflictId}",
|
|
2308
|
+
routeValues: {
|
|
2309
|
+
project: project,
|
|
2310
|
+
repositoryId: repositoryId,
|
|
2311
|
+
pullRequestId: pullRequestId,
|
|
2312
|
+
conflictId: conflictId
|
|
2313
|
+
}
|
|
2314
|
+
});
|
|
2315
|
+
}
|
|
2316
|
+
|
|
2317
|
+
/**
|
|
2318
|
+
* Retrieve all conflicts for a pull request
|
|
2319
|
+
*
|
|
2320
|
+
* @param repositoryId - The repository of the Pull Request.
|
|
2321
|
+
* @param pullRequestId - The pull request ID.
|
|
2322
|
+
* @param project - Project ID or project name
|
|
2323
|
+
* @param skip - Conflicts to skip.
|
|
2324
|
+
* @param top - Conflicts to return after skip.
|
|
2325
|
+
* @param includeObsolete - Includes obsolete conflicts.
|
|
2326
|
+
* @param excludeResolved - Excludes conflicts already resolved.
|
|
2327
|
+
* @param onlyResolved - Returns only the conflicts that are resolved.
|
|
2328
|
+
*/
|
|
2329
|
+
public async getPullRequestConflicts(
|
|
2330
|
+
repositoryId: string,
|
|
2331
|
+
pullRequestId: number,
|
|
2332
|
+
project?: string,
|
|
2333
|
+
skip?: number,
|
|
2334
|
+
top?: number,
|
|
2335
|
+
includeObsolete?: boolean,
|
|
2336
|
+
excludeResolved?: boolean,
|
|
2337
|
+
onlyResolved?: boolean
|
|
2338
|
+
): Promise<Git.GitConflict[]> {
|
|
2339
|
+
|
|
2340
|
+
const queryValues: any = {
|
|
2341
|
+
'$skip': skip,
|
|
2342
|
+
'$top': top,
|
|
2343
|
+
includeObsolete: includeObsolete,
|
|
2344
|
+
excludeResolved: excludeResolved,
|
|
2345
|
+
onlyResolved: onlyResolved
|
|
2346
|
+
};
|
|
2347
|
+
|
|
2348
|
+
return this.beginRequest<Git.GitConflict[]>({
|
|
2349
|
+
apiVersion: "7.2-preview.1",
|
|
2350
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/conflicts/{conflictId}",
|
|
2351
|
+
routeValues: {
|
|
2352
|
+
project: project,
|
|
2353
|
+
repositoryId: repositoryId,
|
|
2354
|
+
pullRequestId: pullRequestId
|
|
2355
|
+
},
|
|
2356
|
+
queryParams: queryValues
|
|
2357
|
+
});
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
/**
|
|
2361
|
+
* Update merge conflict resolution
|
|
2362
|
+
*
|
|
2363
|
+
* @param conflict -
|
|
2364
|
+
* @param repositoryId -
|
|
2365
|
+
* @param pullRequestId -
|
|
2366
|
+
* @param conflictId -
|
|
2367
|
+
* @param project - Project ID or project name
|
|
2368
|
+
*/
|
|
2369
|
+
public async updatePullRequestConflict(
|
|
2370
|
+
conflict: Git.GitConflict,
|
|
2371
|
+
repositoryId: string,
|
|
2372
|
+
pullRequestId: number,
|
|
2373
|
+
conflictId: number,
|
|
2374
|
+
project?: string
|
|
2375
|
+
): Promise<Git.GitConflict> {
|
|
2376
|
+
|
|
2377
|
+
return this.beginRequest<Git.GitConflict>({
|
|
2378
|
+
apiVersion: "7.2-preview.1",
|
|
2379
|
+
method: "PATCH",
|
|
2380
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/conflicts/{conflictId}",
|
|
2381
|
+
routeValues: {
|
|
2382
|
+
project: project,
|
|
2383
|
+
repositoryId: repositoryId,
|
|
2384
|
+
pullRequestId: pullRequestId,
|
|
2385
|
+
conflictId: conflictId
|
|
2386
|
+
},
|
|
2387
|
+
body: conflict
|
|
2388
|
+
});
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
/**
|
|
2392
|
+
* Update multiple merge conflict resolutions
|
|
2393
|
+
*
|
|
2394
|
+
* @param conflictUpdates -
|
|
2395
|
+
* @param repositoryId -
|
|
2396
|
+
* @param pullRequestId -
|
|
2397
|
+
* @param project - Project ID or project name
|
|
2398
|
+
*/
|
|
2399
|
+
public async updatePullRequestConflicts(
|
|
2400
|
+
conflictUpdates: Git.GitConflict[],
|
|
2401
|
+
repositoryId: string,
|
|
2402
|
+
pullRequestId: number,
|
|
2403
|
+
project?: string
|
|
2404
|
+
): Promise<Git.GitConflictUpdateResult[]> {
|
|
2405
|
+
|
|
2406
|
+
return this.beginRequest<Git.GitConflictUpdateResult[]>({
|
|
2407
|
+
apiVersion: "7.2-preview.1",
|
|
2408
|
+
method: "PATCH",
|
|
2409
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/conflicts/{conflictId}",
|
|
2410
|
+
routeValues: {
|
|
2411
|
+
project: project,
|
|
2412
|
+
repositoryId: repositoryId,
|
|
2413
|
+
pullRequestId: pullRequestId
|
|
2414
|
+
},
|
|
2415
|
+
body: conflictUpdates
|
|
2416
|
+
});
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
/**
|
|
2420
|
+
* Retrieve the changes made in a pull request between two iterations.
|
|
2421
|
+
*
|
|
2422
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
2423
|
+
* @param pullRequestId - ID of the pull request.
|
|
2424
|
+
* @param iterationId - ID of the pull request iteration. \<br /\> Iteration one is the head of the source branch at the time the pull request is created and subsequent iterations are created when there are pushes to the source branch. Allowed values are between 1 and the maximum iteration on this pull request.
|
|
2425
|
+
* @param project - Project ID or project name
|
|
2426
|
+
* @param top - Optional. The number of changes to retrieve. The default value is 100 and the maximum value is 2000.
|
|
2427
|
+
* @param skip - Optional. The number of changes to ignore. For example, to retrieve changes 101-150, set top 50 and skip to 100.
|
|
2428
|
+
* @param compareTo - ID of the pull request iteration to compare against. The default value is zero which indicates the comparison is made against the common commit between the source and target branches
|
|
2429
|
+
*/
|
|
2430
|
+
public async getPullRequestIterationChanges(
|
|
2431
|
+
repositoryId: string,
|
|
2432
|
+
pullRequestId: number,
|
|
2433
|
+
iterationId: number,
|
|
2434
|
+
project?: string,
|
|
2435
|
+
top?: number,
|
|
2436
|
+
skip?: number,
|
|
2437
|
+
compareTo?: number
|
|
2438
|
+
): Promise<Git.GitPullRequestIterationChanges> {
|
|
2439
|
+
|
|
2440
|
+
const queryValues: any = {
|
|
2441
|
+
'$top': top,
|
|
2442
|
+
'$skip': skip,
|
|
2443
|
+
'$compareTo': compareTo
|
|
2444
|
+
};
|
|
2445
|
+
|
|
2446
|
+
return this.beginRequest<Git.GitPullRequestIterationChanges>({
|
|
2447
|
+
apiVersion: "7.2-preview.1",
|
|
2448
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/changes",
|
|
2449
|
+
routeValues: {
|
|
2450
|
+
project: project,
|
|
2451
|
+
repositoryId: repositoryId,
|
|
2452
|
+
pullRequestId: pullRequestId,
|
|
2453
|
+
iterationId: iterationId
|
|
2454
|
+
},
|
|
2455
|
+
queryParams: queryValues
|
|
2456
|
+
});
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2459
|
+
/**
|
|
2460
|
+
* Get the specified iteration for a pull request.
|
|
2461
|
+
*
|
|
2462
|
+
* @param repositoryId - ID or name of the repository.
|
|
2463
|
+
* @param pullRequestId - ID of the pull request.
|
|
2464
|
+
* @param iterationId - ID of the pull request iteration to return.
|
|
2465
|
+
* @param project - Project ID or project name
|
|
2466
|
+
*/
|
|
2467
|
+
public async getPullRequestIteration(
|
|
2468
|
+
repositoryId: string,
|
|
2469
|
+
pullRequestId: number,
|
|
2470
|
+
iterationId: number,
|
|
2471
|
+
project?: string
|
|
2472
|
+
): Promise<Git.GitPullRequestIteration> {
|
|
2473
|
+
|
|
2474
|
+
return this.beginRequest<Git.GitPullRequestIteration>({
|
|
2475
|
+
apiVersion: "7.2-preview.2",
|
|
2476
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}",
|
|
2477
|
+
routeValues: {
|
|
2478
|
+
project: project,
|
|
2479
|
+
repositoryId: repositoryId,
|
|
2480
|
+
pullRequestId: pullRequestId,
|
|
2481
|
+
iterationId: iterationId
|
|
2482
|
+
}
|
|
2483
|
+
});
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
/**
|
|
2487
|
+
* Get the list of iterations for the specified pull request.
|
|
2488
|
+
*
|
|
2489
|
+
* @param repositoryId - ID or name of the repository.
|
|
2490
|
+
* @param pullRequestId - ID of the pull request.
|
|
2491
|
+
* @param project - Project ID or project name
|
|
2492
|
+
* @param includeCommits - If true, include the commits associated with each iteration in the response.
|
|
2493
|
+
*/
|
|
2494
|
+
public async getPullRequestIterations(
|
|
2495
|
+
repositoryId: string,
|
|
2496
|
+
pullRequestId: number,
|
|
2497
|
+
project?: string,
|
|
2498
|
+
includeCommits?: boolean
|
|
2499
|
+
): Promise<Git.GitPullRequestIteration[]> {
|
|
2500
|
+
|
|
2501
|
+
const queryValues: any = {
|
|
2502
|
+
includeCommits: includeCommits
|
|
2503
|
+
};
|
|
2504
|
+
|
|
2505
|
+
return this.beginRequest<Git.GitPullRequestIteration[]>({
|
|
2506
|
+
apiVersion: "7.2-preview.2",
|
|
2507
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}",
|
|
2508
|
+
routeValues: {
|
|
2509
|
+
project: project,
|
|
2510
|
+
repositoryId: repositoryId,
|
|
2511
|
+
pullRequestId: pullRequestId
|
|
2512
|
+
},
|
|
2513
|
+
queryParams: queryValues
|
|
2514
|
+
});
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
/**
|
|
2518
|
+
* Create a pull request status on the iteration. This operation will have the same result as Create status on pull request with specified iteration ID in the request body.
|
|
2519
|
+
*
|
|
2520
|
+
* @param status - Pull request status to create.
|
|
2521
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2522
|
+
* @param pullRequestId - ID of the pull request.
|
|
2523
|
+
* @param iterationId - ID of the pull request iteration.
|
|
2524
|
+
* @param project - Project ID or project name
|
|
2525
|
+
*/
|
|
2526
|
+
public async createPullRequestIterationStatus(
|
|
2527
|
+
status: Git.GitPullRequestStatus,
|
|
2528
|
+
repositoryId: string,
|
|
2529
|
+
pullRequestId: number,
|
|
2530
|
+
iterationId: number,
|
|
2531
|
+
project?: string
|
|
2532
|
+
): Promise<Git.GitPullRequestStatus> {
|
|
2533
|
+
|
|
2534
|
+
return this.beginRequest<Git.GitPullRequestStatus>({
|
|
2535
|
+
apiVersion: "7.2-preview.2",
|
|
2536
|
+
method: "POST",
|
|
2537
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses/{statusId}",
|
|
2538
|
+
routeValues: {
|
|
2539
|
+
project: project,
|
|
2540
|
+
repositoryId: repositoryId,
|
|
2541
|
+
pullRequestId: pullRequestId,
|
|
2542
|
+
iterationId: iterationId
|
|
2543
|
+
},
|
|
2544
|
+
body: status
|
|
2545
|
+
});
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2548
|
+
/**
|
|
2549
|
+
* Delete pull request iteration status.
|
|
2550
|
+
*
|
|
2551
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2552
|
+
* @param pullRequestId - ID of the pull request.
|
|
2553
|
+
* @param iterationId - ID of the pull request iteration.
|
|
2554
|
+
* @param statusId - ID of the pull request status.
|
|
2555
|
+
* @param project - Project ID or project name
|
|
2556
|
+
*/
|
|
2557
|
+
public async deletePullRequestIterationStatus(
|
|
2558
|
+
repositoryId: string,
|
|
2559
|
+
pullRequestId: number,
|
|
2560
|
+
iterationId: number,
|
|
2561
|
+
statusId: number,
|
|
2562
|
+
project?: string
|
|
2563
|
+
): Promise<void> {
|
|
2564
|
+
|
|
2565
|
+
return this.beginRequest<void>({
|
|
2566
|
+
apiVersion: "7.2-preview.2",
|
|
2567
|
+
method: "DELETE",
|
|
2568
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses/{statusId}",
|
|
2569
|
+
routeValues: {
|
|
2570
|
+
project: project,
|
|
2571
|
+
repositoryId: repositoryId,
|
|
2572
|
+
pullRequestId: pullRequestId,
|
|
2573
|
+
iterationId: iterationId,
|
|
2574
|
+
statusId: statusId
|
|
2575
|
+
}
|
|
2576
|
+
});
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
/**
|
|
2580
|
+
* Get the specific pull request iteration status by ID. The status ID is unique within the pull request across all iterations.
|
|
2581
|
+
*
|
|
2582
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2583
|
+
* @param pullRequestId - ID of the pull request.
|
|
2584
|
+
* @param iterationId - ID of the pull request iteration.
|
|
2585
|
+
* @param statusId - ID of the pull request status.
|
|
2586
|
+
* @param project - Project ID or project name
|
|
2587
|
+
*/
|
|
2588
|
+
public async getPullRequestIterationStatus(
|
|
2589
|
+
repositoryId: string,
|
|
2590
|
+
pullRequestId: number,
|
|
2591
|
+
iterationId: number,
|
|
2592
|
+
statusId: number,
|
|
2593
|
+
project?: string
|
|
2594
|
+
): Promise<Git.GitPullRequestStatus> {
|
|
2595
|
+
|
|
2596
|
+
return this.beginRequest<Git.GitPullRequestStatus>({
|
|
2597
|
+
apiVersion: "7.2-preview.2",
|
|
2598
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses/{statusId}",
|
|
2599
|
+
routeValues: {
|
|
2600
|
+
project: project,
|
|
2601
|
+
repositoryId: repositoryId,
|
|
2602
|
+
pullRequestId: pullRequestId,
|
|
2603
|
+
iterationId: iterationId,
|
|
2604
|
+
statusId: statusId
|
|
2605
|
+
}
|
|
2606
|
+
});
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
/**
|
|
2610
|
+
* Get all the statuses associated with a pull request iteration.
|
|
2611
|
+
*
|
|
2612
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2613
|
+
* @param pullRequestId - ID of the pull request.
|
|
2614
|
+
* @param iterationId - ID of the pull request iteration.
|
|
2615
|
+
* @param project - Project ID or project name
|
|
2616
|
+
*/
|
|
2617
|
+
public async getPullRequestIterationStatuses(
|
|
2618
|
+
repositoryId: string,
|
|
2619
|
+
pullRequestId: number,
|
|
2620
|
+
iterationId: number,
|
|
2621
|
+
project?: string
|
|
2622
|
+
): Promise<Git.GitPullRequestStatus[]> {
|
|
2623
|
+
|
|
2624
|
+
return this.beginRequest<Git.GitPullRequestStatus[]>({
|
|
2625
|
+
apiVersion: "7.2-preview.2",
|
|
2626
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses/{statusId}",
|
|
2627
|
+
routeValues: {
|
|
2628
|
+
project: project,
|
|
2629
|
+
repositoryId: repositoryId,
|
|
2630
|
+
pullRequestId: pullRequestId,
|
|
2631
|
+
iterationId: iterationId
|
|
2632
|
+
}
|
|
2633
|
+
});
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
/**
|
|
2637
|
+
* Update pull request iteration statuses collection. The only supported operation type is \`remove\`.
|
|
2638
|
+
*
|
|
2639
|
+
* @param patchDocument - Operations to apply to the pull request statuses in JSON Patch format.
|
|
2640
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2641
|
+
* @param pullRequestId - ID of the pull request.
|
|
2642
|
+
* @param iterationId - ID of the pull request iteration.
|
|
2643
|
+
* @param project - Project ID or project name
|
|
2644
|
+
*/
|
|
2645
|
+
public async updatePullRequestIterationStatuses(
|
|
2646
|
+
patchDocument: WebApi.JsonPatchDocument,
|
|
2647
|
+
repositoryId: string,
|
|
2648
|
+
pullRequestId: number,
|
|
2649
|
+
iterationId: number,
|
|
2650
|
+
project?: string
|
|
2651
|
+
): Promise<void> {
|
|
2652
|
+
|
|
2653
|
+
return this.beginRequest<void>({
|
|
2654
|
+
apiVersion: "7.2-preview.2",
|
|
2655
|
+
method: "PATCH",
|
|
2656
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses/{statusId}",
|
|
2657
|
+
routeValues: {
|
|
2658
|
+
project: project,
|
|
2659
|
+
repositoryId: repositoryId,
|
|
2660
|
+
pullRequestId: pullRequestId,
|
|
2661
|
+
iterationId: iterationId
|
|
2662
|
+
},
|
|
2663
|
+
customHeaders: {
|
|
2664
|
+
"Content-Type": "application/json-patch+json",
|
|
2665
|
+
},
|
|
2666
|
+
body: patchDocument
|
|
2667
|
+
});
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
/**
|
|
2671
|
+
* Create a tag (if that does not exists yet) and add that as a label (tag) for a specified pull request. The only required field is the name of the new label (tag).
|
|
2672
|
+
*
|
|
2673
|
+
* @param label - Label to assign to the pull request.
|
|
2674
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2675
|
+
* @param pullRequestId - ID of the pull request.
|
|
2676
|
+
* @param project - Project ID or project name
|
|
2677
|
+
* @param projectId - Project ID or project name.
|
|
2678
|
+
*/
|
|
2679
|
+
public async createPullRequestLabel(
|
|
2680
|
+
label: TfsCore.WebApiCreateTagRequestData,
|
|
2681
|
+
repositoryId: string,
|
|
2682
|
+
pullRequestId: number,
|
|
2683
|
+
project?: string,
|
|
2684
|
+
projectId?: string
|
|
2685
|
+
): Promise<TfsCore.WebApiTagDefinition> {
|
|
2686
|
+
|
|
2687
|
+
const queryValues: any = {
|
|
2688
|
+
projectId: projectId
|
|
2689
|
+
};
|
|
2690
|
+
|
|
2691
|
+
return this.beginRequest<TfsCore.WebApiTagDefinition>({
|
|
2692
|
+
apiVersion: "7.2-preview.1",
|
|
2693
|
+
method: "POST",
|
|
2694
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/labels/{labelIdOrName}",
|
|
2695
|
+
routeValues: {
|
|
2696
|
+
project: project,
|
|
2697
|
+
repositoryId: repositoryId,
|
|
2698
|
+
pullRequestId: pullRequestId
|
|
2699
|
+
},
|
|
2700
|
+
queryParams: queryValues,
|
|
2701
|
+
body: label
|
|
2702
|
+
});
|
|
2703
|
+
}
|
|
2704
|
+
|
|
2705
|
+
/**
|
|
2706
|
+
* Removes a label (tag) from the set of those assigned to the pull request. The tag itself will not be deleted.
|
|
2707
|
+
*
|
|
2708
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2709
|
+
* @param pullRequestId - ID of the pull request.
|
|
2710
|
+
* @param labelIdOrName - The name or ID of the label requested.
|
|
2711
|
+
* @param project - Project ID or project name
|
|
2712
|
+
* @param projectId - Project ID or project name.
|
|
2713
|
+
*/
|
|
2714
|
+
public async deletePullRequestLabels(
|
|
2715
|
+
repositoryId: string,
|
|
2716
|
+
pullRequestId: number,
|
|
2717
|
+
labelIdOrName: string,
|
|
2718
|
+
project?: string,
|
|
2719
|
+
projectId?: string
|
|
2720
|
+
): Promise<void> {
|
|
2721
|
+
|
|
2722
|
+
const queryValues: any = {
|
|
2723
|
+
projectId: projectId
|
|
2724
|
+
};
|
|
2725
|
+
|
|
2726
|
+
return this.beginRequest<void>({
|
|
2727
|
+
apiVersion: "7.2-preview.1",
|
|
2728
|
+
method: "DELETE",
|
|
2729
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/labels/{labelIdOrName}",
|
|
2730
|
+
routeValues: {
|
|
2731
|
+
project: project,
|
|
2732
|
+
repositoryId: repositoryId,
|
|
2733
|
+
pullRequestId: pullRequestId,
|
|
2734
|
+
labelIdOrName: labelIdOrName
|
|
2735
|
+
},
|
|
2736
|
+
queryParams: queryValues
|
|
2737
|
+
});
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
/**
|
|
2741
|
+
* Retrieves a single label (tag) that has been assigned to a pull request.
|
|
2742
|
+
*
|
|
2743
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2744
|
+
* @param pullRequestId - ID of the pull request.
|
|
2745
|
+
* @param labelIdOrName - The name or ID of the label requested.
|
|
2746
|
+
* @param project - Project ID or project name
|
|
2747
|
+
* @param projectId - Project ID or project name.
|
|
2748
|
+
*/
|
|
2749
|
+
public async getPullRequestLabel(
|
|
2750
|
+
repositoryId: string,
|
|
2751
|
+
pullRequestId: number,
|
|
2752
|
+
labelIdOrName: string,
|
|
2753
|
+
project?: string,
|
|
2754
|
+
projectId?: string
|
|
2755
|
+
): Promise<TfsCore.WebApiTagDefinition> {
|
|
2756
|
+
|
|
2757
|
+
const queryValues: any = {
|
|
2758
|
+
projectId: projectId
|
|
2759
|
+
};
|
|
2760
|
+
|
|
2761
|
+
return this.beginRequest<TfsCore.WebApiTagDefinition>({
|
|
2762
|
+
apiVersion: "7.2-preview.1",
|
|
2763
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/labels/{labelIdOrName}",
|
|
2764
|
+
routeValues: {
|
|
2765
|
+
project: project,
|
|
2766
|
+
repositoryId: repositoryId,
|
|
2767
|
+
pullRequestId: pullRequestId,
|
|
2768
|
+
labelIdOrName: labelIdOrName
|
|
2769
|
+
},
|
|
2770
|
+
queryParams: queryValues
|
|
2771
|
+
});
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2774
|
+
/**
|
|
2775
|
+
* Get all the labels (tags) assigned to a pull request.
|
|
2776
|
+
*
|
|
2777
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2778
|
+
* @param pullRequestId - ID of the pull request.
|
|
2779
|
+
* @param project - Project ID or project name
|
|
2780
|
+
* @param projectId - Project ID or project name.
|
|
2781
|
+
*/
|
|
2782
|
+
public async getPullRequestLabels(
|
|
2783
|
+
repositoryId: string,
|
|
2784
|
+
pullRequestId: number,
|
|
2785
|
+
project?: string,
|
|
2786
|
+
projectId?: string
|
|
2787
|
+
): Promise<TfsCore.WebApiTagDefinition[]> {
|
|
2788
|
+
|
|
2789
|
+
const queryValues: any = {
|
|
2790
|
+
projectId: projectId
|
|
2791
|
+
};
|
|
2792
|
+
|
|
2793
|
+
return this.beginRequest<TfsCore.WebApiTagDefinition[]>({
|
|
2794
|
+
apiVersion: "7.2-preview.1",
|
|
2795
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/labels/{labelIdOrName}",
|
|
2796
|
+
routeValues: {
|
|
2797
|
+
project: project,
|
|
2798
|
+
repositoryId: repositoryId,
|
|
2799
|
+
pullRequestId: pullRequestId
|
|
2800
|
+
},
|
|
2801
|
+
queryParams: queryValues
|
|
2802
|
+
});
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
/**
|
|
2806
|
+
* Get external properties of the pull request.
|
|
2807
|
+
*
|
|
2808
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2809
|
+
* @param pullRequestId - ID of the pull request.
|
|
2810
|
+
* @param project - Project ID or project name
|
|
2811
|
+
*/
|
|
2812
|
+
public async getPullRequestProperties(
|
|
2813
|
+
repositoryId: string,
|
|
2814
|
+
pullRequestId: number,
|
|
2815
|
+
project?: string
|
|
2816
|
+
): Promise<any> {
|
|
2817
|
+
|
|
2818
|
+
return this.beginRequest<any>({
|
|
2819
|
+
apiVersion: "7.2-preview.1",
|
|
2820
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/properties",
|
|
2821
|
+
routeValues: {
|
|
2822
|
+
project: project,
|
|
2823
|
+
repositoryId: repositoryId,
|
|
2824
|
+
pullRequestId: pullRequestId
|
|
2825
|
+
}
|
|
2826
|
+
});
|
|
2827
|
+
}
|
|
2828
|
+
|
|
2829
|
+
/**
|
|
2830
|
+
* Create or update pull request external properties. The patch operation can be \`add\`, \`replace\` or \`remove\`. For \`add\` operation, the path can be empty. If the path is empty, the value must be a list of key value pairs. For \`replace\` operation, the path cannot be empty. If the path does not exist, the property will be added to the collection. For \`remove\` operation, the path cannot be empty. If the path does not exist, no action will be performed.
|
|
2831
|
+
*
|
|
2832
|
+
* @param patchDocument - Properties to add, replace or remove in JSON Patch format.
|
|
2833
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
2834
|
+
* @param pullRequestId - ID of the pull request.
|
|
2835
|
+
* @param project - Project ID or project name
|
|
2836
|
+
*/
|
|
2837
|
+
public async updatePullRequestProperties(
|
|
2838
|
+
patchDocument: WebApi.JsonPatchDocument,
|
|
2839
|
+
repositoryId: string,
|
|
2840
|
+
pullRequestId: number,
|
|
2841
|
+
project?: string
|
|
2842
|
+
): Promise<any> {
|
|
2843
|
+
|
|
2844
|
+
return this.beginRequest<any>({
|
|
2845
|
+
apiVersion: "7.2-preview.1",
|
|
2846
|
+
method: "PATCH",
|
|
2847
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/properties",
|
|
2848
|
+
routeValues: {
|
|
2849
|
+
project: project,
|
|
2850
|
+
repositoryId: repositoryId,
|
|
2851
|
+
pullRequestId: pullRequestId
|
|
2852
|
+
},
|
|
2853
|
+
customHeaders: {
|
|
2854
|
+
"Content-Type": "application/json-patch+json",
|
|
2855
|
+
},
|
|
2856
|
+
body: patchDocument
|
|
2857
|
+
});
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2860
|
+
/**
|
|
2861
|
+
* This API is used to find what pull requests are related to a given commit. It can be used to either find the pull request that created a particular merge commit or it can be used to find all pull requests that have ever merged a particular commit. The input is a list of queries which each contain a list of commits. For each commit that you search against, you will get back a dictionary of commit -\> pull requests.
|
|
2862
|
+
*
|
|
2863
|
+
* @param queries - The list of queries to perform.
|
|
2864
|
+
* @param repositoryId - ID of the repository.
|
|
2865
|
+
* @param project - Project ID or project name
|
|
2866
|
+
*/
|
|
2867
|
+
public async getPullRequestQuery(
|
|
2868
|
+
queries: Git.GitPullRequestQuery,
|
|
2869
|
+
repositoryId: string,
|
|
2870
|
+
project?: string
|
|
2871
|
+
): Promise<Git.GitPullRequestQuery> {
|
|
2872
|
+
|
|
2873
|
+
return this.beginRequest<Git.GitPullRequestQuery>({
|
|
2874
|
+
apiVersion: "7.2-preview.1",
|
|
2875
|
+
method: "POST",
|
|
2876
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/PullRequestQuery",
|
|
2877
|
+
routeValues: {
|
|
2878
|
+
project: project,
|
|
2879
|
+
repositoryId: repositoryId
|
|
2880
|
+
},
|
|
2881
|
+
body: queries
|
|
2882
|
+
});
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
/**
|
|
2886
|
+
* Add a reviewer to a pull request or cast a vote.
|
|
2887
|
+
*
|
|
2888
|
+
* @param reviewer - Reviewer's vote.\<br /\>If the reviewer's ID is included here, it must match the reviewerID parameter.\<br /\>Reviewers can set their own vote with this method. When adding other reviewers, vote must be set to zero.
|
|
2889
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
2890
|
+
* @param pullRequestId - ID of the pull request.
|
|
2891
|
+
* @param reviewerId - ID of the reviewer.
|
|
2892
|
+
* @param project - Project ID or project name
|
|
2893
|
+
*/
|
|
2894
|
+
public async createPullRequestReviewer(
|
|
2895
|
+
reviewer: Git.IdentityRefWithVote,
|
|
2896
|
+
repositoryId: string,
|
|
2897
|
+
pullRequestId: number,
|
|
2898
|
+
reviewerId: string,
|
|
2899
|
+
project?: string
|
|
2900
|
+
): Promise<Git.IdentityRefWithVote> {
|
|
2901
|
+
|
|
2902
|
+
return this.beginRequest<Git.IdentityRefWithVote>({
|
|
2903
|
+
apiVersion: "7.2-preview.1",
|
|
2904
|
+
method: "PUT",
|
|
2905
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
|
|
2906
|
+
routeValues: {
|
|
2907
|
+
project: project,
|
|
2908
|
+
repositoryId: repositoryId,
|
|
2909
|
+
pullRequestId: pullRequestId,
|
|
2910
|
+
reviewerId: reviewerId
|
|
2911
|
+
},
|
|
2912
|
+
body: reviewer
|
|
2913
|
+
});
|
|
2914
|
+
}
|
|
2915
|
+
|
|
2916
|
+
/**
|
|
2917
|
+
* Add reviewers to a pull request.
|
|
2918
|
+
*
|
|
2919
|
+
* @param reviewers - Reviewers to add to the pull request.
|
|
2920
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
2921
|
+
* @param pullRequestId - ID of the pull request.
|
|
2922
|
+
* @param project - Project ID or project name
|
|
2923
|
+
*/
|
|
2924
|
+
public async createPullRequestReviewers(
|
|
2925
|
+
reviewers: WebApi.IdentityRef[],
|
|
2926
|
+
repositoryId: string,
|
|
2927
|
+
pullRequestId: number,
|
|
2928
|
+
project?: string
|
|
2929
|
+
): Promise<Git.IdentityRefWithVote[]> {
|
|
2930
|
+
|
|
2931
|
+
return this.beginRequest<Git.IdentityRefWithVote[]>({
|
|
2932
|
+
apiVersion: "7.2-preview.1",
|
|
2933
|
+
method: "POST",
|
|
2934
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
|
|
2935
|
+
routeValues: {
|
|
2936
|
+
project: project,
|
|
2937
|
+
repositoryId: repositoryId,
|
|
2938
|
+
pullRequestId: pullRequestId
|
|
2939
|
+
},
|
|
2940
|
+
body: reviewers
|
|
2941
|
+
});
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
/**
|
|
2945
|
+
* Add an unmaterialized identity to the reviewers of a pull request.
|
|
2946
|
+
*
|
|
2947
|
+
* @param reviewer - Reviewer to add to the pull request.
|
|
2948
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
2949
|
+
* @param pullRequestId - ID of the pull request.
|
|
2950
|
+
* @param project - Project ID or project name
|
|
2951
|
+
*/
|
|
2952
|
+
public async createUnmaterializedPullRequestReviewer(
|
|
2953
|
+
reviewer: Git.IdentityRefWithVote,
|
|
2954
|
+
repositoryId: string,
|
|
2955
|
+
pullRequestId: number,
|
|
2956
|
+
project?: string
|
|
2957
|
+
): Promise<Git.IdentityRefWithVote> {
|
|
2958
|
+
|
|
2959
|
+
return this.beginRequest<Git.IdentityRefWithVote>({
|
|
2960
|
+
apiVersion: "7.2-preview.1",
|
|
2961
|
+
method: "PUT",
|
|
2962
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
|
|
2963
|
+
routeValues: {
|
|
2964
|
+
project: project,
|
|
2965
|
+
repositoryId: repositoryId,
|
|
2966
|
+
pullRequestId: pullRequestId
|
|
2967
|
+
},
|
|
2968
|
+
body: reviewer
|
|
2969
|
+
});
|
|
2970
|
+
}
|
|
2971
|
+
|
|
2972
|
+
/**
|
|
2973
|
+
* Remove a reviewer from a pull request.
|
|
2974
|
+
*
|
|
2975
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
2976
|
+
* @param pullRequestId - ID of the pull request.
|
|
2977
|
+
* @param reviewerId - ID of the reviewer to remove.
|
|
2978
|
+
* @param project - Project ID or project name
|
|
2979
|
+
*/
|
|
2980
|
+
public async deletePullRequestReviewer(
|
|
2981
|
+
repositoryId: string,
|
|
2982
|
+
pullRequestId: number,
|
|
2983
|
+
reviewerId: string,
|
|
2984
|
+
project?: string
|
|
2985
|
+
): Promise<void> {
|
|
2986
|
+
|
|
2987
|
+
return this.beginRequest<void>({
|
|
2988
|
+
apiVersion: "7.2-preview.1",
|
|
2989
|
+
method: "DELETE",
|
|
2990
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
|
|
2991
|
+
routeValues: {
|
|
2992
|
+
project: project,
|
|
2993
|
+
repositoryId: repositoryId,
|
|
2994
|
+
pullRequestId: pullRequestId,
|
|
2995
|
+
reviewerId: reviewerId
|
|
2996
|
+
}
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2999
|
+
|
|
3000
|
+
/**
|
|
3001
|
+
* Retrieve information about a particular reviewer on a pull request
|
|
3002
|
+
*
|
|
3003
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3004
|
+
* @param pullRequestId - ID of the pull request.
|
|
3005
|
+
* @param reviewerId - ID of the reviewer.
|
|
3006
|
+
* @param project - Project ID or project name
|
|
3007
|
+
*/
|
|
3008
|
+
public async getPullRequestReviewer(
|
|
3009
|
+
repositoryId: string,
|
|
3010
|
+
pullRequestId: number,
|
|
3011
|
+
reviewerId: string,
|
|
3012
|
+
project?: string
|
|
3013
|
+
): Promise<Git.IdentityRefWithVote> {
|
|
3014
|
+
|
|
3015
|
+
return this.beginRequest<Git.IdentityRefWithVote>({
|
|
3016
|
+
apiVersion: "7.2-preview.1",
|
|
3017
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
|
|
3018
|
+
routeValues: {
|
|
3019
|
+
project: project,
|
|
3020
|
+
repositoryId: repositoryId,
|
|
3021
|
+
pullRequestId: pullRequestId,
|
|
3022
|
+
reviewerId: reviewerId
|
|
3023
|
+
}
|
|
3024
|
+
});
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
/**
|
|
3028
|
+
* Retrieve the reviewers for a pull request
|
|
3029
|
+
*
|
|
3030
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3031
|
+
* @param pullRequestId - ID of the pull request.
|
|
3032
|
+
* @param project - Project ID or project name
|
|
3033
|
+
*/
|
|
3034
|
+
public async getPullRequestReviewers(
|
|
3035
|
+
repositoryId: string,
|
|
3036
|
+
pullRequestId: number,
|
|
3037
|
+
project?: string
|
|
3038
|
+
): Promise<Git.IdentityRefWithVote[]> {
|
|
3039
|
+
|
|
3040
|
+
return this.beginRequest<Git.IdentityRefWithVote[]>({
|
|
3041
|
+
apiVersion: "7.2-preview.1",
|
|
3042
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
|
|
3043
|
+
routeValues: {
|
|
3044
|
+
project: project,
|
|
3045
|
+
repositoryId: repositoryId,
|
|
3046
|
+
pullRequestId: pullRequestId
|
|
3047
|
+
}
|
|
3048
|
+
});
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
/**
|
|
3052
|
+
* Edit a reviewer entry. These fields are patchable: isFlagged, hasDeclined
|
|
3053
|
+
*
|
|
3054
|
+
* @param reviewer - Reviewer data.\<br /\>If the reviewer's ID is included here, it must match the reviewerID parameter.
|
|
3055
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3056
|
+
* @param pullRequestId - ID of the pull request.
|
|
3057
|
+
* @param reviewerId - ID of the reviewer.
|
|
3058
|
+
* @param project - Project ID or project name
|
|
3059
|
+
*/
|
|
3060
|
+
public async updatePullRequestReviewer(
|
|
3061
|
+
reviewer: Git.IdentityRefWithVote,
|
|
3062
|
+
repositoryId: string,
|
|
3063
|
+
pullRequestId: number,
|
|
3064
|
+
reviewerId: string,
|
|
3065
|
+
project?: string
|
|
3066
|
+
): Promise<Git.IdentityRefWithVote> {
|
|
3067
|
+
|
|
3068
|
+
return this.beginRequest<Git.IdentityRefWithVote>({
|
|
3069
|
+
apiVersion: "7.2-preview.1",
|
|
3070
|
+
method: "PATCH",
|
|
3071
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
|
|
3072
|
+
routeValues: {
|
|
3073
|
+
project: project,
|
|
3074
|
+
repositoryId: repositoryId,
|
|
3075
|
+
pullRequestId: pullRequestId,
|
|
3076
|
+
reviewerId: reviewerId
|
|
3077
|
+
},
|
|
3078
|
+
body: reviewer
|
|
3079
|
+
});
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
/**
|
|
3083
|
+
* Reset the votes of multiple reviewers on a pull request. NOTE: This endpoint only supports updating votes, but does not support updating required reviewers (use policy) or display names.
|
|
3084
|
+
*
|
|
3085
|
+
* @param patchVotes - IDs of the reviewers whose votes will be reset to zero
|
|
3086
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3087
|
+
* @param pullRequestId - ID of the pull request
|
|
3088
|
+
* @param project - Project ID or project name
|
|
3089
|
+
*/
|
|
3090
|
+
public async updatePullRequestReviewers(
|
|
3091
|
+
patchVotes: Git.IdentityRefWithVote[],
|
|
3092
|
+
repositoryId: string,
|
|
3093
|
+
pullRequestId: number,
|
|
3094
|
+
project?: string
|
|
3095
|
+
): Promise<void> {
|
|
3096
|
+
|
|
3097
|
+
return this.beginRequest<void>({
|
|
3098
|
+
apiVersion: "7.2-preview.1",
|
|
3099
|
+
method: "PATCH",
|
|
3100
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
|
|
3101
|
+
routeValues: {
|
|
3102
|
+
project: project,
|
|
3103
|
+
repositoryId: repositoryId,
|
|
3104
|
+
pullRequestId: pullRequestId
|
|
3105
|
+
},
|
|
3106
|
+
body: patchVotes
|
|
3107
|
+
});
|
|
3108
|
+
}
|
|
3109
|
+
|
|
3110
|
+
/**
|
|
3111
|
+
* Retrieve a pull request.
|
|
3112
|
+
*
|
|
3113
|
+
* @param pullRequestId - The ID of the pull request to retrieve.
|
|
3114
|
+
* @param project - Project ID or project name
|
|
3115
|
+
*/
|
|
3116
|
+
public async getPullRequestById(
|
|
3117
|
+
pullRequestId: number,
|
|
3118
|
+
project?: string
|
|
3119
|
+
): Promise<Git.GitPullRequest> {
|
|
3120
|
+
|
|
3121
|
+
return this.beginRequest<Git.GitPullRequest>({
|
|
3122
|
+
apiVersion: "7.2-preview.2",
|
|
3123
|
+
routeTemplate: "{project}/_apis/git/pullRequests/{pullRequestId}",
|
|
3124
|
+
routeValues: {
|
|
3125
|
+
project: project,
|
|
3126
|
+
pullRequestId: pullRequestId
|
|
3127
|
+
}
|
|
3128
|
+
});
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
/**
|
|
3132
|
+
* Retrieve all pull requests matching a specified criteria.
|
|
3133
|
+
*
|
|
3134
|
+
* @param project - Project ID or project name
|
|
3135
|
+
* @param searchCriteria - Pull requests will be returned that match this search criteria.
|
|
3136
|
+
* @param maxCommentLength - Not used.
|
|
3137
|
+
* @param skip - The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100.
|
|
3138
|
+
* @param top - The number of pull requests to retrieve.
|
|
3139
|
+
*/
|
|
3140
|
+
public async getPullRequestsByProject(
|
|
3141
|
+
project: string,
|
|
3142
|
+
searchCriteria: Git.GitPullRequestSearchCriteria,
|
|
3143
|
+
maxCommentLength?: number,
|
|
3144
|
+
skip?: number,
|
|
3145
|
+
top?: number
|
|
3146
|
+
): Promise<Git.GitPullRequest[]> {
|
|
3147
|
+
|
|
3148
|
+
const queryValues: any = {
|
|
3149
|
+
searchCriteria: searchCriteria,
|
|
3150
|
+
maxCommentLength: maxCommentLength,
|
|
3151
|
+
'$skip': skip,
|
|
3152
|
+
'$top': top
|
|
3153
|
+
};
|
|
3154
|
+
|
|
3155
|
+
return this.beginRequest<Git.GitPullRequest[]>({
|
|
3156
|
+
apiVersion: "7.2-preview.2",
|
|
3157
|
+
routeTemplate: "{project}/_apis/git/pullRequests",
|
|
3158
|
+
routeValues: {
|
|
3159
|
+
project: project
|
|
3160
|
+
},
|
|
3161
|
+
queryParams: queryValues
|
|
3162
|
+
});
|
|
3163
|
+
}
|
|
3164
|
+
|
|
3165
|
+
/**
|
|
3166
|
+
* Create a pull request.
|
|
3167
|
+
*
|
|
3168
|
+
* @param gitPullRequestToCreate - The pull request to create.
|
|
3169
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3170
|
+
* @param project - Project ID or project name
|
|
3171
|
+
* @param supportsIterations - If true, subsequent pushes to the pull request will be individually reviewable. Set this to false for large pull requests for performance reasons if this functionality is not needed.
|
|
3172
|
+
*/
|
|
3173
|
+
public async createPullRequest(
|
|
3174
|
+
gitPullRequestToCreate: Git.GitPullRequest,
|
|
3175
|
+
repositoryId: string,
|
|
3176
|
+
project?: string,
|
|
3177
|
+
supportsIterations?: boolean
|
|
3178
|
+
): Promise<Git.GitPullRequest> {
|
|
3179
|
+
|
|
3180
|
+
const queryValues: any = {
|
|
3181
|
+
supportsIterations: supportsIterations
|
|
3182
|
+
};
|
|
3183
|
+
|
|
3184
|
+
return this.beginRequest<Git.GitPullRequest>({
|
|
3185
|
+
apiVersion: "7.2-preview.2",
|
|
3186
|
+
method: "POST",
|
|
3187
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}",
|
|
3188
|
+
routeValues: {
|
|
3189
|
+
project: project,
|
|
3190
|
+
repositoryId: repositoryId
|
|
3191
|
+
},
|
|
3192
|
+
queryParams: queryValues,
|
|
3193
|
+
body: gitPullRequestToCreate
|
|
3194
|
+
});
|
|
3195
|
+
}
|
|
3196
|
+
|
|
3197
|
+
/**
|
|
3198
|
+
* Retrieve a pull request.
|
|
3199
|
+
*
|
|
3200
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3201
|
+
* @param pullRequestId - The ID of the pull request to retrieve.
|
|
3202
|
+
* @param project - Project ID or project name
|
|
3203
|
+
* @param maxCommentLength - Not used.
|
|
3204
|
+
* @param skip - Not used.
|
|
3205
|
+
* @param top - Not used.
|
|
3206
|
+
* @param includeCommits - If true, the pull request will be returned with the associated commits.
|
|
3207
|
+
* @param includeWorkItemRefs - If true, the pull request will be returned with the associated work item references.
|
|
3208
|
+
*/
|
|
3209
|
+
public async getPullRequest(
|
|
3210
|
+
repositoryId: string,
|
|
3211
|
+
pullRequestId: number,
|
|
3212
|
+
project?: string,
|
|
3213
|
+
maxCommentLength?: number,
|
|
3214
|
+
skip?: number,
|
|
3215
|
+
top?: number,
|
|
3216
|
+
includeCommits?: boolean,
|
|
3217
|
+
includeWorkItemRefs?: boolean
|
|
3218
|
+
): Promise<Git.GitPullRequest> {
|
|
3219
|
+
|
|
3220
|
+
const queryValues: any = {
|
|
3221
|
+
maxCommentLength: maxCommentLength,
|
|
3222
|
+
'$skip': skip,
|
|
3223
|
+
'$top': top,
|
|
3224
|
+
includeCommits: includeCommits,
|
|
3225
|
+
includeWorkItemRefs: includeWorkItemRefs
|
|
3226
|
+
};
|
|
3227
|
+
|
|
3228
|
+
return this.beginRequest<Git.GitPullRequest>({
|
|
3229
|
+
apiVersion: "7.2-preview.2",
|
|
3230
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}",
|
|
3231
|
+
routeValues: {
|
|
3232
|
+
project: project,
|
|
3233
|
+
repositoryId: repositoryId,
|
|
3234
|
+
pullRequestId: pullRequestId
|
|
3235
|
+
},
|
|
3236
|
+
queryParams: queryValues
|
|
3237
|
+
});
|
|
3238
|
+
}
|
|
3239
|
+
|
|
3240
|
+
/**
|
|
3241
|
+
* Retrieve all pull requests matching a specified criteria.
|
|
3242
|
+
*
|
|
3243
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3244
|
+
* @param searchCriteria - Pull requests will be returned that match this search criteria.
|
|
3245
|
+
* @param project - Project ID or project name
|
|
3246
|
+
* @param maxCommentLength - Not used.
|
|
3247
|
+
* @param skip - The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100.
|
|
3248
|
+
* @param top - The number of pull requests to retrieve.
|
|
3249
|
+
*/
|
|
3250
|
+
public async getPullRequests(
|
|
3251
|
+
repositoryId: string,
|
|
3252
|
+
searchCriteria: Git.GitPullRequestSearchCriteria,
|
|
3253
|
+
project?: string,
|
|
3254
|
+
maxCommentLength?: number,
|
|
3255
|
+
skip?: number,
|
|
3256
|
+
top?: number
|
|
3257
|
+
): Promise<Git.GitPullRequest[]> {
|
|
3258
|
+
|
|
3259
|
+
const queryValues: any = {
|
|
3260
|
+
searchCriteria: searchCriteria,
|
|
3261
|
+
maxCommentLength: maxCommentLength,
|
|
3262
|
+
'$skip': skip,
|
|
3263
|
+
'$top': top
|
|
3264
|
+
};
|
|
3265
|
+
|
|
3266
|
+
return this.beginRequest<Git.GitPullRequest[]>({
|
|
3267
|
+
apiVersion: "7.2-preview.2",
|
|
3268
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}",
|
|
3269
|
+
routeValues: {
|
|
3270
|
+
project: project,
|
|
3271
|
+
repositoryId: repositoryId
|
|
3272
|
+
},
|
|
3273
|
+
queryParams: queryValues
|
|
3274
|
+
});
|
|
3275
|
+
}
|
|
3276
|
+
|
|
3277
|
+
/**
|
|
3278
|
+
* Update a pull request
|
|
3279
|
+
*
|
|
3280
|
+
* @param gitPullRequestToUpdate - The pull request content that should be updated.
|
|
3281
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3282
|
+
* @param pullRequestId - ID of the pull request to update.
|
|
3283
|
+
* @param project - Project ID or project name
|
|
3284
|
+
*/
|
|
3285
|
+
public async updatePullRequest(
|
|
3286
|
+
gitPullRequestToUpdate: Git.GitPullRequest,
|
|
3287
|
+
repositoryId: string,
|
|
3288
|
+
pullRequestId: number,
|
|
3289
|
+
project?: string
|
|
3290
|
+
): Promise<Git.GitPullRequest> {
|
|
3291
|
+
|
|
3292
|
+
return this.beginRequest<Git.GitPullRequest>({
|
|
3293
|
+
apiVersion: "7.2-preview.2",
|
|
3294
|
+
method: "PATCH",
|
|
3295
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}",
|
|
3296
|
+
routeValues: {
|
|
3297
|
+
project: project,
|
|
3298
|
+
repositoryId: repositoryId,
|
|
3299
|
+
pullRequestId: pullRequestId
|
|
3300
|
+
},
|
|
3301
|
+
body: gitPullRequestToUpdate
|
|
3302
|
+
});
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3305
|
+
/**
|
|
3306
|
+
* Sends an e-mail notification about a specific pull request to a set of recipients
|
|
3307
|
+
*
|
|
3308
|
+
* @param userMessage -
|
|
3309
|
+
* @param repositoryId - ID of the git repository.
|
|
3310
|
+
* @param pullRequestId - ID of the pull request.
|
|
3311
|
+
* @param project - Project ID or project name
|
|
3312
|
+
*/
|
|
3313
|
+
public async sharePullRequest(
|
|
3314
|
+
userMessage: Git.ShareNotificationContext,
|
|
3315
|
+
repositoryId: string,
|
|
3316
|
+
pullRequestId: number,
|
|
3317
|
+
project?: string
|
|
3318
|
+
): Promise<void> {
|
|
3319
|
+
|
|
3320
|
+
return this.beginRequest<void>({
|
|
3321
|
+
apiVersion: "7.2-preview.1",
|
|
3322
|
+
method: "POST",
|
|
3323
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/share",
|
|
3324
|
+
routeValues: {
|
|
3325
|
+
project: project,
|
|
3326
|
+
repositoryId: repositoryId,
|
|
3327
|
+
pullRequestId: pullRequestId
|
|
3328
|
+
},
|
|
3329
|
+
body: userMessage
|
|
3330
|
+
});
|
|
3331
|
+
}
|
|
3332
|
+
|
|
3333
|
+
/**
|
|
3334
|
+
* Create a pull request status.
|
|
3335
|
+
*
|
|
3336
|
+
* @param status - Pull request status to create.
|
|
3337
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
3338
|
+
* @param pullRequestId - ID of the pull request.
|
|
3339
|
+
* @param project - Project ID or project name
|
|
3340
|
+
*/
|
|
3341
|
+
public async createPullRequestStatus(
|
|
3342
|
+
status: Git.GitPullRequestStatus,
|
|
3343
|
+
repositoryId: string,
|
|
3344
|
+
pullRequestId: number,
|
|
3345
|
+
project?: string
|
|
3346
|
+
): Promise<Git.GitPullRequestStatus> {
|
|
3347
|
+
|
|
3348
|
+
return this.beginRequest<Git.GitPullRequestStatus>({
|
|
3349
|
+
apiVersion: "7.2-preview.2",
|
|
3350
|
+
method: "POST",
|
|
3351
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}",
|
|
3352
|
+
routeValues: {
|
|
3353
|
+
project: project,
|
|
3354
|
+
repositoryId: repositoryId,
|
|
3355
|
+
pullRequestId: pullRequestId
|
|
3356
|
+
},
|
|
3357
|
+
body: status
|
|
3358
|
+
});
|
|
3359
|
+
}
|
|
3360
|
+
|
|
3361
|
+
/**
|
|
3362
|
+
* Delete pull request status.
|
|
3363
|
+
*
|
|
3364
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
3365
|
+
* @param pullRequestId - ID of the pull request.
|
|
3366
|
+
* @param statusId - ID of the pull request status.
|
|
3367
|
+
* @param project - Project ID or project name
|
|
3368
|
+
*/
|
|
3369
|
+
public async deletePullRequestStatus(
|
|
3370
|
+
repositoryId: string,
|
|
3371
|
+
pullRequestId: number,
|
|
3372
|
+
statusId: number,
|
|
3373
|
+
project?: string
|
|
3374
|
+
): Promise<void> {
|
|
3375
|
+
|
|
3376
|
+
return this.beginRequest<void>({
|
|
3377
|
+
apiVersion: "7.2-preview.2",
|
|
3378
|
+
method: "DELETE",
|
|
3379
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}",
|
|
3380
|
+
routeValues: {
|
|
3381
|
+
project: project,
|
|
3382
|
+
repositoryId: repositoryId,
|
|
3383
|
+
pullRequestId: pullRequestId,
|
|
3384
|
+
statusId: statusId
|
|
3385
|
+
}
|
|
3386
|
+
});
|
|
3387
|
+
}
|
|
3388
|
+
|
|
3389
|
+
/**
|
|
3390
|
+
* Get the specific pull request status by ID. The status ID is unique within the pull request across all iterations.
|
|
3391
|
+
*
|
|
3392
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
3393
|
+
* @param pullRequestId - ID of the pull request.
|
|
3394
|
+
* @param statusId - ID of the pull request status.
|
|
3395
|
+
* @param project - Project ID or project name
|
|
3396
|
+
*/
|
|
3397
|
+
public async getPullRequestStatus(
|
|
3398
|
+
repositoryId: string,
|
|
3399
|
+
pullRequestId: number,
|
|
3400
|
+
statusId: number,
|
|
3401
|
+
project?: string
|
|
3402
|
+
): Promise<Git.GitPullRequestStatus> {
|
|
3403
|
+
|
|
3404
|
+
return this.beginRequest<Git.GitPullRequestStatus>({
|
|
3405
|
+
apiVersion: "7.2-preview.2",
|
|
3406
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}",
|
|
3407
|
+
routeValues: {
|
|
3408
|
+
project: project,
|
|
3409
|
+
repositoryId: repositoryId,
|
|
3410
|
+
pullRequestId: pullRequestId,
|
|
3411
|
+
statusId: statusId
|
|
3412
|
+
}
|
|
3413
|
+
});
|
|
3414
|
+
}
|
|
3415
|
+
|
|
3416
|
+
/**
|
|
3417
|
+
* Get all the statuses associated with a pull request.
|
|
3418
|
+
*
|
|
3419
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
3420
|
+
* @param pullRequestId - ID of the pull request.
|
|
3421
|
+
* @param project - Project ID or project name
|
|
3422
|
+
*/
|
|
3423
|
+
public async getPullRequestStatuses(
|
|
3424
|
+
repositoryId: string,
|
|
3425
|
+
pullRequestId: number,
|
|
3426
|
+
project?: string
|
|
3427
|
+
): Promise<Git.GitPullRequestStatus[]> {
|
|
3428
|
+
|
|
3429
|
+
return this.beginRequest<Git.GitPullRequestStatus[]>({
|
|
3430
|
+
apiVersion: "7.2-preview.2",
|
|
3431
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}",
|
|
3432
|
+
routeValues: {
|
|
3433
|
+
project: project,
|
|
3434
|
+
repositoryId: repositoryId,
|
|
3435
|
+
pullRequestId: pullRequestId
|
|
3436
|
+
}
|
|
3437
|
+
});
|
|
3438
|
+
}
|
|
3439
|
+
|
|
3440
|
+
/**
|
|
3441
|
+
* Update pull request statuses collection. The only supported operation type is \`remove\`.
|
|
3442
|
+
*
|
|
3443
|
+
* @param patchDocument - Operations to apply to the pull request statuses in JSON Patch format.
|
|
3444
|
+
* @param repositoryId - The repository ID of the pull request’s target branch.
|
|
3445
|
+
* @param pullRequestId - ID of the pull request.
|
|
3446
|
+
* @param project - Project ID or project name
|
|
3447
|
+
*/
|
|
3448
|
+
public async updatePullRequestStatuses(
|
|
3449
|
+
patchDocument: WebApi.JsonPatchDocument,
|
|
3450
|
+
repositoryId: string,
|
|
3451
|
+
pullRequestId: number,
|
|
3452
|
+
project?: string
|
|
3453
|
+
): Promise<void> {
|
|
3454
|
+
|
|
3455
|
+
return this.beginRequest<void>({
|
|
3456
|
+
apiVersion: "7.2-preview.2",
|
|
3457
|
+
method: "PATCH",
|
|
3458
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}",
|
|
3459
|
+
routeValues: {
|
|
3460
|
+
project: project,
|
|
3461
|
+
repositoryId: repositoryId,
|
|
3462
|
+
pullRequestId: pullRequestId
|
|
3463
|
+
},
|
|
3464
|
+
customHeaders: {
|
|
3465
|
+
"Content-Type": "application/json-patch+json",
|
|
3466
|
+
},
|
|
3467
|
+
body: patchDocument
|
|
3468
|
+
});
|
|
3469
|
+
}
|
|
3470
|
+
|
|
3471
|
+
/**
|
|
3472
|
+
* Create a comment on a specific thread in a pull request (up to 500 comments can be created per thread).
|
|
3473
|
+
*
|
|
3474
|
+
* @param comment - The comment to create. Comments can be up to 150,000 characters.
|
|
3475
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3476
|
+
* @param pullRequestId - ID of the pull request.
|
|
3477
|
+
* @param threadId - ID of the thread that the desired comment is in.
|
|
3478
|
+
* @param project - Project ID or project name
|
|
3479
|
+
*/
|
|
3480
|
+
public async createComment(
|
|
3481
|
+
comment: Git.Comment,
|
|
3482
|
+
repositoryId: string,
|
|
3483
|
+
pullRequestId: number,
|
|
3484
|
+
threadId: number,
|
|
3485
|
+
project?: string
|
|
3486
|
+
): Promise<Git.Comment> {
|
|
3487
|
+
|
|
3488
|
+
return this.beginRequest<Git.Comment>({
|
|
3489
|
+
apiVersion: "7.2-preview.1",
|
|
3490
|
+
method: "POST",
|
|
3491
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}",
|
|
3492
|
+
routeValues: {
|
|
3493
|
+
project: project,
|
|
3494
|
+
repositoryId: repositoryId,
|
|
3495
|
+
pullRequestId: pullRequestId,
|
|
3496
|
+
threadId: threadId
|
|
3497
|
+
},
|
|
3498
|
+
body: comment
|
|
3499
|
+
});
|
|
3500
|
+
}
|
|
3501
|
+
|
|
3502
|
+
/**
|
|
3503
|
+
* Delete a comment associated with a specific thread in a pull request.
|
|
3504
|
+
*
|
|
3505
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3506
|
+
* @param pullRequestId - ID of the pull request.
|
|
3507
|
+
* @param threadId - ID of the thread that the desired comment is in.
|
|
3508
|
+
* @param commentId - ID of the comment.
|
|
3509
|
+
* @param project - Project ID or project name
|
|
3510
|
+
*/
|
|
3511
|
+
public async deleteComment(
|
|
3512
|
+
repositoryId: string,
|
|
3513
|
+
pullRequestId: number,
|
|
3514
|
+
threadId: number,
|
|
3515
|
+
commentId: number,
|
|
3516
|
+
project?: string
|
|
3517
|
+
): Promise<void> {
|
|
3518
|
+
|
|
3519
|
+
return this.beginRequest<void>({
|
|
3520
|
+
apiVersion: "7.2-preview.1",
|
|
3521
|
+
method: "DELETE",
|
|
3522
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}",
|
|
3523
|
+
routeValues: {
|
|
3524
|
+
project: project,
|
|
3525
|
+
repositoryId: repositoryId,
|
|
3526
|
+
pullRequestId: pullRequestId,
|
|
3527
|
+
threadId: threadId,
|
|
3528
|
+
commentId: commentId
|
|
3529
|
+
}
|
|
3530
|
+
});
|
|
3531
|
+
}
|
|
3532
|
+
|
|
3533
|
+
/**
|
|
3534
|
+
* Retrieve a comment associated with a specific thread in a pull request.
|
|
3535
|
+
*
|
|
3536
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3537
|
+
* @param pullRequestId - ID of the pull request.
|
|
3538
|
+
* @param threadId - ID of the thread that the desired comment is in.
|
|
3539
|
+
* @param commentId - ID of the comment.
|
|
3540
|
+
* @param project - Project ID or project name
|
|
3541
|
+
*/
|
|
3542
|
+
public async getComment(
|
|
3543
|
+
repositoryId: string,
|
|
3544
|
+
pullRequestId: number,
|
|
3545
|
+
threadId: number,
|
|
3546
|
+
commentId: number,
|
|
3547
|
+
project?: string
|
|
3548
|
+
): Promise<Git.Comment> {
|
|
3549
|
+
|
|
3550
|
+
return this.beginRequest<Git.Comment>({
|
|
3551
|
+
apiVersion: "7.2-preview.1",
|
|
3552
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}",
|
|
3553
|
+
routeValues: {
|
|
3554
|
+
project: project,
|
|
3555
|
+
repositoryId: repositoryId,
|
|
3556
|
+
pullRequestId: pullRequestId,
|
|
3557
|
+
threadId: threadId,
|
|
3558
|
+
commentId: commentId
|
|
3559
|
+
}
|
|
3560
|
+
});
|
|
3561
|
+
}
|
|
3562
|
+
|
|
3563
|
+
/**
|
|
3564
|
+
* Retrieve all comments associated with a specific thread in a pull request.
|
|
3565
|
+
*
|
|
3566
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3567
|
+
* @param pullRequestId - ID of the pull request.
|
|
3568
|
+
* @param threadId - ID of the thread.
|
|
3569
|
+
* @param project - Project ID or project name
|
|
3570
|
+
*/
|
|
3571
|
+
public async getComments(
|
|
3572
|
+
repositoryId: string,
|
|
3573
|
+
pullRequestId: number,
|
|
3574
|
+
threadId: number,
|
|
3575
|
+
project?: string
|
|
3576
|
+
): Promise<Git.Comment[]> {
|
|
3577
|
+
|
|
3578
|
+
return this.beginRequest<Git.Comment[]>({
|
|
3579
|
+
apiVersion: "7.2-preview.1",
|
|
3580
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}",
|
|
3581
|
+
routeValues: {
|
|
3582
|
+
project: project,
|
|
3583
|
+
repositoryId: repositoryId,
|
|
3584
|
+
pullRequestId: pullRequestId,
|
|
3585
|
+
threadId: threadId
|
|
3586
|
+
}
|
|
3587
|
+
});
|
|
3588
|
+
}
|
|
3589
|
+
|
|
3590
|
+
/**
|
|
3591
|
+
* Update a comment associated with a specific thread in a pull request.
|
|
3592
|
+
*
|
|
3593
|
+
* @param comment - The comment content that should be updated. Comments can be up to 150,000 characters.
|
|
3594
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3595
|
+
* @param pullRequestId - ID of the pull request.
|
|
3596
|
+
* @param threadId - ID of the thread that the desired comment is in.
|
|
3597
|
+
* @param commentId - ID of the comment to update.
|
|
3598
|
+
* @param project - Project ID or project name
|
|
3599
|
+
*/
|
|
3600
|
+
public async updateComment(
|
|
3601
|
+
comment: Git.Comment,
|
|
3602
|
+
repositoryId: string,
|
|
3603
|
+
pullRequestId: number,
|
|
3604
|
+
threadId: number,
|
|
3605
|
+
commentId: number,
|
|
3606
|
+
project?: string
|
|
3607
|
+
): Promise<Git.Comment> {
|
|
3608
|
+
|
|
3609
|
+
return this.beginRequest<Git.Comment>({
|
|
3610
|
+
apiVersion: "7.2-preview.1",
|
|
3611
|
+
method: "PATCH",
|
|
3612
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}",
|
|
3613
|
+
routeValues: {
|
|
3614
|
+
project: project,
|
|
3615
|
+
repositoryId: repositoryId,
|
|
3616
|
+
pullRequestId: pullRequestId,
|
|
3617
|
+
threadId: threadId,
|
|
3618
|
+
commentId: commentId
|
|
3619
|
+
},
|
|
3620
|
+
body: comment
|
|
3621
|
+
});
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3624
|
+
/**
|
|
3625
|
+
* Create a thread in a pull request.
|
|
3626
|
+
*
|
|
3627
|
+
* @param commentThread - The thread to create. Thread must contain at least one comment.
|
|
3628
|
+
* @param repositoryId - Repository ID of the pull request's target branch.
|
|
3629
|
+
* @param pullRequestId - ID of the pull request.
|
|
3630
|
+
* @param project - Project ID or project name
|
|
3631
|
+
*/
|
|
3632
|
+
public async createThread(
|
|
3633
|
+
commentThread: Git.GitPullRequestCommentThread,
|
|
3634
|
+
repositoryId: string,
|
|
3635
|
+
pullRequestId: number,
|
|
3636
|
+
project?: string
|
|
3637
|
+
): Promise<Git.GitPullRequestCommentThread> {
|
|
3638
|
+
|
|
3639
|
+
return this.beginRequest<Git.GitPullRequestCommentThread>({
|
|
3640
|
+
apiVersion: "7.2-preview.1",
|
|
3641
|
+
method: "POST",
|
|
3642
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}",
|
|
3643
|
+
routeValues: {
|
|
3644
|
+
project: project,
|
|
3645
|
+
repositoryId: repositoryId,
|
|
3646
|
+
pullRequestId: pullRequestId
|
|
3647
|
+
},
|
|
3648
|
+
body: commentThread
|
|
3649
|
+
});
|
|
3650
|
+
}
|
|
3651
|
+
|
|
3652
|
+
/**
|
|
3653
|
+
* Retrieve a thread in a pull request.
|
|
3654
|
+
*
|
|
3655
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3656
|
+
* @param pullRequestId - ID of the pull request.
|
|
3657
|
+
* @param threadId - ID of the thread.
|
|
3658
|
+
* @param project - Project ID or project name
|
|
3659
|
+
* @param iteration - If specified, thread position will be tracked using this iteration as the right side of the diff.
|
|
3660
|
+
* @param baseIteration - If specified, thread position will be tracked using this iteration as the left side of the diff.
|
|
3661
|
+
*/
|
|
3662
|
+
public async getPullRequestThread(
|
|
3663
|
+
repositoryId: string,
|
|
3664
|
+
pullRequestId: number,
|
|
3665
|
+
threadId: number,
|
|
3666
|
+
project?: string,
|
|
3667
|
+
iteration?: number,
|
|
3668
|
+
baseIteration?: number
|
|
3669
|
+
): Promise<Git.GitPullRequestCommentThread> {
|
|
3670
|
+
|
|
3671
|
+
const queryValues: any = {
|
|
3672
|
+
'$iteration': iteration,
|
|
3673
|
+
'$baseIteration': baseIteration
|
|
3674
|
+
};
|
|
3675
|
+
|
|
3676
|
+
return this.beginRequest<Git.GitPullRequestCommentThread>({
|
|
3677
|
+
apiVersion: "7.2-preview.1",
|
|
3678
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}",
|
|
3679
|
+
routeValues: {
|
|
3680
|
+
project: project,
|
|
3681
|
+
repositoryId: repositoryId,
|
|
3682
|
+
pullRequestId: pullRequestId,
|
|
3683
|
+
threadId: threadId
|
|
3684
|
+
},
|
|
3685
|
+
queryParams: queryValues
|
|
3686
|
+
});
|
|
3687
|
+
}
|
|
3688
|
+
|
|
3689
|
+
/**
|
|
3690
|
+
* Retrieve all threads in a pull request.
|
|
3691
|
+
*
|
|
3692
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3693
|
+
* @param pullRequestId - ID of the pull request.
|
|
3694
|
+
* @param project - Project ID or project name
|
|
3695
|
+
* @param iteration - If specified, thread positions will be tracked using this iteration as the right side of the diff.
|
|
3696
|
+
* @param baseIteration - If specified, thread positions will be tracked using this iteration as the left side of the diff.
|
|
3697
|
+
*/
|
|
3698
|
+
public async getThreads(
|
|
3699
|
+
repositoryId: string,
|
|
3700
|
+
pullRequestId: number,
|
|
3701
|
+
project?: string,
|
|
3702
|
+
iteration?: number,
|
|
3703
|
+
baseIteration?: number
|
|
3704
|
+
): Promise<Git.GitPullRequestCommentThread[]> {
|
|
3705
|
+
|
|
3706
|
+
const queryValues: any = {
|
|
3707
|
+
'$iteration': iteration,
|
|
3708
|
+
'$baseIteration': baseIteration
|
|
3709
|
+
};
|
|
3710
|
+
|
|
3711
|
+
return this.beginRequest<Git.GitPullRequestCommentThread[]>({
|
|
3712
|
+
apiVersion: "7.2-preview.1",
|
|
3713
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}",
|
|
3714
|
+
routeValues: {
|
|
3715
|
+
project: project,
|
|
3716
|
+
repositoryId: repositoryId,
|
|
3717
|
+
pullRequestId: pullRequestId
|
|
3718
|
+
},
|
|
3719
|
+
queryParams: queryValues
|
|
3720
|
+
});
|
|
3721
|
+
}
|
|
3722
|
+
|
|
3723
|
+
/**
|
|
3724
|
+
* Update a thread in a pull request.
|
|
3725
|
+
*
|
|
3726
|
+
* @param commentThread - The thread content that should be updated.
|
|
3727
|
+
* @param repositoryId - The repository ID of the pull request's target branch.
|
|
3728
|
+
* @param pullRequestId - ID of the pull request.
|
|
3729
|
+
* @param threadId - ID of the thread to update.
|
|
3730
|
+
* @param project - Project ID or project name
|
|
3731
|
+
*/
|
|
3732
|
+
public async updateThread(
|
|
3733
|
+
commentThread: Git.GitPullRequestCommentThread,
|
|
3734
|
+
repositoryId: string,
|
|
3735
|
+
pullRequestId: number,
|
|
3736
|
+
threadId: number,
|
|
3737
|
+
project?: string
|
|
3738
|
+
): Promise<Git.GitPullRequestCommentThread> {
|
|
3739
|
+
|
|
3740
|
+
return this.beginRequest<Git.GitPullRequestCommentThread>({
|
|
3741
|
+
apiVersion: "7.2-preview.1",
|
|
3742
|
+
method: "PATCH",
|
|
3743
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}",
|
|
3744
|
+
routeValues: {
|
|
3745
|
+
project: project,
|
|
3746
|
+
repositoryId: repositoryId,
|
|
3747
|
+
pullRequestId: pullRequestId,
|
|
3748
|
+
threadId: threadId
|
|
3749
|
+
},
|
|
3750
|
+
body: commentThread
|
|
3751
|
+
});
|
|
3752
|
+
}
|
|
3753
|
+
|
|
3754
|
+
/**
|
|
3755
|
+
* Retrieve a list of work items associated with a pull request.
|
|
3756
|
+
*
|
|
3757
|
+
* @param repositoryId - ID or name of the repository.
|
|
3758
|
+
* @param pullRequestId - ID of the pull request.
|
|
3759
|
+
* @param project - Project ID or project name
|
|
3760
|
+
*/
|
|
3761
|
+
public async getPullRequestWorkItemRefs(
|
|
3762
|
+
repositoryId: string,
|
|
3763
|
+
pullRequestId: number,
|
|
3764
|
+
project?: string
|
|
3765
|
+
): Promise<WebApi.ResourceRef[]> {
|
|
3766
|
+
|
|
3767
|
+
return this.beginRequest<WebApi.ResourceRef[]>({
|
|
3768
|
+
apiVersion: "7.2-preview.1",
|
|
3769
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/workitems",
|
|
3770
|
+
routeValues: {
|
|
3771
|
+
project: project,
|
|
3772
|
+
repositoryId: repositoryId,
|
|
3773
|
+
pullRequestId: pullRequestId
|
|
3774
|
+
}
|
|
3775
|
+
});
|
|
3776
|
+
}
|
|
3777
|
+
|
|
3778
|
+
/**
|
|
3779
|
+
* Push changes to the repository.
|
|
3780
|
+
*
|
|
3781
|
+
* @param push -
|
|
3782
|
+
* @param repositoryId - The name or ID of the repository.
|
|
3783
|
+
* @param project - Project ID or project name
|
|
3784
|
+
*/
|
|
3785
|
+
public async createPush(
|
|
3786
|
+
push: Git.GitPush,
|
|
3787
|
+
repositoryId: string,
|
|
3788
|
+
project?: string
|
|
3789
|
+
): Promise<Git.GitPush> {
|
|
3790
|
+
|
|
3791
|
+
return this.beginRequest<Git.GitPush>({
|
|
3792
|
+
apiVersion: "7.2-preview.3",
|
|
3793
|
+
method: "POST",
|
|
3794
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pushes/{pushId}",
|
|
3795
|
+
routeValues: {
|
|
3796
|
+
project: project,
|
|
3797
|
+
repositoryId: repositoryId
|
|
3798
|
+
},
|
|
3799
|
+
body: push
|
|
3800
|
+
});
|
|
3801
|
+
}
|
|
3802
|
+
|
|
3803
|
+
/**
|
|
3804
|
+
* Retrieves a particular push.
|
|
3805
|
+
*
|
|
3806
|
+
* @param repositoryId - The name or ID of the repository.
|
|
3807
|
+
* @param pushId - ID of the push.
|
|
3808
|
+
* @param project - Project ID or project name
|
|
3809
|
+
* @param includeCommits - The number of commits to include in the result.
|
|
3810
|
+
* @param includeRefUpdates - If true, include the list of refs that were updated by the push.
|
|
3811
|
+
*/
|
|
3812
|
+
public async getPush(
|
|
3813
|
+
repositoryId: string,
|
|
3814
|
+
pushId: number,
|
|
3815
|
+
project?: string,
|
|
3816
|
+
includeCommits?: number,
|
|
3817
|
+
includeRefUpdates?: boolean
|
|
3818
|
+
): Promise<Git.GitPush> {
|
|
3819
|
+
|
|
3820
|
+
const queryValues: any = {
|
|
3821
|
+
includeCommits: includeCommits,
|
|
3822
|
+
includeRefUpdates: includeRefUpdates
|
|
3823
|
+
};
|
|
3824
|
+
|
|
3825
|
+
return this.beginRequest<Git.GitPush>({
|
|
3826
|
+
apiVersion: "7.2-preview.3",
|
|
3827
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pushes/{pushId}",
|
|
3828
|
+
routeValues: {
|
|
3829
|
+
project: project,
|
|
3830
|
+
repositoryId: repositoryId,
|
|
3831
|
+
pushId: pushId
|
|
3832
|
+
},
|
|
3833
|
+
queryParams: queryValues
|
|
3834
|
+
});
|
|
3835
|
+
}
|
|
3836
|
+
|
|
3837
|
+
/**
|
|
3838
|
+
* Retrieves pushes associated with the specified repository.
|
|
3839
|
+
*
|
|
3840
|
+
* @param repositoryId - The name or ID of the repository.
|
|
3841
|
+
* @param project - Project ID or project name
|
|
3842
|
+
* @param skip - Number of pushes to skip.
|
|
3843
|
+
* @param top - Number of pushes to return.
|
|
3844
|
+
* @param searchCriteria - Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references.
|
|
3845
|
+
*/
|
|
3846
|
+
public async getPushes(
|
|
3847
|
+
repositoryId: string,
|
|
3848
|
+
project?: string,
|
|
3849
|
+
skip?: number,
|
|
3850
|
+
top?: number,
|
|
3851
|
+
searchCriteria?: Git.GitPushSearchCriteria
|
|
3852
|
+
): Promise<Git.GitPush[]> {
|
|
3853
|
+
|
|
3854
|
+
const queryValues: any = {
|
|
3855
|
+
'$skip': skip,
|
|
3856
|
+
'$top': top,
|
|
3857
|
+
searchCriteria: searchCriteria
|
|
3858
|
+
};
|
|
3859
|
+
|
|
3860
|
+
return this.beginRequest<Git.GitPush[]>({
|
|
3861
|
+
apiVersion: "7.2-preview.3",
|
|
3862
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pushes/{pushId}",
|
|
3863
|
+
routeValues: {
|
|
3864
|
+
project: project,
|
|
3865
|
+
repositoryId: repositoryId
|
|
3866
|
+
},
|
|
3867
|
+
queryParams: queryValues
|
|
3868
|
+
});
|
|
3869
|
+
}
|
|
3870
|
+
|
|
3871
|
+
/**
|
|
3872
|
+
* Destroy (hard delete) a soft-deleted Git repository.
|
|
3873
|
+
*
|
|
3874
|
+
* @param project - Project ID or project name
|
|
3875
|
+
* @param repositoryId - The ID of the repository.
|
|
3876
|
+
*/
|
|
3877
|
+
public async deleteRepositoryFromRecycleBin(
|
|
3878
|
+
project: string,
|
|
3879
|
+
repositoryId: string
|
|
3880
|
+
): Promise<void> {
|
|
3881
|
+
|
|
3882
|
+
return this.beginRequest<void>({
|
|
3883
|
+
apiVersion: "7.2-preview.1",
|
|
3884
|
+
method: "DELETE",
|
|
3885
|
+
routeTemplate: "{project}/_apis/git/recycleBin/repositories/{repositoryId}",
|
|
3886
|
+
routeValues: {
|
|
3887
|
+
project: project,
|
|
3888
|
+
repositoryId: repositoryId
|
|
3889
|
+
}
|
|
3890
|
+
});
|
|
3891
|
+
}
|
|
3892
|
+
|
|
3893
|
+
/**
|
|
3894
|
+
* Retrieve soft-deleted git repositories from the recycle bin.
|
|
3895
|
+
*
|
|
3896
|
+
* @param project - Project ID or project name
|
|
3897
|
+
*/
|
|
3898
|
+
public async getRecycleBinRepositories(
|
|
3899
|
+
project: string
|
|
3900
|
+
): Promise<Git.GitDeletedRepository[]> {
|
|
3901
|
+
|
|
3902
|
+
return this.beginRequest<Git.GitDeletedRepository[]>({
|
|
3903
|
+
apiVersion: "7.2-preview.1",
|
|
3904
|
+
routeTemplate: "{project}/_apis/git/recycleBin/repositories/{repositoryId}",
|
|
3905
|
+
routeValues: {
|
|
3906
|
+
project: project
|
|
3907
|
+
}
|
|
3908
|
+
});
|
|
3909
|
+
}
|
|
3910
|
+
|
|
3911
|
+
/**
|
|
3912
|
+
* Recover a soft-deleted Git repository. Recently deleted repositories go into a soft-delete state for a period of time before they are hard deleted and become unrecoverable.
|
|
3913
|
+
*
|
|
3914
|
+
* @param repositoryDetails -
|
|
3915
|
+
* @param project - Project ID or project name
|
|
3916
|
+
* @param repositoryId - The ID of the repository.
|
|
3917
|
+
*/
|
|
3918
|
+
public async restoreRepositoryFromRecycleBin(
|
|
3919
|
+
repositoryDetails: Git.GitRecycleBinRepositoryDetails,
|
|
3920
|
+
project: string,
|
|
3921
|
+
repositoryId: string
|
|
3922
|
+
): Promise<Git.GitRepository> {
|
|
3923
|
+
|
|
3924
|
+
return this.beginRequest<Git.GitRepository>({
|
|
3925
|
+
apiVersion: "7.2-preview.1",
|
|
3926
|
+
method: "PATCH",
|
|
3927
|
+
routeTemplate: "{project}/_apis/git/recycleBin/repositories/{repositoryId}",
|
|
3928
|
+
routeValues: {
|
|
3929
|
+
project: project,
|
|
3930
|
+
repositoryId: repositoryId
|
|
3931
|
+
},
|
|
3932
|
+
body: repositoryDetails
|
|
3933
|
+
});
|
|
3934
|
+
}
|
|
3935
|
+
|
|
3936
|
+
/**
|
|
3937
|
+
* Queries the provided repository for its refs and returns them.
|
|
3938
|
+
*
|
|
3939
|
+
* @param repositoryId - The name or ID of the repository.
|
|
3940
|
+
* @param project - Project ID or project name
|
|
3941
|
+
* @param filter - [optional] A filter to apply to the refs (starts with).
|
|
3942
|
+
* @param includeLinks - [optional] Specifies if referenceLinks should be included in the result. default is false.
|
|
3943
|
+
* @param includeStatuses - [optional] Includes up to the first 1000 commit statuses for each ref. The default value is false.
|
|
3944
|
+
* @param includeMyBranches - [optional] Includes only branches that the user owns, the branches the user favorites, and the default branch. The default value is false. Cannot be combined with the filter parameter.
|
|
3945
|
+
* @param latestStatusesOnly - [optional] True to include only the tip commit status for each ref. This option requires \`includeStatuses\` to be true. The default value is false.
|
|
3946
|
+
* @param peelTags - [optional] Annotated tags will populate the PeeledObjectId property. default is false.
|
|
3947
|
+
* @param filterContains - [optional] A filter to apply to the refs (contains).
|
|
3948
|
+
*/
|
|
3949
|
+
public async getRefs(
|
|
3950
|
+
repositoryId: string,
|
|
3951
|
+
project?: string,
|
|
3952
|
+
filter?: string,
|
|
3953
|
+
includeLinks?: boolean,
|
|
3954
|
+
includeStatuses?: boolean,
|
|
3955
|
+
includeMyBranches?: boolean,
|
|
3956
|
+
latestStatusesOnly?: boolean,
|
|
3957
|
+
peelTags?: boolean,
|
|
3958
|
+
filterContains?: string
|
|
3959
|
+
): Promise<WebApi.PagedList<Git.GitRef>> {
|
|
3960
|
+
|
|
3961
|
+
const queryValues: any = {
|
|
3962
|
+
filter: filter,
|
|
3963
|
+
includeLinks: includeLinks,
|
|
3964
|
+
includeStatuses: includeStatuses,
|
|
3965
|
+
includeMyBranches: includeMyBranches,
|
|
3966
|
+
latestStatusesOnly: latestStatusesOnly,
|
|
3967
|
+
peelTags: peelTags,
|
|
3968
|
+
filterContains: filterContains
|
|
3969
|
+
};
|
|
3970
|
+
|
|
3971
|
+
return this.beginRequest<Response>({
|
|
3972
|
+
apiVersion: "7.2-preview.2",
|
|
3973
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/refs/{*filter}",
|
|
3974
|
+
routeValues: {
|
|
3975
|
+
project: project,
|
|
3976
|
+
repositoryId: repositoryId
|
|
3977
|
+
},
|
|
3978
|
+
queryParams: queryValues,
|
|
3979
|
+
returnRawResponse: true
|
|
3980
|
+
}).then(async response => {
|
|
3981
|
+
const body = <WebApi.PagedList<Git.GitRef>>await response.text().then(deserializeVssJsonObject);
|
|
3982
|
+
body.continuationToken = response.headers.get("x-ms-continuationtoken");
|
|
3983
|
+
return body;
|
|
3984
|
+
});
|
|
3985
|
+
}
|
|
3986
|
+
|
|
3987
|
+
/**
|
|
3988
|
+
* Lock or Unlock a branch.
|
|
3989
|
+
*
|
|
3990
|
+
* @param newRefInfo - The ref update action (lock/unlock) to perform
|
|
3991
|
+
* @param repositoryId - The name or ID of the repository.
|
|
3992
|
+
* @param filter - The name of the branch to lock/unlock
|
|
3993
|
+
* @param project - Project ID or project name
|
|
3994
|
+
* @param projectId - ID or name of the team project. Optional if specifying an ID for repository.
|
|
3995
|
+
*/
|
|
3996
|
+
public async updateRef(
|
|
3997
|
+
newRefInfo: Git.GitRefUpdate,
|
|
3998
|
+
repositoryId: string,
|
|
3999
|
+
filter: string,
|
|
4000
|
+
project?: string,
|
|
4001
|
+
projectId?: string
|
|
4002
|
+
): Promise<Git.GitRef> {
|
|
4003
|
+
|
|
4004
|
+
const queryValues: any = {
|
|
4005
|
+
filter: filter,
|
|
4006
|
+
projectId: projectId
|
|
4007
|
+
};
|
|
4008
|
+
|
|
4009
|
+
return this.beginRequest<Git.GitRef>({
|
|
4010
|
+
apiVersion: "7.2-preview.2",
|
|
4011
|
+
method: "PATCH",
|
|
4012
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/refs/{*filter}",
|
|
4013
|
+
routeValues: {
|
|
4014
|
+
project: project,
|
|
4015
|
+
repositoryId: repositoryId
|
|
4016
|
+
},
|
|
4017
|
+
queryParams: queryValues,
|
|
4018
|
+
body: newRefInfo
|
|
4019
|
+
});
|
|
4020
|
+
}
|
|
4021
|
+
|
|
4022
|
+
/**
|
|
4023
|
+
* Creating, updating, or deleting refs(branches).
|
|
4024
|
+
*
|
|
4025
|
+
* @param refUpdates - List of ref updates to attempt to perform
|
|
4026
|
+
* @param repositoryId - The name or ID of the repository.
|
|
4027
|
+
* @param project - Project ID or project name
|
|
4028
|
+
* @param projectId - ID or name of the team project. Optional if specifying an ID for repository.
|
|
4029
|
+
*/
|
|
4030
|
+
public async updateRefs(
|
|
4031
|
+
refUpdates: Git.GitRefUpdate[],
|
|
4032
|
+
repositoryId: string,
|
|
4033
|
+
project?: string,
|
|
4034
|
+
projectId?: string
|
|
4035
|
+
): Promise<Git.GitRefUpdateResult[]> {
|
|
4036
|
+
|
|
4037
|
+
const queryValues: any = {
|
|
4038
|
+
projectId: projectId
|
|
4039
|
+
};
|
|
4040
|
+
|
|
4041
|
+
return this.beginRequest<Git.GitRefUpdateResult[]>({
|
|
4042
|
+
apiVersion: "7.2-preview.2",
|
|
4043
|
+
method: "POST",
|
|
4044
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/refs/{*filter}",
|
|
4045
|
+
routeValues: {
|
|
4046
|
+
project: project,
|
|
4047
|
+
repositoryId: repositoryId
|
|
4048
|
+
},
|
|
4049
|
+
queryParams: queryValues,
|
|
4050
|
+
body: refUpdates
|
|
4051
|
+
});
|
|
4052
|
+
}
|
|
4053
|
+
|
|
4054
|
+
/**
|
|
4055
|
+
* Creates a ref favorite
|
|
4056
|
+
*
|
|
4057
|
+
* @param favorite - The ref favorite to create.
|
|
4058
|
+
* @param project - Project ID or project name
|
|
4059
|
+
*/
|
|
4060
|
+
public async createFavorite(
|
|
4061
|
+
favorite: Git.GitRefFavorite,
|
|
4062
|
+
project: string
|
|
4063
|
+
): Promise<Git.GitRefFavorite> {
|
|
4064
|
+
|
|
4065
|
+
return this.beginRequest<Git.GitRefFavorite>({
|
|
4066
|
+
apiVersion: "7.2-preview.1",
|
|
4067
|
+
method: "POST",
|
|
4068
|
+
routeTemplate: "{project}/_apis/git/favorites/refs/{favoriteId}",
|
|
4069
|
+
routeValues: {
|
|
4070
|
+
project: project
|
|
4071
|
+
},
|
|
4072
|
+
body: favorite
|
|
4073
|
+
});
|
|
4074
|
+
}
|
|
4075
|
+
|
|
4076
|
+
/**
|
|
4077
|
+
* Deletes the refs favorite specified
|
|
4078
|
+
*
|
|
4079
|
+
* @param project - Project ID or project name
|
|
4080
|
+
* @param favoriteId - The Id of the ref favorite to delete.
|
|
4081
|
+
*/
|
|
4082
|
+
public async deleteRefFavorite(
|
|
4083
|
+
project: string,
|
|
4084
|
+
favoriteId: number
|
|
4085
|
+
): Promise<void> {
|
|
4086
|
+
|
|
4087
|
+
return this.beginRequest<void>({
|
|
4088
|
+
apiVersion: "7.2-preview.1",
|
|
4089
|
+
method: "DELETE",
|
|
4090
|
+
routeTemplate: "{project}/_apis/git/favorites/refs/{favoriteId}",
|
|
4091
|
+
routeValues: {
|
|
4092
|
+
project: project,
|
|
4093
|
+
favoriteId: favoriteId
|
|
4094
|
+
}
|
|
4095
|
+
});
|
|
4096
|
+
}
|
|
4097
|
+
|
|
4098
|
+
/**
|
|
4099
|
+
* Gets the refs favorite for a favorite Id.
|
|
4100
|
+
*
|
|
4101
|
+
* @param project - Project ID or project name
|
|
4102
|
+
* @param favoriteId - The Id of the requested ref favorite.
|
|
4103
|
+
*/
|
|
4104
|
+
public async getRefFavorite(
|
|
4105
|
+
project: string,
|
|
4106
|
+
favoriteId: number
|
|
4107
|
+
): Promise<Git.GitRefFavorite> {
|
|
4108
|
+
|
|
4109
|
+
return this.beginRequest<Git.GitRefFavorite>({
|
|
4110
|
+
apiVersion: "7.2-preview.1",
|
|
4111
|
+
routeTemplate: "{project}/_apis/git/favorites/refs/{favoriteId}",
|
|
4112
|
+
routeValues: {
|
|
4113
|
+
project: project,
|
|
4114
|
+
favoriteId: favoriteId
|
|
4115
|
+
}
|
|
4116
|
+
});
|
|
4117
|
+
}
|
|
4118
|
+
|
|
4119
|
+
/**
|
|
4120
|
+
* Gets the refs favorites for a repo and an identity.
|
|
4121
|
+
*
|
|
4122
|
+
* @param project - Project ID or project name
|
|
4123
|
+
* @param repositoryId - The id of the repository.
|
|
4124
|
+
* @param identityId - The id of the identity whose favorites are to be retrieved. If null, the requesting identity is used.
|
|
4125
|
+
*/
|
|
4126
|
+
public async getRefFavorites(
|
|
4127
|
+
project: string,
|
|
4128
|
+
repositoryId?: string,
|
|
4129
|
+
identityId?: string
|
|
4130
|
+
): Promise<Git.GitRefFavorite[]> {
|
|
4131
|
+
|
|
4132
|
+
const queryValues: any = {
|
|
4133
|
+
repositoryId: repositoryId,
|
|
4134
|
+
identityId: identityId
|
|
4135
|
+
};
|
|
4136
|
+
|
|
4137
|
+
return this.beginRequest<Git.GitRefFavorite[]>({
|
|
4138
|
+
apiVersion: "7.2-preview.1",
|
|
4139
|
+
routeTemplate: "{project}/_apis/git/favorites/refs/{favoriteId}",
|
|
4140
|
+
routeValues: {
|
|
4141
|
+
project: project
|
|
4142
|
+
},
|
|
4143
|
+
queryParams: queryValues
|
|
4144
|
+
});
|
|
4145
|
+
}
|
|
4146
|
+
|
|
4147
|
+
/**
|
|
4148
|
+
* @param project - Project ID or project name
|
|
4149
|
+
* @param identityId -
|
|
4150
|
+
*/
|
|
4151
|
+
public async getRefFavoritesForProject(
|
|
4152
|
+
project: string,
|
|
4153
|
+
identityId?: string
|
|
4154
|
+
): Promise<Git.GitRefFavorite[]> {
|
|
4155
|
+
|
|
4156
|
+
const queryValues: any = {
|
|
4157
|
+
identityId: identityId
|
|
4158
|
+
};
|
|
4159
|
+
|
|
4160
|
+
return this.beginRequest<Git.GitRefFavorite[]>({
|
|
4161
|
+
apiVersion: "7.2-preview.1",
|
|
4162
|
+
routeTemplate: "{project}/_apis/git/favorites/refsForProject",
|
|
4163
|
+
routeValues: {
|
|
4164
|
+
project: project
|
|
4165
|
+
},
|
|
4166
|
+
queryParams: queryValues
|
|
4167
|
+
});
|
|
4168
|
+
}
|
|
4169
|
+
|
|
4170
|
+
/**
|
|
4171
|
+
* Create a git repository in a team project.
|
|
4172
|
+
*
|
|
4173
|
+
* @param gitRepositoryToCreate - Specify the repo name, team project and/or parent repository. Team project information can be omitted from gitRepositoryToCreate if the request is project-scoped (i.e., includes project Id).
|
|
4174
|
+
* @param project - Project ID or project name
|
|
4175
|
+
* @param sourceRef - [optional] Specify the source refs to use while creating a fork repo
|
|
4176
|
+
*/
|
|
4177
|
+
public async createRepository(
|
|
4178
|
+
gitRepositoryToCreate: Git.GitRepositoryCreateOptions,
|
|
4179
|
+
project?: string,
|
|
4180
|
+
sourceRef?: string
|
|
4181
|
+
): Promise<Git.GitRepository> {
|
|
4182
|
+
|
|
4183
|
+
const queryValues: any = {
|
|
4184
|
+
sourceRef: sourceRef
|
|
4185
|
+
};
|
|
4186
|
+
|
|
4187
|
+
return this.beginRequest<Git.GitRepository>({
|
|
4188
|
+
apiVersion: "7.2-preview.1",
|
|
4189
|
+
method: "POST",
|
|
4190
|
+
routeTemplate: "{project}/_apis/git/Repositories/{repositoryId}",
|
|
4191
|
+
routeValues: {
|
|
4192
|
+
project: project
|
|
4193
|
+
},
|
|
4194
|
+
queryParams: queryValues,
|
|
4195
|
+
body: gitRepositoryToCreate
|
|
4196
|
+
});
|
|
4197
|
+
}
|
|
4198
|
+
|
|
4199
|
+
/**
|
|
4200
|
+
* Delete a git repository
|
|
4201
|
+
*
|
|
4202
|
+
* @param repositoryId - The ID of the repository.
|
|
4203
|
+
* @param project - Project ID or project name
|
|
4204
|
+
*/
|
|
4205
|
+
public async deleteRepository(
|
|
4206
|
+
repositoryId: string,
|
|
4207
|
+
project?: string
|
|
4208
|
+
): Promise<void> {
|
|
4209
|
+
|
|
4210
|
+
return this.beginRequest<void>({
|
|
4211
|
+
apiVersion: "7.2-preview.1",
|
|
4212
|
+
method: "DELETE",
|
|
4213
|
+
routeTemplate: "{project}/_apis/git/Repositories/{repositoryId}",
|
|
4214
|
+
routeValues: {
|
|
4215
|
+
project: project,
|
|
4216
|
+
repositoryId: repositoryId
|
|
4217
|
+
}
|
|
4218
|
+
});
|
|
4219
|
+
}
|
|
4220
|
+
|
|
4221
|
+
/**
|
|
4222
|
+
* Retrieve git repositories.
|
|
4223
|
+
*
|
|
4224
|
+
* @param project - Project ID or project name
|
|
4225
|
+
* @param includeLinks - [optional] True to include reference links. The default value is false.
|
|
4226
|
+
* @param includeAllUrls - [optional] True to include all remote URLs. The default value is false.
|
|
4227
|
+
* @param includeHidden - [optional] True to include hidden repositories. The default value is false.
|
|
4228
|
+
*/
|
|
4229
|
+
public async getRepositories(
|
|
4230
|
+
project?: string,
|
|
4231
|
+
includeLinks?: boolean,
|
|
4232
|
+
includeAllUrls?: boolean,
|
|
4233
|
+
includeHidden?: boolean
|
|
4234
|
+
): Promise<Git.GitRepository[]> {
|
|
4235
|
+
|
|
4236
|
+
const queryValues: any = {
|
|
4237
|
+
includeLinks: includeLinks,
|
|
4238
|
+
includeAllUrls: includeAllUrls,
|
|
4239
|
+
includeHidden: includeHidden
|
|
4240
|
+
};
|
|
4241
|
+
|
|
4242
|
+
return this.beginRequest<Git.GitRepository[]>({
|
|
4243
|
+
apiVersion: "7.2-preview.1",
|
|
4244
|
+
routeTemplate: "{project}/_apis/git/Repositories/{repositoryId}",
|
|
4245
|
+
routeValues: {
|
|
4246
|
+
project: project
|
|
4247
|
+
},
|
|
4248
|
+
queryParams: queryValues
|
|
4249
|
+
});
|
|
4250
|
+
}
|
|
4251
|
+
|
|
4252
|
+
/**
|
|
4253
|
+
* Retrieve a git repository.
|
|
4254
|
+
*
|
|
4255
|
+
* @param repositoryId - The name or ID of the repository.
|
|
4256
|
+
* @param project - Project ID or project name
|
|
4257
|
+
*/
|
|
4258
|
+
public async getRepository(
|
|
4259
|
+
repositoryId: string,
|
|
4260
|
+
project?: string
|
|
4261
|
+
): Promise<Git.GitRepository> {
|
|
4262
|
+
|
|
4263
|
+
return this.beginRequest<Git.GitRepository>({
|
|
4264
|
+
apiVersion: "7.2-preview.1",
|
|
4265
|
+
routeTemplate: "{project}/_apis/git/Repositories/{repositoryId}",
|
|
4266
|
+
routeValues: {
|
|
4267
|
+
project: project,
|
|
4268
|
+
repositoryId: repositoryId
|
|
4269
|
+
}
|
|
4270
|
+
});
|
|
4271
|
+
}
|
|
4272
|
+
|
|
4273
|
+
/**
|
|
4274
|
+
* Retrieve a git repository.
|
|
4275
|
+
*
|
|
4276
|
+
* @param repositoryId - The name or ID of the repository.
|
|
4277
|
+
* @param includeParent - True to include parent repository. Only available in authenticated calls.
|
|
4278
|
+
* @param project - Project ID or project name
|
|
4279
|
+
*/
|
|
4280
|
+
public async getRepositoryWithParent(
|
|
4281
|
+
repositoryId: string,
|
|
4282
|
+
includeParent: boolean,
|
|
4283
|
+
project?: string
|
|
4284
|
+
): Promise<Git.GitRepository> {
|
|
4285
|
+
|
|
4286
|
+
const queryValues: any = {
|
|
4287
|
+
includeParent: includeParent
|
|
4288
|
+
};
|
|
4289
|
+
|
|
4290
|
+
return this.beginRequest<Git.GitRepository>({
|
|
4291
|
+
apiVersion: "7.2-preview.1",
|
|
4292
|
+
routeTemplate: "{project}/_apis/git/Repositories/{repositoryId}",
|
|
4293
|
+
routeValues: {
|
|
4294
|
+
project: project,
|
|
4295
|
+
repositoryId: repositoryId
|
|
4296
|
+
},
|
|
4297
|
+
queryParams: queryValues
|
|
4298
|
+
});
|
|
4299
|
+
}
|
|
4300
|
+
|
|
4301
|
+
/**
|
|
4302
|
+
* Updates the Git repository with either a new repo name or a new default branch.
|
|
4303
|
+
*
|
|
4304
|
+
* @param newRepositoryInfo - Specify a new repo name or a new default branch of the repository
|
|
4305
|
+
* @param repositoryId - The ID of the repository.
|
|
4306
|
+
* @param project - Project ID or project name
|
|
4307
|
+
*/
|
|
4308
|
+
public async updateRepository(
|
|
4309
|
+
newRepositoryInfo: Git.GitRepository,
|
|
4310
|
+
repositoryId: string,
|
|
4311
|
+
project?: string
|
|
4312
|
+
): Promise<Git.GitRepository> {
|
|
4313
|
+
|
|
4314
|
+
return this.beginRequest<Git.GitRepository>({
|
|
4315
|
+
apiVersion: "7.2-preview.1",
|
|
4316
|
+
method: "PATCH",
|
|
4317
|
+
routeTemplate: "{project}/_apis/git/Repositories/{repositoryId}",
|
|
4318
|
+
routeValues: {
|
|
4319
|
+
project: project,
|
|
4320
|
+
repositoryId: repositoryId
|
|
4321
|
+
},
|
|
4322
|
+
body: newRepositoryInfo
|
|
4323
|
+
});
|
|
4324
|
+
}
|
|
4325
|
+
|
|
4326
|
+
/**
|
|
4327
|
+
* Retrieve git repositories with filter by name and pagination.
|
|
4328
|
+
*
|
|
4329
|
+
* @param projectId - ID or name of the team project.
|
|
4330
|
+
* @param includeLinks - [optional] True to include reference links. The default value is false.
|
|
4331
|
+
* @param includeAllUrls - [optional] True to include all remote URLs. The default value is false.
|
|
4332
|
+
* @param includeHidden - [optional] True to include hidden repositories. The default value is false.
|
|
4333
|
+
* @param filterContains - [optional] A filter to apply to the refs (contains).
|
|
4334
|
+
* @param top - [optional] Maximum number of repositories to return. It cannot be bigger than 500. If it is not provided but continuationToken is, top will default to 100.
|
|
4335
|
+
* @param continuationToken - The continuation token used for pagination.
|
|
4336
|
+
*/
|
|
4337
|
+
public async getRepositoriesPaged(
|
|
4338
|
+
projectId: string,
|
|
4339
|
+
includeLinks?: boolean,
|
|
4340
|
+
includeAllUrls?: boolean,
|
|
4341
|
+
includeHidden?: boolean,
|
|
4342
|
+
filterContains?: string,
|
|
4343
|
+
top?: number,
|
|
4344
|
+
continuationToken?: string
|
|
4345
|
+
): Promise<WebApi.PagedList<Git.GitRepository>> {
|
|
4346
|
+
|
|
4347
|
+
const queryValues: any = {
|
|
4348
|
+
includeLinks: includeLinks,
|
|
4349
|
+
includeAllUrls: includeAllUrls,
|
|
4350
|
+
includeHidden: includeHidden,
|
|
4351
|
+
filterContains: filterContains,
|
|
4352
|
+
'$top': top,
|
|
4353
|
+
continuationToken: continuationToken
|
|
4354
|
+
};
|
|
4355
|
+
|
|
4356
|
+
return this.beginRequest<Response>({
|
|
4357
|
+
apiVersion: "7.2-preview.1",
|
|
4358
|
+
routeTemplate: "_apis/git/{projectId}/repositoriesPaged",
|
|
4359
|
+
routeValues: {
|
|
4360
|
+
projectId: projectId
|
|
4361
|
+
},
|
|
4362
|
+
queryParams: queryValues,
|
|
4363
|
+
returnRawResponse: true
|
|
4364
|
+
}).then(async response => {
|
|
4365
|
+
const body = <WebApi.PagedList<Git.GitRepository>>await response.text().then(deserializeVssJsonObject);
|
|
4366
|
+
body.continuationToken = response.headers.get("x-ms-continuationtoken");
|
|
4367
|
+
return body;
|
|
4368
|
+
});
|
|
4369
|
+
}
|
|
4370
|
+
|
|
4371
|
+
/**
|
|
4372
|
+
* Retrieve one conflict for a revert by ID
|
|
4373
|
+
*
|
|
4374
|
+
* @param repositoryId -
|
|
4375
|
+
* @param revertId -
|
|
4376
|
+
* @param conflictId -
|
|
4377
|
+
* @param project - Project ID or project name
|
|
4378
|
+
*/
|
|
4379
|
+
public async getRevertConflict(
|
|
4380
|
+
repositoryId: string,
|
|
4381
|
+
revertId: number,
|
|
4382
|
+
conflictId: number,
|
|
4383
|
+
project?: string
|
|
4384
|
+
): Promise<Git.GitConflict> {
|
|
4385
|
+
|
|
4386
|
+
return this.beginRequest<Git.GitConflict>({
|
|
4387
|
+
apiVersion: "7.2-preview.1",
|
|
4388
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}/conflicts/{conflictId}",
|
|
4389
|
+
routeValues: {
|
|
4390
|
+
project: project,
|
|
4391
|
+
repositoryId: repositoryId,
|
|
4392
|
+
revertId: revertId,
|
|
4393
|
+
conflictId: conflictId
|
|
4394
|
+
}
|
|
4395
|
+
});
|
|
4396
|
+
}
|
|
4397
|
+
|
|
4398
|
+
/**
|
|
4399
|
+
* Retrieve all conflicts for a revert
|
|
4400
|
+
*
|
|
4401
|
+
* @param repositoryId -
|
|
4402
|
+
* @param revertId -
|
|
4403
|
+
* @param project - Project ID or project name
|
|
4404
|
+
* @param continuationToken -
|
|
4405
|
+
* @param top -
|
|
4406
|
+
* @param excludeResolved -
|
|
4407
|
+
* @param onlyResolved -
|
|
4408
|
+
* @param includeObsolete -
|
|
4409
|
+
*/
|
|
4410
|
+
public async getRevertConflicts(
|
|
4411
|
+
repositoryId: string,
|
|
4412
|
+
revertId: number,
|
|
4413
|
+
project?: string,
|
|
4414
|
+
continuationToken?: string,
|
|
4415
|
+
top?: number,
|
|
4416
|
+
excludeResolved?: boolean,
|
|
4417
|
+
onlyResolved?: boolean,
|
|
4418
|
+
includeObsolete?: boolean
|
|
4419
|
+
): Promise<WebApi.PagedList<Git.GitConflict>> {
|
|
4420
|
+
|
|
4421
|
+
const queryValues: any = {
|
|
4422
|
+
continuationToken: continuationToken,
|
|
4423
|
+
'$top': top,
|
|
4424
|
+
excludeResolved: excludeResolved,
|
|
4425
|
+
onlyResolved: onlyResolved,
|
|
4426
|
+
includeObsolete: includeObsolete
|
|
4427
|
+
};
|
|
4428
|
+
|
|
4429
|
+
return this.beginRequest<Response>({
|
|
4430
|
+
apiVersion: "7.2-preview.1",
|
|
4431
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}/conflicts/{conflictId}",
|
|
4432
|
+
routeValues: {
|
|
4433
|
+
project: project,
|
|
4434
|
+
repositoryId: repositoryId,
|
|
4435
|
+
revertId: revertId
|
|
4436
|
+
},
|
|
4437
|
+
queryParams: queryValues,
|
|
4438
|
+
returnRawResponse: true
|
|
4439
|
+
}).then(async response => {
|
|
4440
|
+
const body = <WebApi.PagedList<Git.GitConflict>>await response.text().then(deserializeVssJsonObject);
|
|
4441
|
+
body.continuationToken = response.headers.get("x-ms-continuationtoken");
|
|
4442
|
+
return body;
|
|
4443
|
+
});
|
|
4444
|
+
}
|
|
4445
|
+
|
|
4446
|
+
/**
|
|
4447
|
+
* Update merge conflict resolution
|
|
4448
|
+
*
|
|
4449
|
+
* @param conflict -
|
|
4450
|
+
* @param repositoryId -
|
|
4451
|
+
* @param revertId -
|
|
4452
|
+
* @param conflictId -
|
|
4453
|
+
* @param project - Project ID or project name
|
|
4454
|
+
*/
|
|
4455
|
+
public async updateRevertConflict(
|
|
4456
|
+
conflict: Git.GitConflict,
|
|
4457
|
+
repositoryId: string,
|
|
4458
|
+
revertId: number,
|
|
4459
|
+
conflictId: number,
|
|
4460
|
+
project?: string
|
|
4461
|
+
): Promise<Git.GitConflict> {
|
|
4462
|
+
|
|
4463
|
+
return this.beginRequest<Git.GitConflict>({
|
|
4464
|
+
apiVersion: "7.2-preview.1",
|
|
4465
|
+
method: "PATCH",
|
|
4466
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}/conflicts/{conflictId}",
|
|
4467
|
+
routeValues: {
|
|
4468
|
+
project: project,
|
|
4469
|
+
repositoryId: repositoryId,
|
|
4470
|
+
revertId: revertId,
|
|
4471
|
+
conflictId: conflictId
|
|
4472
|
+
},
|
|
4473
|
+
body: conflict
|
|
4474
|
+
});
|
|
4475
|
+
}
|
|
4476
|
+
|
|
4477
|
+
/**
|
|
4478
|
+
* Update multiple merge conflict resolutions
|
|
4479
|
+
*
|
|
4480
|
+
* @param conflictUpdates -
|
|
4481
|
+
* @param repositoryId -
|
|
4482
|
+
* @param revertId -
|
|
4483
|
+
* @param project - Project ID or project name
|
|
4484
|
+
*/
|
|
4485
|
+
public async updateRevertConflicts(
|
|
4486
|
+
conflictUpdates: Git.GitConflict[],
|
|
4487
|
+
repositoryId: string,
|
|
4488
|
+
revertId: number,
|
|
4489
|
+
project?: string
|
|
4490
|
+
): Promise<Git.GitConflictUpdateResult[]> {
|
|
4491
|
+
|
|
4492
|
+
return this.beginRequest<Git.GitConflictUpdateResult[]>({
|
|
4493
|
+
apiVersion: "7.2-preview.1",
|
|
4494
|
+
method: "PATCH",
|
|
4495
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}/conflicts/{conflictId}",
|
|
4496
|
+
routeValues: {
|
|
4497
|
+
project: project,
|
|
4498
|
+
repositoryId: repositoryId,
|
|
4499
|
+
revertId: revertId
|
|
4500
|
+
},
|
|
4501
|
+
body: conflictUpdates
|
|
4502
|
+
});
|
|
4503
|
+
}
|
|
4504
|
+
|
|
4505
|
+
/**
|
|
4506
|
+
* Starts the operation to create a new branch which reverts changes introduced by either a specific commit or commits that are associated to a pull request.
|
|
4507
|
+
*
|
|
4508
|
+
* @param revertToCreate -
|
|
4509
|
+
* @param project - Project ID or project name
|
|
4510
|
+
* @param repositoryId - ID of the repository.
|
|
4511
|
+
*/
|
|
4512
|
+
public async createRevert(
|
|
4513
|
+
revertToCreate: Git.GitAsyncRefOperationParameters,
|
|
4514
|
+
project: string,
|
|
4515
|
+
repositoryId: string
|
|
4516
|
+
): Promise<Git.GitRevert> {
|
|
4517
|
+
|
|
4518
|
+
return this.beginRequest<Git.GitRevert>({
|
|
4519
|
+
apiVersion: "7.2-preview.2",
|
|
4520
|
+
method: "POST",
|
|
4521
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}",
|
|
4522
|
+
routeValues: {
|
|
4523
|
+
project: project,
|
|
4524
|
+
repositoryId: repositoryId
|
|
4525
|
+
},
|
|
4526
|
+
body: revertToCreate
|
|
4527
|
+
});
|
|
4528
|
+
}
|
|
4529
|
+
|
|
4530
|
+
/**
|
|
4531
|
+
* Retrieve information about a revert operation by revert Id.
|
|
4532
|
+
*
|
|
4533
|
+
* @param project - Project ID or project name
|
|
4534
|
+
* @param revertId - ID of the revert operation.
|
|
4535
|
+
* @param repositoryId - ID of the repository.
|
|
4536
|
+
*/
|
|
4537
|
+
public async getRevert(
|
|
4538
|
+
project: string,
|
|
4539
|
+
revertId: number,
|
|
4540
|
+
repositoryId: string
|
|
4541
|
+
): Promise<Git.GitRevert> {
|
|
4542
|
+
|
|
4543
|
+
return this.beginRequest<Git.GitRevert>({
|
|
4544
|
+
apiVersion: "7.2-preview.2",
|
|
4545
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}",
|
|
4546
|
+
routeValues: {
|
|
4547
|
+
project: project,
|
|
4548
|
+
revertId: revertId,
|
|
4549
|
+
repositoryId: repositoryId
|
|
4550
|
+
}
|
|
4551
|
+
});
|
|
4552
|
+
}
|
|
4553
|
+
|
|
4554
|
+
/**
|
|
4555
|
+
* Retrieve information about a revert operation for a specific branch.
|
|
4556
|
+
*
|
|
4557
|
+
* @param project - Project ID or project name
|
|
4558
|
+
* @param repositoryId - ID of the repository.
|
|
4559
|
+
* @param refName - The GitAsyncRefOperationParameters generatedRefName used for the revert operation.
|
|
4560
|
+
*/
|
|
4561
|
+
public async getRevertForRefName(
|
|
4562
|
+
project: string,
|
|
4563
|
+
repositoryId: string,
|
|
4564
|
+
refName: string
|
|
4565
|
+
): Promise<Git.GitRevert> {
|
|
4566
|
+
|
|
4567
|
+
const queryValues: any = {
|
|
4568
|
+
refName: refName
|
|
4569
|
+
};
|
|
4570
|
+
|
|
4571
|
+
return this.beginRequest<Git.GitRevert>({
|
|
4572
|
+
apiVersion: "7.2-preview.2",
|
|
4573
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}",
|
|
4574
|
+
routeValues: {
|
|
4575
|
+
project: project,
|
|
4576
|
+
repositoryId: repositoryId
|
|
4577
|
+
},
|
|
4578
|
+
queryParams: queryValues
|
|
4579
|
+
});
|
|
4580
|
+
}
|
|
4581
|
+
|
|
4582
|
+
/**
|
|
4583
|
+
* Create Git commit status.
|
|
4584
|
+
*
|
|
4585
|
+
* @param gitCommitStatusToCreate - Git commit status object to create.
|
|
4586
|
+
* @param commitId - ID of the Git commit.
|
|
4587
|
+
* @param repositoryId - ID of the repository.
|
|
4588
|
+
* @param project - Project ID or project name
|
|
4589
|
+
*/
|
|
4590
|
+
public async createCommitStatus(
|
|
4591
|
+
gitCommitStatusToCreate: Git.GitStatus,
|
|
4592
|
+
commitId: string,
|
|
4593
|
+
repositoryId: string,
|
|
4594
|
+
project?: string
|
|
4595
|
+
): Promise<Git.GitStatus> {
|
|
4596
|
+
|
|
4597
|
+
return this.beginRequest<Git.GitStatus>({
|
|
4598
|
+
apiVersion: "7.2-preview.2",
|
|
4599
|
+
method: "POST",
|
|
4600
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/Statuses",
|
|
4601
|
+
routeValues: {
|
|
4602
|
+
project: project,
|
|
4603
|
+
commitId: commitId,
|
|
4604
|
+
repositoryId: repositoryId
|
|
4605
|
+
},
|
|
4606
|
+
body: gitCommitStatusToCreate
|
|
4607
|
+
});
|
|
4608
|
+
}
|
|
4609
|
+
|
|
4610
|
+
/**
|
|
4611
|
+
* Get statuses associated with the Git commit.
|
|
4612
|
+
*
|
|
4613
|
+
* @param commitId - ID of the Git commit.
|
|
4614
|
+
* @param repositoryId - ID of the repository.
|
|
4615
|
+
* @param project - Project ID or project name
|
|
4616
|
+
* @param top - Optional. The number of statuses to retrieve. Default is 1000.
|
|
4617
|
+
* @param skip - Optional. The number of statuses to ignore. Default is 0. For example, to retrieve results 101-150, set top to 50 and skip to 100.
|
|
4618
|
+
* @param latestOnly - The flag indicates whether to get only latest statuses grouped by \`Context.Name\` and \`Context.Genre\`.
|
|
4619
|
+
*/
|
|
4620
|
+
public async getStatuses(
|
|
4621
|
+
commitId: string,
|
|
4622
|
+
repositoryId: string,
|
|
4623
|
+
project?: string,
|
|
4624
|
+
top?: number,
|
|
4625
|
+
skip?: number,
|
|
4626
|
+
latestOnly?: boolean
|
|
4627
|
+
): Promise<Git.GitStatus[]> {
|
|
4628
|
+
|
|
4629
|
+
const queryValues: any = {
|
|
4630
|
+
top: top,
|
|
4631
|
+
skip: skip,
|
|
4632
|
+
latestOnly: latestOnly
|
|
4633
|
+
};
|
|
4634
|
+
|
|
4635
|
+
return this.beginRequest<Git.GitStatus[]>({
|
|
4636
|
+
apiVersion: "7.2-preview.2",
|
|
4637
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/Statuses",
|
|
4638
|
+
routeValues: {
|
|
4639
|
+
project: project,
|
|
4640
|
+
commitId: commitId,
|
|
4641
|
+
repositoryId: repositoryId
|
|
4642
|
+
},
|
|
4643
|
+
queryParams: queryValues
|
|
4644
|
+
});
|
|
4645
|
+
}
|
|
4646
|
+
|
|
4647
|
+
/**
|
|
4648
|
+
* Retrieve a pull request suggestion for a particular repository or team project.
|
|
4649
|
+
*
|
|
4650
|
+
* @param repositoryId - ID of the git repository.
|
|
4651
|
+
* @param project - Project ID or project name
|
|
4652
|
+
* @param preferCompareBranch - If true, prefer the compare branch over the default branch as target branch for pull requests.
|
|
4653
|
+
*/
|
|
4654
|
+
public async getSuggestions(
|
|
4655
|
+
repositoryId: string,
|
|
4656
|
+
project?: string,
|
|
4657
|
+
preferCompareBranch?: boolean
|
|
4658
|
+
): Promise<Git.GitSuggestion[]> {
|
|
4659
|
+
|
|
4660
|
+
const queryValues: any = {
|
|
4661
|
+
preferCompareBranch: preferCompareBranch
|
|
4662
|
+
};
|
|
4663
|
+
|
|
4664
|
+
return this.beginRequest<Git.GitSuggestion[]>({
|
|
4665
|
+
apiVersion: "7.2-preview.1",
|
|
4666
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/suggestions",
|
|
4667
|
+
routeValues: {
|
|
4668
|
+
project: project,
|
|
4669
|
+
repositoryId: repositoryId
|
|
4670
|
+
},
|
|
4671
|
+
queryParams: queryValues
|
|
4672
|
+
});
|
|
4673
|
+
}
|
|
4674
|
+
|
|
4675
|
+
/**
|
|
4676
|
+
* The Tree endpoint returns the collection of objects underneath the specified tree. Trees are folders in a Git repository.
|
|
4677
|
+
*
|
|
4678
|
+
* @param repositoryId - Repository Id.
|
|
4679
|
+
* @param sha1 - SHA1 hash of the tree object.
|
|
4680
|
+
* @param project - Project ID or project name
|
|
4681
|
+
* @param projectId - Project Id.
|
|
4682
|
+
* @param recursive - Search recursively. Include trees underneath this tree. Default is false.
|
|
4683
|
+
* @param fileName - Name to use if a .zip file is returned. Default is the object ID.
|
|
4684
|
+
*/
|
|
4685
|
+
public async getTree(
|
|
4686
|
+
repositoryId: string,
|
|
4687
|
+
sha1: string,
|
|
4688
|
+
project?: string,
|
|
4689
|
+
projectId?: string,
|
|
4690
|
+
recursive?: boolean,
|
|
4691
|
+
fileName?: string
|
|
4692
|
+
): Promise<Git.GitTreeRef> {
|
|
4693
|
+
|
|
4694
|
+
const queryValues: any = {
|
|
4695
|
+
projectId: projectId,
|
|
4696
|
+
recursive: recursive,
|
|
4697
|
+
fileName: fileName
|
|
4698
|
+
};
|
|
4699
|
+
|
|
4700
|
+
return this.beginRequest<Git.GitTreeRef>({
|
|
4701
|
+
apiVersion: "7.2-preview.1",
|
|
4702
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Trees/{sha1}",
|
|
4703
|
+
routeValues: {
|
|
4704
|
+
project: project,
|
|
4705
|
+
repositoryId: repositoryId,
|
|
4706
|
+
sha1: sha1
|
|
4707
|
+
},
|
|
4708
|
+
queryParams: queryValues
|
|
4709
|
+
});
|
|
4710
|
+
}
|
|
4711
|
+
|
|
4712
|
+
/**
|
|
4713
|
+
* The Tree endpoint returns the collection of objects underneath the specified tree. Trees are folders in a Git repository.
|
|
4714
|
+
*
|
|
4715
|
+
* @param repositoryId - Repository Id.
|
|
4716
|
+
* @param sha1 - SHA1 hash of the tree object.
|
|
4717
|
+
* @param project - Project ID or project name
|
|
4718
|
+
* @param projectId - Project Id.
|
|
4719
|
+
* @param recursive - Search recursively. Include trees underneath this tree. Default is false.
|
|
4720
|
+
* @param fileName - Name to use if a .zip file is returned. Default is the object ID.
|
|
4721
|
+
*/
|
|
4722
|
+
public async getTreeZip(
|
|
4723
|
+
repositoryId: string,
|
|
4724
|
+
sha1: string,
|
|
4725
|
+
project?: string,
|
|
4726
|
+
projectId?: string,
|
|
4727
|
+
recursive?: boolean,
|
|
4728
|
+
fileName?: string
|
|
4729
|
+
): Promise<ArrayBuffer> {
|
|
4730
|
+
|
|
4731
|
+
const queryValues: any = {
|
|
4732
|
+
projectId: projectId,
|
|
4733
|
+
recursive: recursive,
|
|
4734
|
+
fileName: fileName
|
|
4735
|
+
};
|
|
4736
|
+
|
|
4737
|
+
return this.beginRequest<ArrayBuffer>({
|
|
4738
|
+
apiVersion: "7.2-preview.1",
|
|
4739
|
+
httpResponseType: "application/zip",
|
|
4740
|
+
routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Trees/{sha1}",
|
|
4741
|
+
routeValues: {
|
|
4742
|
+
project: project,
|
|
4743
|
+
repositoryId: repositoryId,
|
|
4744
|
+
sha1: sha1
|
|
4745
|
+
},
|
|
4746
|
+
queryParams: queryValues
|
|
4747
|
+
});
|
|
4748
|
+
}
|
|
4749
|
+
|
|
4750
|
+
}
|