azure-devops-extension-api 4.270.0 → 5.272.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.
Files changed (699) hide show
  1. package/Accounts/Accounts.d.ts +126 -126
  2. package/Accounts/Accounts.js +61 -62
  3. package/Accounts/Accounts.min.js +1 -1
  4. package/Accounts/AccountsClient.d.ts +24 -24
  5. package/Accounts/AccountsClient.js +78 -124
  6. package/Accounts/AccountsClient.min.js +1 -1
  7. package/Accounts/index.d.ts +2 -2
  8. package/Accounts/index.js +18 -9
  9. package/Accounts/index.min.js +1 -1
  10. package/AdvancedSecurity.Reporting/Reporting.d.ts +717 -717
  11. package/AdvancedSecurity.Reporting/Reporting.js +203 -204
  12. package/AdvancedSecurity.Reporting/Reporting.min.js +1 -1
  13. package/AdvancedSecurity.Reporting/ReportingClient.d.ts +83 -83
  14. package/AdvancedSecurity.Reporting/ReportingClient.js +267 -343
  15. package/AdvancedSecurity.Reporting/ReportingClient.min.js +1 -1
  16. package/Alert/Alert.d.ts +1272 -1265
  17. package/Alert/Alert.js +425 -426
  18. package/Alert/Alert.min.js +1 -1
  19. package/Alert/AlertClient.d.ts +201 -159
  20. package/Alert/AlertClient.js +558 -533
  21. package/Alert/AlertClient.min.js +1 -1
  22. package/Build/Build.d.ts +3318 -3292
  23. package/Build/Build.js +613 -607
  24. package/Build/Build.min.js +1 -1
  25. package/Build/BuildClient.d.ts +842 -820
  26. package/Build/BuildClient.js +2319 -2568
  27. package/Build/BuildClient.min.js +1 -1
  28. package/Build/BuildServices.d.ts +32 -32
  29. package/Build/BuildServices.js +13 -14
  30. package/Build/BuildServices.min.js +1 -1
  31. package/Build/index.d.ts +3 -3
  32. package/Build/index.js +19 -10
  33. package/Build/index.min.js +1 -1
  34. package/Comments/Comments.d.ts +309 -309
  35. package/Comments/Comments.js +93 -94
  36. package/Comments/Comments.min.js +1 -1
  37. package/Comments/index.d.ts +1 -1
  38. package/Comments/index.js +17 -8
  39. package/Comments/index.min.js +1 -1
  40. package/Common/Client.d.ts +9 -9
  41. package/Common/Client.js +25 -26
  42. package/Common/Client.min.js +1 -1
  43. package/Common/CommonServices.d.ts +774 -735
  44. package/Common/CommonServices.js +71 -72
  45. package/Common/CommonServices.min.js +1 -1
  46. package/Common/Context.js +2 -0
  47. package/Common/Fetch.d.ts +95 -95
  48. package/Common/Fetch.js +131 -168
  49. package/Common/Fetch.min.js +1 -1
  50. package/Common/RestClientBase.d.ts +96 -96
  51. package/Common/RestClientBase.js +109 -139
  52. package/Common/RestClientBase.min.js +1 -1
  53. package/Common/System.d.ts +30 -30
  54. package/Common/System.js +39 -40
  55. package/Common/System.min.js +1 -1
  56. package/Common/SystemData.d.ts +129 -129
  57. package/Common/SystemData.js +138 -139
  58. package/Common/SystemData.min.js +1 -1
  59. package/Common/Util/Serialization.d.ts +15 -15
  60. package/Common/Util/Serialization.js +51 -53
  61. package/Common/Util/Serialization.min.js +1 -1
  62. package/Common/Util/Url.d.ts +238 -236
  63. package/Common/Util/Url.js +605 -626
  64. package/Common/Util/Url.min.js +1 -1
  65. package/Common/index.d.ts +3 -3
  66. package/Common/index.js +19 -9
  67. package/Common/index.min.js +1 -1
  68. package/Contributions/Contributions.d.ts +694 -694
  69. package/Contributions/Contributions.js +185 -186
  70. package/Contributions/Contributions.min.js +1 -1
  71. package/Contributions/ContributionsClient.d.ts +31 -31
  72. package/Contributions/ContributionsClient.js +99 -147
  73. package/Contributions/ContributionsClient.min.js +1 -1
  74. package/Contributions/index.d.ts +2 -2
  75. package/Contributions/index.js +18 -9
  76. package/Contributions/index.min.js +1 -1
  77. package/Core/Core.d.ts +546 -546
  78. package/Core/Core.js +79 -80
  79. package/Core/Core.min.js +1 -1
  80. package/Core/CoreClient.d.ts +224 -224
  81. package/Core/CoreClient.js +652 -777
  82. package/Core/CoreClient.min.js +1 -1
  83. package/Core/index.d.ts +2 -2
  84. package/Core/index.js +18 -9
  85. package/Core/index.min.js +1 -1
  86. package/Dashboard/Dashboard.d.ts +393 -393
  87. package/Dashboard/Dashboard.js +56 -57
  88. package/Dashboard/Dashboard.min.js +1 -1
  89. package/Dashboard/DashboardClient.d.ts +106 -106
  90. package/Dashboard/DashboardClient.js +317 -393
  91. package/Dashboard/DashboardClient.min.js +1 -1
  92. package/Dashboard/WidgetConfigHelpers.d.ts +34 -34
  93. package/Dashboard/WidgetConfigHelpers.js +41 -45
  94. package/Dashboard/WidgetConfigHelpers.min.js +1 -1
  95. package/Dashboard/WidgetContracts.d.ts +213 -213
  96. package/Dashboard/WidgetContracts.js +24 -25
  97. package/Dashboard/WidgetContracts.min.js +1 -1
  98. package/Dashboard/WidgetHelpers.d.ts +89 -89
  99. package/Dashboard/WidgetHelpers.js +135 -146
  100. package/Dashboard/WidgetHelpers.min.js +1 -1
  101. package/Dashboard/index.d.ts +5 -5
  102. package/Dashboard/index.js +21 -12
  103. package/Dashboard/index.min.js +1 -1
  104. package/DistributedTaskCommon/DistributedTaskCommon.d.ts +103 -103
  105. package/DistributedTaskCommon/DistributedTaskCommon.js +7 -9
  106. package/DistributedTaskCommon/DistributedTaskCommon.min.js +1 -1
  107. package/DistributedTaskCommon/index.d.ts +1 -1
  108. package/DistributedTaskCommon/index.js +17 -4
  109. package/DistributedTaskCommon/index.min.js +1 -1
  110. package/ExtensionManagement/ExtensionManagement.d.ts +1163 -1163
  111. package/ExtensionManagement/ExtensionManagement.js +284 -285
  112. package/ExtensionManagement/ExtensionManagement.min.js +1 -1
  113. package/ExtensionManagement/ExtensionManagementClient.d.ts +191 -191
  114. package/ExtensionManagement/ExtensionManagementClient.js +551 -648
  115. package/ExtensionManagement/ExtensionManagementClient.min.js +1 -1
  116. package/ExtensionManagement/index.d.ts +2 -2
  117. package/ExtensionManagement/index.js +18 -9
  118. package/ExtensionManagement/index.min.js +1 -1
  119. package/Favorite/Favorite.d.ts +124 -124
  120. package/Favorite/Favorite.js +7 -9
  121. package/Favorite/Favorite.min.js +1 -1
  122. package/Favorite/FavoriteClient.d.ts +78 -78
  123. package/Favorite/FavoriteClient.js +247 -314
  124. package/Favorite/FavoriteClient.min.js +1 -1
  125. package/FeatureAvailability/FeatureAvailability.d.ts +13 -13
  126. package/FeatureAvailability/FeatureAvailability.js +7 -9
  127. package/FeatureAvailability/FeatureAvailability.min.js +1 -1
  128. package/FeatureAvailability/FeatureAvailabilityClient.d.ts +45 -45
  129. package/FeatureAvailability/FeatureAvailabilityClient.js +136 -189
  130. package/FeatureAvailability/FeatureAvailabilityClient.min.js +1 -1
  131. package/FeatureAvailability/index.d.ts +2 -2
  132. package/FeatureAvailability/index.js +18 -8
  133. package/FeatureAvailability/index.min.js +1 -1
  134. package/FeatureManagement/FeatureManagement.d.ts +161 -161
  135. package/FeatureManagement/FeatureManagement.js +26 -27
  136. package/FeatureManagement/FeatureManagement.min.js +1 -1
  137. package/FeatureManagement/FeatureManagementClient.d.ts +78 -78
  138. package/FeatureManagement/FeatureManagementClient.js +214 -273
  139. package/FeatureManagement/FeatureManagementClient.min.js +1 -1
  140. package/FeatureManagement/index.d.ts +2 -2
  141. package/FeatureManagement/index.js +18 -9
  142. package/FeatureManagement/index.min.js +1 -1
  143. package/FileContainer/FileContainer.d.ts +193 -193
  144. package/FileContainer/FileContainer.js +58 -59
  145. package/FileContainer/FileContainer.min.js +1 -1
  146. package/FileContainer/FileContainerClient.d.ts +47 -47
  147. package/FileContainer/FileContainerClient.js +132 -182
  148. package/FileContainer/FileContainerClient.min.js +1 -1
  149. package/FileContainer/index.d.ts +2 -2
  150. package/FileContainer/index.js +18 -9
  151. package/FileContainer/index.min.js +1 -1
  152. package/FormInput/FormInput.d.ts +278 -278
  153. package/FormInput/FormInput.js +77 -78
  154. package/FormInput/FormInput.min.js +1 -1
  155. package/FormInput/index.d.ts +1 -1
  156. package/FormInput/index.js +17 -8
  157. package/FormInput/index.min.js +1 -1
  158. package/Gallery/Gallery.d.ts +1911 -1911
  159. package/Gallery/Gallery.js +788 -789
  160. package/Gallery/Gallery.min.js +1 -1
  161. package/Gallery/GalleryClient.d.ts +612 -603
  162. package/Gallery/GalleryClient.js +1882 -2100
  163. package/Gallery/GalleryClient.min.js +1 -1
  164. package/Gallery/index.d.ts +2 -2
  165. package/Gallery/index.js +18 -9
  166. package/Gallery/index.min.js +1 -1
  167. package/Git/CodeEditorTypes.d.ts +305 -305
  168. package/Git/CodeEditorTypes.js +27 -28
  169. package/Git/CodeEditorTypes.min.js +1 -1
  170. package/Git/Git.d.ts +3976 -4071
  171. package/Git/Git.js +830 -839
  172. package/Git/Git.min.js +1 -1
  173. package/Git/GitClient.d.ts +1468 -1466
  174. package/Git/GitClient.js +3892 -4347
  175. package/Git/GitClient.min.js +1 -1
  176. package/Git/GitServices.d.ts +16 -16
  177. package/Git/GitServices.js +10 -11
  178. package/Git/GitServices.min.js +1 -1
  179. package/Git/index.d.ts +4 -4
  180. package/Git/index.js +20 -11
  181. package/Git/index.min.js +1 -1
  182. package/Graph/Graph.d.ts +518 -518
  183. package/Graph/Graph.js +14 -15
  184. package/Graph/Graph.min.js +1 -1
  185. package/Graph/GraphClient.d.ts +261 -261
  186. package/Graph/GraphClient.js +737 -867
  187. package/Graph/GraphClient.min.js +1 -1
  188. package/Graph/index.d.ts +2 -2
  189. package/Graph/index.js +18 -9
  190. package/Graph/index.min.js +1 -1
  191. package/Identities/Identities.d.ts +242 -242
  192. package/Identities/Identities.js +49 -50
  193. package/Identities/Identities.min.js +1 -1
  194. package/Identities/IdentityProvider.d.ts +40 -40
  195. package/Identities/IdentityProvider.js +47 -49
  196. package/Identities/IdentityProvider.min.js +1 -1
  197. package/Identities/IdentityService.d.ts +72 -72
  198. package/Identities/IdentityService.js +13 -14
  199. package/Identities/IdentityService.min.js +1 -1
  200. package/Identities/index.d.ts +3 -3
  201. package/Identities/index.js +19 -10
  202. package/Identities/index.min.js +1 -1
  203. package/Locations/Locations.d.ts +150 -150
  204. package/Locations/Locations.js +28 -29
  205. package/Locations/Locations.min.js +1 -1
  206. package/Locations/LocationsClient.d.ts +65 -65
  207. package/Locations/LocationsClient.js +211 -276
  208. package/Locations/LocationsClient.min.js +1 -1
  209. package/Locations/index.d.ts +2 -2
  210. package/Locations/index.js +18 -9
  211. package/Locations/index.min.js +1 -1
  212. package/Management/Management.d.ts +424 -407
  213. package/Management/Management.js +27 -28
  214. package/Management/Management.min.js +1 -1
  215. package/Management/ManagementClient.d.ts +137 -105
  216. package/Management/ManagementClient.js +413 -398
  217. package/Management/ManagementClient.min.js +1 -1
  218. package/Notification/Notification.d.ts +1387 -1387
  219. package/Notification/Notification.js +385 -386
  220. package/Notification/Notification.min.js +1 -1
  221. package/Notification/NotificationClient.d.ts +149 -149
  222. package/Notification/NotificationClient.js +420 -511
  223. package/Notification/NotificationClient.min.js +1 -1
  224. package/Notification/index.d.ts +2 -2
  225. package/Notification/index.js +18 -9
  226. package/Notification/index.min.js +1 -1
  227. package/Operations/Operations.d.ts +77 -77
  228. package/Operations/Operations.js +38 -39
  229. package/Operations/Operations.min.js +1 -1
  230. package/Operations/OperationsClient.d.ts +13 -13
  231. package/Operations/OperationsClient.js +45 -86
  232. package/Operations/OperationsClient.min.js +1 -1
  233. package/Operations/index.d.ts +2 -2
  234. package/Operations/index.js +18 -9
  235. package/Operations/index.min.js +1 -1
  236. package/Pipelines/Pipelines.d.ts +342 -341
  237. package/Pipelines/Pipelines.js +82 -83
  238. package/Pipelines/Pipelines.min.js +1 -1
  239. package/Pipelines/PipelinesClient.d.ts +92 -92
  240. package/Pipelines/PipelinesClient.js +260 -325
  241. package/Pipelines/PipelinesClient.min.js +1 -1
  242. package/Policy/Policy.d.ts +160 -160
  243. package/Policy/Policy.js +38 -39
  244. package/Policy/Policy.min.js +1 -1
  245. package/Policy/PolicyClient.d.ts +99 -99
  246. package/Policy/PolicyClient.js +274 -346
  247. package/Policy/PolicyClient.min.js +1 -1
  248. package/Policy/index.d.ts +2 -2
  249. package/Policy/index.js +18 -9
  250. package/Policy/index.min.js +1 -1
  251. package/Profile/Profile.d.ts +175 -175
  252. package/Profile/Profile.js +35 -36
  253. package/Profile/Profile.min.js +1 -1
  254. package/Profile/ProfileClient.d.ts +86 -86
  255. package/Profile/ProfileClient.js +277 -347
  256. package/Profile/ProfileClient.min.js +1 -1
  257. package/Profile/index.d.ts +2 -2
  258. package/Profile/index.js +18 -9
  259. package/Profile/index.min.js +1 -1
  260. package/ProjectAnalysis/ProjectAnalysis.d.ts +59 -59
  261. package/ProjectAnalysis/ProjectAnalysis.js +18 -19
  262. package/ProjectAnalysis/ProjectAnalysis.min.js +1 -1
  263. package/ProjectAnalysis/ProjectAnalysisClient.d.ts +34 -34
  264. package/ProjectAnalysis/ProjectAnalysisClient.js +110 -159
  265. package/ProjectAnalysis/ProjectAnalysisClient.min.js +1 -1
  266. package/ProjectAnalysis/index.d.ts +2 -2
  267. package/ProjectAnalysis/index.js +18 -9
  268. package/ProjectAnalysis/index.min.js +1 -1
  269. package/README.md +57 -1
  270. package/Release/Release.d.ts +4068 -4068
  271. package/Release/Release.js +876 -877
  272. package/Release/Release.min.js +1 -1
  273. package/Release/ReleaseClient.d.ts +720 -720
  274. package/Release/ReleaseClient.js +2003 -2273
  275. package/Release/ReleaseClient.min.js +1 -1
  276. package/Release/index.d.ts +2 -2
  277. package/Release/index.js +18 -9
  278. package/Release/index.min.js +1 -1
  279. package/ResourceUsage/ResourceUsage.d.ts +13 -13
  280. package/ResourceUsage/ResourceUsage.js +7 -9
  281. package/ResourceUsage/ResourceUsage.min.js +1 -1
  282. package/ResourceUsage/ResourceUsageClient.d.ts +20 -20
  283. package/ResourceUsage/ResourceUsageClient.js +51 -93
  284. package/ResourceUsage/ResourceUsageClient.min.js +1 -1
  285. package/ServiceEndpoint/ServiceEndpoint.d.ts +894 -894
  286. package/ServiceEndpoint/ServiceEndpoint.js +84 -85
  287. package/ServiceEndpoint/ServiceEndpoint.min.js +1 -1
  288. package/ServiceEndpoint/ServiceEndpointClient.d.ts +190 -190
  289. package/ServiceEndpoint/ServiceEndpointClient.js +556 -669
  290. package/ServiceEndpoint/ServiceEndpointClient.min.js +1 -1
  291. package/ServiceEndpoint/index.d.ts +2 -2
  292. package/ServiceEndpoint/index.js +18 -9
  293. package/ServiceEndpoint/index.min.js +1 -1
  294. package/ServiceHooks/ServiceHooks.d.ts +762 -758
  295. package/ServiceHooks/ServiceHooks.js +114 -115
  296. package/ServiceHooks/ServiceHooks.min.js +1 -1
  297. package/ServiceHooks/ServiceHooksClient.d.ts +156 -156
  298. package/ServiceHooks/ServiceHooksClient.js +434 -526
  299. package/ServiceHooks/ServiceHooksClient.min.js +1 -1
  300. package/ServiceHooks/index.d.ts +2 -2
  301. package/ServiceHooks/index.js +18 -9
  302. package/ServiceHooks/index.min.js +1 -1
  303. package/TaskAgent/TaskAgent.d.ts +3777 -3777
  304. package/TaskAgent/TaskAgent.js +594 -594
  305. package/TaskAgent/TaskAgent.min.js +1 -1
  306. package/TaskAgent/TaskAgentClient.d.ts +1085 -1073
  307. package/TaskAgent/TaskAgentClient.js +3273 -3731
  308. package/TaskAgent/TaskAgentClient.min.js +1 -1
  309. package/TaskAgent/index.d.ts +2 -2
  310. package/TaskAgent/index.js +18 -9
  311. package/TaskAgent/index.min.js +1 -1
  312. package/Test/Test.d.ts +5918 -5874
  313. package/Test/Test.js +1068 -1069
  314. package/Test/Test.min.js +1 -1
  315. package/Test/TestClient.d.ts +635 -635
  316. package/Test/TestClient.js +1822 -2088
  317. package/Test/TestClient.min.js +1 -1
  318. package/Test/index.d.ts +2 -2
  319. package/Test/index.js +18 -9
  320. package/Test/index.min.js +1 -1
  321. package/TestPlan/TestPlan.d.ts +1616 -1616
  322. package/TestPlan/TestPlan.js +270 -271
  323. package/TestPlan/TestPlan.min.js +1 -1
  324. package/TestPlan/TestPlanClient.d.ts +408 -408
  325. package/TestPlan/TestPlanClient.js +1160 -1387
  326. package/TestPlan/TestPlanClient.min.js +1 -1
  327. package/TestPlan/index.d.ts +2 -2
  328. package/TestPlan/index.js +18 -9
  329. package/TestPlan/index.min.js +1 -1
  330. package/TestResults/TestResults.d.ts +5 -5
  331. package/TestResults/TestResults.js +7 -9
  332. package/TestResults/TestResults.min.js +1 -1
  333. package/TestResults/TestResultsClient.d.ts +1060 -1039
  334. package/TestResults/TestResultsClient.js +3099 -3491
  335. package/TestResults/TestResultsClient.min.js +1 -1
  336. package/TestResults/index.d.ts +2 -2
  337. package/TestResults/index.js +18 -8
  338. package/TestResults/index.min.js +1 -1
  339. package/Tfvc/Tfvc.d.ts +773 -730
  340. package/Tfvc/Tfvc.js +151 -107
  341. package/Tfvc/Tfvc.min.js +1 -1
  342. package/Tfvc/TfvcClient.d.ts +227 -227
  343. package/Tfvc/TfvcClient.js +620 -732
  344. package/Tfvc/TfvcClient.min.js +1 -1
  345. package/Tfvc/index.d.ts +2 -2
  346. package/Tfvc/index.js +18 -9
  347. package/Tfvc/index.min.js +1 -1
  348. package/WebApi/WebApi.d.ts +408 -408
  349. package/WebApi/WebApi.js +55 -56
  350. package/WebApi/WebApi.min.js +1 -1
  351. package/WebApi/index.d.ts +1 -1
  352. package/WebApi/index.js +17 -8
  353. package/WebApi/index.min.js +1 -1
  354. package/Wiki/Wiki.d.ts +328 -328
  355. package/Wiki/Wiki.js +22 -23
  356. package/Wiki/Wiki.min.js +1 -1
  357. package/Wiki/WikiClient.d.ts +218 -218
  358. package/Wiki/WikiClient.js +585 -684
  359. package/Wiki/WikiClient.min.js +1 -1
  360. package/Wiki/index.d.ts +2 -2
  361. package/Wiki/index.js +18 -9
  362. package/Wiki/index.min.js +1 -1
  363. package/Work/Work.d.ts +1298 -1298
  364. package/Work/Work.js +187 -188
  365. package/Work/Work.min.js +1 -1
  366. package/Work/WorkClient.d.ts +421 -421
  367. package/Work/WorkClient.js +1255 -1455
  368. package/Work/WorkClient.min.js +1 -1
  369. package/Work/index.d.ts +2 -2
  370. package/Work/index.js +18 -9
  371. package/Work/index.min.js +1 -1
  372. package/WorkItemTracking/WorkItemTracking.d.ts +2158 -2158
  373. package/WorkItemTracking/WorkItemTracking.js +431 -432
  374. package/WorkItemTracking/WorkItemTracking.min.js +1 -1
  375. package/WorkItemTracking/WorkItemTrackingClient.d.ts +624 -624
  376. package/WorkItemTracking/WorkItemTrackingClient.js +1688 -1918
  377. package/WorkItemTracking/WorkItemTrackingClient.min.js +1 -1
  378. package/WorkItemTracking/WorkItemTrackingServices.d.ts +320 -320
  379. package/WorkItemTracking/WorkItemTrackingServices.js +18 -19
  380. package/WorkItemTracking/WorkItemTrackingServices.min.js +1 -1
  381. package/WorkItemTracking/index.d.ts +3 -3
  382. package/WorkItemTracking/index.js +19 -10
  383. package/WorkItemTracking/index.min.js +1 -1
  384. package/WorkItemTrackingProcess/WorkItemTrackingProcess.d.ts +1238 -1238
  385. package/WorkItemTrackingProcess/WorkItemTrackingProcess.js +299 -300
  386. package/WorkItemTrackingProcess/WorkItemTrackingProcess.min.js +1 -1
  387. package/WorkItemTrackingProcess/WorkItemTrackingProcessClient.d.ts +462 -462
  388. package/WorkItemTrackingProcess/WorkItemTrackingProcessClient.js +1224 -1386
  389. package/WorkItemTrackingProcess/WorkItemTrackingProcessClient.min.js +1 -1
  390. package/WorkItemTrackingProcess/index.d.ts +2 -2
  391. package/WorkItemTrackingProcess/index.js +18 -9
  392. package/WorkItemTrackingProcess/index.min.js +1 -1
  393. package/WorkItemTrackingProcessDefinitions/WorkItemTrackingProcessDefinitions.d.ts +575 -575
  394. package/WorkItemTrackingProcessDefinitions/WorkItemTrackingProcessDefinitions.js +96 -97
  395. package/WorkItemTrackingProcessDefinitions/WorkItemTrackingProcessDefinitions.min.js +1 -1
  396. package/WorkItemTrackingProcessDefinitions/WorkItemTrackingProcessDefinitionsClient.d.ts +376 -376
  397. package/WorkItemTrackingProcessDefinitions/WorkItemTrackingProcessDefinitionsClient.js +991 -1126
  398. package/WorkItemTrackingProcessDefinitions/WorkItemTrackingProcessDefinitionsClient.min.js +1 -1
  399. package/WorkItemTrackingProcessDefinitions/index.d.ts +2 -2
  400. package/WorkItemTrackingProcessDefinitions/index.js +18 -9
  401. package/WorkItemTrackingProcessDefinitions/index.min.js +1 -1
  402. package/_manifest/Spdx2xVs3xComparisonToolOutput.json +4 -4
  403. package/_manifest/spdx_2.2/ESRPClientLogs0512212427548.json +1 -0
  404. package/_manifest/spdx_2.2/bsi.cose +0 -0
  405. package/_manifest/spdx_2.2/bsi.json +1 -1
  406. package/_manifest/spdx_2.2/manifest.cat +0 -0
  407. package/_manifest/spdx_2.2/manifest.spdx.cose +0 -0
  408. package/_manifest/spdx_2.2/manifest.spdx.json +1 -1
  409. package/_manifest/spdx_2.2/manifest.spdx.json.sha256 +1 -1
  410. package/_manifest/spdx_3.0/manifest.spdx.json +1 -1
  411. package/_manifest/spdx_3.0/manifest.spdx.json.sha256 +1 -1
  412. package/esm/Accounts/Accounts.js +58 -0
  413. package/esm/Accounts/Accounts.min.js +1 -0
  414. package/esm/Accounts/AccountsClient.js +59 -0
  415. package/esm/Accounts/AccountsClient.min.js +1 -0
  416. package/esm/Accounts/index.js +2 -0
  417. package/esm/Accounts/index.min.js +1 -0
  418. package/esm/AdvancedSecurity.Reporting/Reporting.js +200 -0
  419. package/esm/AdvancedSecurity.Reporting/Reporting.min.js +1 -0
  420. package/esm/AdvancedSecurity.Reporting/ReportingClient.js +228 -0
  421. package/esm/AdvancedSecurity.Reporting/ReportingClient.min.js +1 -0
  422. package/esm/Alert/Alert.js +422 -0
  423. package/esm/Alert/Alert.min.js +1 -0
  424. package/esm/Alert/AlertClient.js +499 -0
  425. package/esm/Alert/AlertClient.min.js +1 -0
  426. package/esm/Build/Build.js +610 -0
  427. package/esm/Build/Build.min.js +1 -0
  428. package/esm/Build/BuildClient.js +2108 -0
  429. package/esm/Build/BuildClient.min.js +1 -0
  430. package/esm/Build/BuildServices.js +10 -0
  431. package/esm/Build/BuildServices.min.js +1 -0
  432. package/esm/Build/index.js +3 -0
  433. package/esm/Build/index.min.js +1 -0
  434. package/esm/Comments/Comments.js +90 -0
  435. package/esm/Comments/Comments.min.js +1 -0
  436. package/esm/Comments/index.js +1 -0
  437. package/esm/Comments/index.min.js +1 -0
  438. package/esm/Common/Client.js +22 -0
  439. package/esm/Common/Client.min.js +1 -0
  440. package/esm/Common/CommonServices.js +68 -0
  441. package/esm/Common/CommonServices.min.js +1 -0
  442. package/esm/Common/Context.js +1 -0
  443. package/esm/Common/Fetch.js +117 -0
  444. package/esm/Common/Fetch.min.js +1 -0
  445. package/esm/Common/RestClientBase.js +92 -0
  446. package/esm/Common/RestClientBase.min.js +1 -0
  447. package/esm/Common/System.js +36 -0
  448. package/esm/Common/System.min.js +1 -0
  449. package/esm/Common/SystemData.js +135 -0
  450. package/esm/Common/SystemData.min.js +1 -0
  451. package/esm/Common/Util/Serialization.js +48 -0
  452. package/esm/Common/Util/Serialization.min.js +1 -0
  453. package/esm/Common/Util/Url.js +595 -0
  454. package/esm/Common/Util/Url.min.js +1 -0
  455. package/esm/Common/index.js +3 -0
  456. package/esm/Common/index.min.js +1 -0
  457. package/esm/Contributions/Contributions.js +182 -0
  458. package/esm/Contributions/Contributions.min.js +1 -0
  459. package/esm/Contributions/ContributionsClient.js +78 -0
  460. package/esm/Contributions/ContributionsClient.min.js +1 -0
  461. package/esm/Contributions/index.js +2 -0
  462. package/esm/Contributions/index.min.js +1 -0
  463. package/esm/Core/Core.js +76 -0
  464. package/esm/Core/Core.min.js +1 -0
  465. package/esm/Core/CoreClient.js +573 -0
  466. package/esm/Core/CoreClient.min.js +1 -0
  467. package/esm/Core/index.js +2 -0
  468. package/esm/Core/index.min.js +1 -0
  469. package/esm/Dashboard/Dashboard.js +53 -0
  470. package/esm/Dashboard/Dashboard.min.js +1 -0
  471. package/esm/Dashboard/DashboardClient.js +278 -0
  472. package/esm/Dashboard/DashboardClient.min.js +1 -0
  473. package/esm/Dashboard/WidgetConfigHelpers.js +37 -0
  474. package/esm/Dashboard/WidgetConfigHelpers.min.js +1 -0
  475. package/esm/Dashboard/WidgetContracts.js +21 -0
  476. package/esm/Dashboard/WidgetContracts.min.js +1 -0
  477. package/esm/Dashboard/WidgetHelpers.js +129 -0
  478. package/esm/Dashboard/WidgetHelpers.min.js +1 -0
  479. package/esm/Dashboard/index.js +5 -0
  480. package/esm/Dashboard/index.min.js +1 -0
  481. package/esm/DistributedTaskCommon/DistributedTaskCommon.js +6 -0
  482. package/esm/DistributedTaskCommon/DistributedTaskCommon.min.js +1 -0
  483. package/esm/DistributedTaskCommon/index.js +1 -0
  484. package/esm/DistributedTaskCommon/index.min.js +1 -0
  485. package/esm/ExtensionManagement/ExtensionManagement.js +281 -0
  486. package/esm/ExtensionManagement/ExtensionManagement.min.js +1 -0
  487. package/esm/ExtensionManagement/ExtensionManagementClient.js +486 -0
  488. package/esm/ExtensionManagement/ExtensionManagementClient.min.js +1 -0
  489. package/esm/ExtensionManagement/index.js +2 -0
  490. package/esm/ExtensionManagement/index.min.js +1 -0
  491. package/esm/Favorite/Favorite.js +6 -0
  492. package/esm/Favorite/Favorite.min.js +1 -0
  493. package/esm/Favorite/FavoriteClient.js +214 -0
  494. package/esm/Favorite/FavoriteClient.min.js +1 -0
  495. package/esm/FeatureAvailability/FeatureAvailability.js +6 -0
  496. package/esm/FeatureAvailability/FeatureAvailability.min.js +1 -0
  497. package/esm/FeatureAvailability/FeatureAvailabilityClient.js +113 -0
  498. package/esm/FeatureAvailability/FeatureAvailabilityClient.min.js +1 -0
  499. package/esm/FeatureAvailability/index.js +2 -0
  500. package/esm/FeatureAvailability/index.min.js +1 -0
  501. package/esm/FeatureManagement/FeatureManagement.js +23 -0
  502. package/esm/FeatureManagement/FeatureManagement.min.js +1 -0
  503. package/esm/FeatureManagement/FeatureManagementClient.js +183 -0
  504. package/esm/FeatureManagement/FeatureManagementClient.min.js +1 -0
  505. package/esm/FeatureManagement/index.js +2 -0
  506. package/esm/FeatureManagement/index.min.js +1 -0
  507. package/esm/FileContainer/FileContainer.js +55 -0
  508. package/esm/FileContainer/FileContainer.min.js +1 -0
  509. package/esm/FileContainer/FileContainerClient.js +111 -0
  510. package/esm/FileContainer/FileContainerClient.min.js +1 -0
  511. package/esm/FileContainer/index.js +2 -0
  512. package/esm/FileContainer/index.min.js +1 -0
  513. package/esm/FormInput/FormInput.js +74 -0
  514. package/esm/FormInput/FormInput.min.js +1 -0
  515. package/esm/FormInput/index.js +1 -0
  516. package/esm/FormInput/index.min.js +1 -0
  517. package/esm/Gallery/Gallery.js +785 -0
  518. package/esm/Gallery/Gallery.min.js +1 -0
  519. package/esm/Gallery/GalleryClient.js +1699 -0
  520. package/esm/Gallery/GalleryClient.min.js +1 -0
  521. package/esm/Gallery/index.js +2 -0
  522. package/esm/Gallery/index.min.js +1 -0
  523. package/esm/Git/CodeEditorTypes.js +24 -0
  524. package/esm/Git/CodeEditorTypes.min.js +1 -0
  525. package/esm/Git/Git.js +827 -0
  526. package/esm/Git/Git.min.js +1 -0
  527. package/esm/Git/GitClient.js +3571 -0
  528. package/esm/Git/GitClient.min.js +1 -0
  529. package/esm/Git/GitServices.js +7 -0
  530. package/esm/Git/GitServices.min.js +1 -0
  531. package/esm/Git/index.js +4 -0
  532. package/esm/Git/index.min.js +1 -0
  533. package/esm/Graph/Graph.js +11 -0
  534. package/esm/Graph/Graph.min.js +1 -0
  535. package/esm/Graph/GraphClient.js +644 -0
  536. package/esm/Graph/GraphClient.min.js +1 -0
  537. package/esm/Graph/index.js +2 -0
  538. package/esm/Graph/index.min.js +1 -0
  539. package/esm/Identities/Identities.js +46 -0
  540. package/esm/Identities/Identities.min.js +1 -0
  541. package/esm/Identities/IdentityProvider.js +43 -0
  542. package/esm/Identities/IdentityProvider.min.js +1 -0
  543. package/esm/Identities/IdentityService.js +10 -0
  544. package/esm/Identities/IdentityService.min.js +1 -0
  545. package/esm/Identities/index.js +3 -0
  546. package/esm/Identities/index.min.js +1 -0
  547. package/esm/Locations/Locations.js +25 -0
  548. package/esm/Locations/Locations.min.js +1 -0
  549. package/esm/Locations/LocationsClient.js +178 -0
  550. package/esm/Locations/LocationsClient.min.js +1 -0
  551. package/esm/Locations/index.js +2 -0
  552. package/esm/Locations/index.min.js +1 -0
  553. package/esm/Management/Management.js +24 -0
  554. package/esm/Management/Management.min.js +1 -0
  555. package/esm/Management/ManagementClient.js +358 -0
  556. package/esm/Management/ManagementClient.min.js +1 -0
  557. package/esm/Notification/Notification.js +382 -0
  558. package/esm/Notification/Notification.min.js +1 -0
  559. package/esm/Notification/NotificationClient.js +359 -0
  560. package/esm/Notification/NotificationClient.min.js +1 -0
  561. package/esm/Notification/index.js +2 -0
  562. package/esm/Notification/index.min.js +1 -0
  563. package/esm/Operations/Operations.js +35 -0
  564. package/esm/Operations/Operations.min.js +1 -0
  565. package/esm/Operations/OperationsClient.js +30 -0
  566. package/esm/Operations/OperationsClient.min.js +1 -0
  567. package/esm/Operations/index.js +2 -0
  568. package/esm/Operations/index.min.js +1 -0
  569. package/esm/Pipelines/Pipelines.js +79 -0
  570. package/esm/Pipelines/Pipelines.min.js +1 -0
  571. package/esm/Pipelines/PipelinesClient.js +227 -0
  572. package/esm/Pipelines/PipelinesClient.min.js +1 -0
  573. package/esm/Policy/Policy.js +35 -0
  574. package/esm/Policy/Policy.min.js +1 -0
  575. package/esm/Policy/PolicyClient.js +237 -0
  576. package/esm/Policy/PolicyClient.min.js +1 -0
  577. package/esm/Policy/index.js +2 -0
  578. package/esm/Policy/index.min.js +1 -0
  579. package/esm/Profile/Profile.js +32 -0
  580. package/esm/Profile/Profile.min.js +1 -0
  581. package/esm/Profile/ProfileClient.js +240 -0
  582. package/esm/Profile/ProfileClient.min.js +1 -0
  583. package/esm/Profile/index.js +2 -0
  584. package/esm/Profile/index.min.js +1 -0
  585. package/esm/ProjectAnalysis/ProjectAnalysis.js +15 -0
  586. package/esm/ProjectAnalysis/ProjectAnalysis.min.js +1 -0
  587. package/esm/ProjectAnalysis/ProjectAnalysisClient.js +89 -0
  588. package/esm/ProjectAnalysis/ProjectAnalysisClient.min.js +1 -0
  589. package/esm/ProjectAnalysis/index.js +2 -0
  590. package/esm/ProjectAnalysis/index.min.js +1 -0
  591. package/esm/Release/Release.js +873 -0
  592. package/esm/Release/Release.min.js +1 -0
  593. package/esm/Release/ReleaseClient.js +1816 -0
  594. package/esm/Release/ReleaseClient.min.js +1 -0
  595. package/esm/Release/index.js +2 -0
  596. package/esm/Release/index.min.js +1 -0
  597. package/esm/ResourceUsage/ResourceUsage.js +6 -0
  598. package/esm/ResourceUsage/ResourceUsage.min.js +1 -0
  599. package/esm/ResourceUsage/ResourceUsageClient.js +34 -0
  600. package/esm/ResourceUsage/ResourceUsageClient.min.js +1 -0
  601. package/esm/ServiceEndpoint/ServiceEndpoint.js +81 -0
  602. package/esm/ServiceEndpoint/ServiceEndpoint.min.js +1 -0
  603. package/esm/ServiceEndpoint/ServiceEndpointClient.js +489 -0
  604. package/esm/ServiceEndpoint/ServiceEndpointClient.min.js +1 -0
  605. package/esm/ServiceEndpoint/index.js +2 -0
  606. package/esm/ServiceEndpoint/index.min.js +1 -0
  607. package/esm/ServiceHooks/ServiceHooks.js +111 -0
  608. package/esm/ServiceHooks/ServiceHooks.min.js +1 -0
  609. package/esm/ServiceHooks/ServiceHooksClient.js +375 -0
  610. package/esm/ServiceHooks/ServiceHooksClient.min.js +1 -0
  611. package/esm/ServiceHooks/index.js +2 -0
  612. package/esm/ServiceHooks/index.min.js +1 -0
  613. package/esm/TaskAgent/TaskAgent.js +590 -0
  614. package/esm/TaskAgent/TaskAgent.min.js +1 -0
  615. package/esm/TaskAgent/TaskAgentClient.js +2946 -0
  616. package/esm/TaskAgent/TaskAgentClient.min.js +1 -0
  617. package/esm/TaskAgent/index.js +2 -0
  618. package/esm/TaskAgent/index.min.js +1 -0
  619. package/esm/Test/Test.js +1065 -0
  620. package/esm/Test/Test.min.js +1 -0
  621. package/esm/Test/TestClient.js +1655 -0
  622. package/esm/Test/TestClient.min.js +1 -0
  623. package/esm/Test/index.js +2 -0
  624. package/esm/Test/index.min.js +1 -0
  625. package/esm/TestPlan/TestPlan.js +267 -0
  626. package/esm/TestPlan/TestPlan.min.js +1 -0
  627. package/esm/TestPlan/TestPlanClient.js +1051 -0
  628. package/esm/TestPlan/TestPlanClient.min.js +1 -0
  629. package/esm/TestPlan/index.js +2 -0
  630. package/esm/TestPlan/index.min.js +1 -0
  631. package/esm/TestResults/TestResults.js +6 -0
  632. package/esm/TestResults/TestResults.min.js +1 -0
  633. package/esm/TestResults/TestResultsClient.js +2822 -0
  634. package/esm/TestResults/TestResultsClient.min.js +1 -0
  635. package/esm/TestResults/index.js +2 -0
  636. package/esm/TestResults/index.min.js +1 -0
  637. package/esm/Tfvc/Tfvc.js +148 -0
  638. package/esm/Tfvc/Tfvc.min.js +1 -0
  639. package/esm/Tfvc/TfvcClient.js +559 -0
  640. package/esm/Tfvc/TfvcClient.min.js +1 -0
  641. package/esm/Tfvc/index.js +2 -0
  642. package/esm/Tfvc/index.min.js +1 -0
  643. package/esm/WebApi/WebApi.js +52 -0
  644. package/esm/WebApi/WebApi.min.js +1 -0
  645. package/esm/WebApi/index.js +1 -0
  646. package/esm/WebApi/index.min.js +1 -0
  647. package/esm/Wiki/Wiki.js +19 -0
  648. package/esm/Wiki/Wiki.min.js +1 -0
  649. package/esm/Wiki/WikiClient.js +528 -0
  650. package/esm/Wiki/WikiClient.min.js +1 -0
  651. package/esm/Wiki/index.js +2 -0
  652. package/esm/Wiki/index.min.js +1 -0
  653. package/esm/Work/Work.js +184 -0
  654. package/esm/Work/Work.min.js +1 -0
  655. package/esm/Work/WorkClient.js +1128 -0
  656. package/esm/Work/WorkClient.min.js +1 -0
  657. package/esm/Work/index.js +2 -0
  658. package/esm/Work/index.min.js +1 -0
  659. package/esm/WorkItemTracking/WorkItemTracking.js +428 -0
  660. package/esm/WorkItemTracking/WorkItemTracking.min.js +1 -0
  661. package/esm/WorkItemTracking/WorkItemTrackingClient.js +1525 -0
  662. package/esm/WorkItemTracking/WorkItemTrackingClient.min.js +1 -0
  663. package/esm/WorkItemTracking/WorkItemTrackingServices.js +15 -0
  664. package/esm/WorkItemTracking/WorkItemTrackingServices.min.js +1 -0
  665. package/esm/WorkItemTracking/index.js +3 -0
  666. package/esm/WorkItemTracking/index.min.js +1 -0
  667. package/esm/WorkItemTrackingProcess/WorkItemTrackingProcess.js +296 -0
  668. package/esm/WorkItemTrackingProcess/WorkItemTrackingProcess.min.js +1 -0
  669. package/esm/WorkItemTrackingProcess/WorkItemTrackingProcessClient.js +1097 -0
  670. package/esm/WorkItemTrackingProcess/WorkItemTrackingProcessClient.min.js +1 -0
  671. package/esm/WorkItemTrackingProcess/index.js +2 -0
  672. package/esm/WorkItemTrackingProcess/index.min.js +1 -0
  673. package/esm/WorkItemTrackingProcessDefinitions/WorkItemTrackingProcessDefinitions.js +93 -0
  674. package/esm/WorkItemTrackingProcessDefinitions/WorkItemTrackingProcessDefinitions.min.js +1 -0
  675. package/esm/WorkItemTrackingProcessDefinitions/WorkItemTrackingProcessDefinitionsClient.js +886 -0
  676. package/esm/WorkItemTrackingProcessDefinitions/WorkItemTrackingProcessDefinitionsClient.min.js +1 -0
  677. package/esm/WorkItemTrackingProcessDefinitions/index.js +2 -0
  678. package/esm/WorkItemTrackingProcessDefinitions/index.min.js +1 -0
  679. package/esm/index.js +1 -0
  680. package/esm/index.min.js +1 -0
  681. package/index.d.ts +1 -1
  682. package/index.js +17 -8
  683. package/index.min.js +1 -1
  684. package/package.json +232 -37
  685. package/Boards/Boards.d.ts +0 -631
  686. package/Boards/Boards.js +0 -26
  687. package/Boards/Boards.min.js +0 -1
  688. package/Boards/BoardsClient.d.ts +0 -187
  689. package/Boards/BoardsClient.js +0 -589
  690. package/Boards/BoardsClient.min.js +0 -1
  691. package/Boards/index.d.ts +0 -2
  692. package/Boards/index.js +0 -9
  693. package/Boards/index.min.js +0 -1
  694. package/_manifest/spdx_2.2/ESRPClientLogs0331143549591.json +0 -1
  695. package/_manifest/spdx_3.0/ESRPClientLogs0331143549461.json +0 -1
  696. package/_manifest/spdx_3.0/bsi.cose +0 -0
  697. package/_manifest/spdx_3.0/bsi.json +0 -1
  698. package/_manifest/spdx_3.0/manifest.cat +0 -0
  699. package/_manifest/spdx_3.0/manifest.spdx.cose +0 -0
@@ -0,0 +1,3571 @@
1
+ /*
2
+ * ---------------------------------------------------------
3
+ * Copyright(C) Microsoft Corporation. All rights reserved.
4
+ * ---------------------------------------------------------
5
+ */
6
+ import { RestClientBase } from "../Common/RestClientBase";
7
+ import { deserializeVssJsonObject } from "../Common/Util/Serialization";
8
+ export class GitRestClient extends RestClientBase {
9
+ constructor(options) {
10
+ super(options);
11
+ }
12
+ /**
13
+ * DELETE Deletes Enablement status and BillableCommitters data from DB. Deleting the enablement data will effectively disable it for the repositories affected.
14
+ *
15
+ * @param allProjects -
16
+ * @param includeBillableCommitters -
17
+ * @param projectIds -
18
+ */
19
+ async deleteEnablementStatus(allProjects, includeBillableCommitters, projectIds) {
20
+ const queryValues = {
21
+ '$allProjects': allProjects,
22
+ '$includeBillableCommitters': includeBillableCommitters,
23
+ projectIds: projectIds
24
+ };
25
+ return this.beginRequest({
26
+ apiVersion: "7.2-preview.1",
27
+ method: "DELETE",
28
+ routeTemplate: "_apis/git/advsecEnablement",
29
+ queryParams: queryValues
30
+ });
31
+ }
32
+ /**
33
+ * GET Enablement status for project's repositories.
34
+ *
35
+ * @param projectIds - Null defaults to all projects in the host, list of project's repos status to return
36
+ * @param billingDate - UTC expected, Null defaults to UtcNow(), can be provided for a point in time status
37
+ * @param skip - Skip X rows of resultset to simulate paging.
38
+ * @param take - Return Y rows of resultset to simulate paging.
39
+ */
40
+ async getEnablementStatus(projectIds, billingDate, skip, take) {
41
+ const queryValues = {
42
+ projectIds: projectIds,
43
+ '$billingDate': billingDate,
44
+ '$skip': skip,
45
+ '$take': take
46
+ };
47
+ return this.beginRequest({
48
+ apiVersion: "7.2-preview.1",
49
+ routeTemplate: "_apis/git/advsecEnablement",
50
+ queryParams: queryValues
51
+ });
52
+ }
53
+ /**
54
+ * @param enableOnCreateHost -
55
+ */
56
+ async getEnableOnCreateHost(enableOnCreateHost) {
57
+ const queryValues = {
58
+ '$enableOnCreateHost': enableOnCreateHost
59
+ };
60
+ return this.beginRequest({
61
+ apiVersion: "7.2-preview.1",
62
+ routeTemplate: "_apis/git/advsecEnablement",
63
+ queryParams: queryValues
64
+ });
65
+ }
66
+ /**
67
+ * @param enableOnCreateProjectId -
68
+ */
69
+ async getEnableOnCreateProject(enableOnCreateProjectId) {
70
+ const queryValues = {
71
+ '$enableOnCreateProjectId': enableOnCreateProjectId
72
+ };
73
+ return this.beginRequest({
74
+ apiVersion: "7.2-preview.1",
75
+ routeTemplate: "_apis/git/advsecEnablement",
76
+ queryParams: queryValues
77
+ });
78
+ }
79
+ /**
80
+ * @param enableOnCreateHost -
81
+ */
82
+ async setEnableOnCreateHost(enableOnCreateHost) {
83
+ const queryValues = {
84
+ '$enableOnCreateHost': enableOnCreateHost
85
+ };
86
+ return this.beginRequest({
87
+ apiVersion: "7.2-preview.1",
88
+ method: "PUT",
89
+ routeTemplate: "_apis/git/advsecEnablement",
90
+ queryParams: queryValues
91
+ });
92
+ }
93
+ /**
94
+ * @param enableOnCreateProjectId -
95
+ * @param enableOnStatus -
96
+ */
97
+ async setEnableOnCreateProject(enableOnCreateProjectId, enableOnStatus) {
98
+ const queryValues = {
99
+ '$enableOnCreateProjectId': enableOnCreateProjectId,
100
+ '$enableOnStatus': enableOnStatus
101
+ };
102
+ return this.beginRequest({
103
+ apiVersion: "7.2-preview.1",
104
+ method: "PUT",
105
+ routeTemplate: "_apis/git/advsecEnablement",
106
+ queryParams: queryValues
107
+ });
108
+ }
109
+ /**
110
+ * POST Enablement status for repositories.
111
+ *
112
+ * @param enablementUpdates -
113
+ */
114
+ async updateEnablementStatus(enablementUpdates) {
115
+ return this.beginRequest({
116
+ apiVersion: "7.2-preview.1",
117
+ method: "POST",
118
+ routeTemplate: "_apis/git/advsecEnablement",
119
+ body: enablementUpdates
120
+ });
121
+ }
122
+ /**
123
+ * Get estimated billable pushers for an Organization for last 90 days.
124
+ *
125
+ */
126
+ async getEstimatedBillablePushersOrg() {
127
+ return this.beginRequest({
128
+ apiVersion: "7.2-preview.1",
129
+ routeTemplate: "_apis/git/advsecEstimate"
130
+ });
131
+ }
132
+ /**
133
+ * Get estimated billable pushers for a project for last 90 days.
134
+ *
135
+ * @param project - Project ID or project name
136
+ */
137
+ async getEstimatedBillablePushersProject(project) {
138
+ return this.beginRequest({
139
+ apiVersion: "7.2-preview.1",
140
+ routeTemplate: "{project}/_apis/git/advsecEstimate",
141
+ routeValues: {
142
+ project: project
143
+ }
144
+ });
145
+ }
146
+ /**
147
+ * Get estimated billable committers for a repository for the last 90 days.
148
+ *
149
+ * @param project - Project ID or project name
150
+ * @param repositoryId -
151
+ */
152
+ async getEstimatedBillableCommittersRepo(project, repositoryId) {
153
+ return this.beginRequest({
154
+ apiVersion: "7.2-preview.1",
155
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/advsecEstimate",
156
+ routeValues: {
157
+ project: project,
158
+ repositoryId: repositoryId
159
+ }
160
+ });
161
+ }
162
+ /**
163
+ * GET Advanced Security Permission status.
164
+ *
165
+ * @param projectName -
166
+ * @param repositoryId - Repository user is trying to access
167
+ * @param permission - Permission being requestd, must be "viewAlert" "dismissAlert" "manage" "viewEnablement" or "repoRead"
168
+ */
169
+ async getPermission(projectName, repositoryId, permission) {
170
+ const queryValues = {
171
+ '$projectName': projectName,
172
+ '$repositoryId': repositoryId,
173
+ '$permission': permission
174
+ };
175
+ return this.beginRequest({
176
+ apiVersion: "7.2-preview.1",
177
+ routeTemplate: "_apis/git/advsecPermissions",
178
+ queryParams: queryValues
179
+ });
180
+ }
181
+ /**
182
+ * POST request to get accessible repositories based on permission (batch operation).
183
+ *
184
+ * @param request - Request containing permission and repository IDs to check
185
+ */
186
+ async getAccessibleRepositories(request) {
187
+ return this.beginRequest({
188
+ apiVersion: "7.2-preview.1",
189
+ method: "POST",
190
+ routeTemplate: "_apis/git/advsecPermissions/RepositoriesBatch",
191
+ body: request
192
+ });
193
+ }
194
+ /**
195
+ * Create an annotated tag.
196
+ *
197
+ * @param tagObject - Object containing details of tag to be created.
198
+ * @param project - Project ID or project name
199
+ * @param repositoryId - ID or name of the repository.
200
+ */
201
+ async createAnnotatedTag(tagObject, project, repositoryId) {
202
+ return this.beginRequest({
203
+ apiVersion: "7.2-preview.1",
204
+ method: "POST",
205
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/annotatedTags/{objectId}",
206
+ routeValues: {
207
+ project: project,
208
+ repositoryId: repositoryId
209
+ },
210
+ body: tagObject
211
+ });
212
+ }
213
+ /**
214
+ * Get an annotated tag.
215
+ *
216
+ * @param project - Project ID or project name
217
+ * @param repositoryId - ID or name of the repository.
218
+ * @param objectId - ObjectId (Sha1Id) of tag to get.
219
+ */
220
+ async getAnnotatedTag(project, repositoryId, objectId) {
221
+ return this.beginRequest({
222
+ apiVersion: "7.2-preview.1",
223
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/annotatedTags/{objectId}",
224
+ routeValues: {
225
+ project: project,
226
+ repositoryId: repositoryId,
227
+ objectId: objectId
228
+ }
229
+ });
230
+ }
231
+ /**
232
+ * Retrieve actual billable committers for Advanced Security service for a given date.
233
+ *
234
+ * @param project - Project ID or project name
235
+ * @param billingDate - UTC expected. If not specified defaults to the previous billing day.
236
+ * @param skip - Skip X rows of resultset to simulate paging.
237
+ * @param take - Return Y rows of resultset to simulate paging.
238
+ */
239
+ async getBillableCommitters(project, billingDate, skip, take) {
240
+ const queryValues = {
241
+ '$billingDate': billingDate,
242
+ '$skip': skip,
243
+ '$take': take
244
+ };
245
+ return this.beginRequest({
246
+ apiVersion: "7.2-preview.1",
247
+ routeTemplate: "{project}/_apis/git/billableCommitters",
248
+ routeValues: {
249
+ project: project
250
+ },
251
+ queryParams: queryValues
252
+ });
253
+ }
254
+ /**
255
+ * 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.
256
+ *
257
+ * @param project - Project ID or project name
258
+ * @param includeDetails - Return all the details on the billable committers.
259
+ * @param billingDate - UTC expected. If not specified defaults to the previous billing day.
260
+ */
261
+ async getBillableCommittersDetail(project, includeDetails, billingDate) {
262
+ const queryValues = {
263
+ '$includeDetails': includeDetails,
264
+ '$billingDate': billingDate
265
+ };
266
+ return this.beginRequest({
267
+ apiVersion: "7.2-preview.1",
268
+ routeTemplate: "{project}/_apis/git/billableCommitters",
269
+ routeValues: {
270
+ project: project
271
+ },
272
+ queryParams: queryValues
273
+ });
274
+ }
275
+ /**
276
+ * Get a single blob.
277
+ *
278
+ * @param repositoryId - The name or ID of the repository.
279
+ * @param sha1 - SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint.
280
+ * @param project - Project ID or project name
281
+ * @param download - If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip
282
+ * @param fileName - Provide a fileName to use for a download.
283
+ * @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
284
+ */
285
+ async getBlob(repositoryId, sha1, project, download, fileName, resolveLfs) {
286
+ const queryValues = {
287
+ download: download,
288
+ fileName: fileName,
289
+ resolveLfs: resolveLfs
290
+ };
291
+ return this.beginRequest({
292
+ apiVersion: "7.2-preview.1",
293
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Blobs/{sha1}",
294
+ routeValues: {
295
+ project: project,
296
+ repositoryId: repositoryId,
297
+ sha1: sha1
298
+ },
299
+ queryParams: queryValues
300
+ });
301
+ }
302
+ /**
303
+ * Get a single blob.
304
+ *
305
+ * @param repositoryId - The name or ID of the repository.
306
+ * @param sha1 - SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint.
307
+ * @param project - Project ID or project name
308
+ * @param download - If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip
309
+ * @param fileName - Provide a fileName to use for a download.
310
+ * @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
311
+ */
312
+ async getBlobContent(repositoryId, sha1, project, download, fileName, resolveLfs) {
313
+ const queryValues = {
314
+ download: download,
315
+ fileName: fileName,
316
+ resolveLfs: resolveLfs
317
+ };
318
+ return this.beginRequest({
319
+ apiVersion: "7.2-preview.1",
320
+ httpResponseType: "application/octet-stream",
321
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Blobs/{sha1}",
322
+ routeValues: {
323
+ project: project,
324
+ repositoryId: repositoryId,
325
+ sha1: sha1
326
+ },
327
+ queryParams: queryValues
328
+ });
329
+ }
330
+ /**
331
+ * Gets one or more blobs in a zip file download.
332
+ *
333
+ * @param blobIds - Blob IDs (SHA1 hashes) to be returned in the zip file.
334
+ * @param repositoryId - The name or ID of the repository.
335
+ * @param project - Project ID or project name
336
+ * @param filename -
337
+ */
338
+ async getBlobsZip(blobIds, repositoryId, project, filename) {
339
+ const queryValues = {
340
+ filename: filename
341
+ };
342
+ return this.beginRequest({
343
+ apiVersion: "7.2-preview.1",
344
+ method: "POST",
345
+ httpResponseType: "application/zip",
346
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Blobs/{sha1}",
347
+ routeValues: {
348
+ project: project,
349
+ repositoryId: repositoryId
350
+ },
351
+ queryParams: queryValues,
352
+ body: blobIds
353
+ });
354
+ }
355
+ /**
356
+ * Get a single blob.
357
+ *
358
+ * @param repositoryId - The name or ID of the repository.
359
+ * @param sha1 - SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint.
360
+ * @param project - Project ID or project name
361
+ * @param download - If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip
362
+ * @param fileName - Provide a fileName to use for a download.
363
+ * @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
364
+ */
365
+ async getBlobZip(repositoryId, sha1, project, download, fileName, resolveLfs) {
366
+ const queryValues = {
367
+ download: download,
368
+ fileName: fileName,
369
+ resolveLfs: resolveLfs
370
+ };
371
+ return this.beginRequest({
372
+ apiVersion: "7.2-preview.1",
373
+ httpResponseType: "application/zip",
374
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Blobs/{sha1}",
375
+ routeValues: {
376
+ project: project,
377
+ repositoryId: repositoryId,
378
+ sha1: sha1
379
+ },
380
+ queryParams: queryValues
381
+ });
382
+ }
383
+ /**
384
+ * Retrieve statistics about a single branch.
385
+ *
386
+ * @param repositoryId - The name or ID of the repository.
387
+ * @param name - Name of the branch.
388
+ * @param project - Project ID or project name
389
+ * @param baseVersionDescriptor - Identifies the commit or branch to use as the base.
390
+ */
391
+ async getBranch(repositoryId, name, project, baseVersionDescriptor) {
392
+ const queryValues = {
393
+ name: name,
394
+ baseVersionDescriptor: baseVersionDescriptor
395
+ };
396
+ return this.beginRequest({
397
+ apiVersion: "7.2-preview.2",
398
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/stats/branches",
399
+ routeValues: {
400
+ project: project,
401
+ repositoryId: repositoryId
402
+ },
403
+ queryParams: queryValues
404
+ });
405
+ }
406
+ /**
407
+ * Retrieve statistics about all branches within a repository.
408
+ *
409
+ * @param repositoryId - The name or ID of the repository.
410
+ * @param project - Project ID or project name
411
+ * @param baseVersionDescriptor - Identifies the commit or branch to use as the base.
412
+ */
413
+ async getBranches(repositoryId, project, baseVersionDescriptor) {
414
+ const queryValues = {
415
+ baseVersionDescriptor: baseVersionDescriptor
416
+ };
417
+ return this.beginRequest({
418
+ apiVersion: "7.2-preview.2",
419
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/stats/branches",
420
+ routeValues: {
421
+ project: project,
422
+ repositoryId: repositoryId
423
+ },
424
+ queryParams: queryValues
425
+ });
426
+ }
427
+ /**
428
+ * Retrieve statistics for multiple commits
429
+ *
430
+ * @param searchCriteria - Base Commit and List of Target Commits to compare.
431
+ * @param repositoryId - The name or ID of the repository.
432
+ * @param project - Project ID or project name
433
+ */
434
+ async getBranchStatsBatch(searchCriteria, repositoryId, project) {
435
+ return this.beginRequest({
436
+ apiVersion: "7.2-preview.2",
437
+ method: "POST",
438
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/stats/branches",
439
+ routeValues: {
440
+ project: project,
441
+ repositoryId: repositoryId
442
+ },
443
+ body: searchCriteria
444
+ });
445
+ }
446
+ /**
447
+ * Retrieve changes for a particular commit.
448
+ *
449
+ * @param commitId - The id of the commit.
450
+ * @param repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified.
451
+ * @param project - Project ID or project name
452
+ * @param top - The maximum number of changes to return.
453
+ * @param skip - The number of changes to skip.
454
+ */
455
+ async getChanges(commitId, repositoryId, project, top, skip) {
456
+ const queryValues = {
457
+ top: top,
458
+ skip: skip
459
+ };
460
+ return this.beginRequest({
461
+ apiVersion: "7.2-preview.1",
462
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/Changes",
463
+ routeValues: {
464
+ project: project,
465
+ commitId: commitId,
466
+ repositoryId: repositoryId
467
+ },
468
+ queryParams: queryValues
469
+ });
470
+ }
471
+ /**
472
+ * Retrieve one conflict for a cherry pick by ID
473
+ *
474
+ * @param repositoryId -
475
+ * @param cherryPickId -
476
+ * @param conflictId -
477
+ * @param project - Project ID or project name
478
+ */
479
+ async getCherryPickConflict(repositoryId, cherryPickId, conflictId, project) {
480
+ return this.beginRequest({
481
+ apiVersion: "7.2-preview.1",
482
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}/conflicts/{conflictId}",
483
+ routeValues: {
484
+ project: project,
485
+ repositoryId: repositoryId,
486
+ cherryPickId: cherryPickId,
487
+ conflictId: conflictId
488
+ }
489
+ });
490
+ }
491
+ /**
492
+ * Retrieve all conflicts for a cherry pick
493
+ *
494
+ * @param repositoryId -
495
+ * @param cherryPickId -
496
+ * @param project - Project ID or project name
497
+ * @param continuationToken -
498
+ * @param top -
499
+ * @param excludeResolved -
500
+ * @param onlyResolved -
501
+ * @param includeObsolete -
502
+ */
503
+ async getCherryPickConflicts(repositoryId, cherryPickId, project, continuationToken, top, excludeResolved, onlyResolved, includeObsolete) {
504
+ const queryValues = {
505
+ continuationToken: continuationToken,
506
+ '$top': top,
507
+ excludeResolved: excludeResolved,
508
+ onlyResolved: onlyResolved,
509
+ includeObsolete: includeObsolete
510
+ };
511
+ return this.beginRequest({
512
+ apiVersion: "7.2-preview.1",
513
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}/conflicts/{conflictId}",
514
+ routeValues: {
515
+ project: project,
516
+ repositoryId: repositoryId,
517
+ cherryPickId: cherryPickId
518
+ },
519
+ queryParams: queryValues,
520
+ returnRawResponse: true
521
+ }).then(async (response) => {
522
+ const body = await response.text().then(deserializeVssJsonObject);
523
+ body.continuationToken = response.headers.get("x-ms-continuationtoken");
524
+ return body;
525
+ });
526
+ }
527
+ /**
528
+ * Update merge conflict resolution
529
+ *
530
+ * @param conflict -
531
+ * @param repositoryId -
532
+ * @param cherryPickId -
533
+ * @param conflictId -
534
+ * @param project - Project ID or project name
535
+ */
536
+ async updateCherryPickConflict(conflict, repositoryId, cherryPickId, conflictId, project) {
537
+ return this.beginRequest({
538
+ apiVersion: "7.2-preview.1",
539
+ method: "PATCH",
540
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}/conflicts/{conflictId}",
541
+ routeValues: {
542
+ project: project,
543
+ repositoryId: repositoryId,
544
+ cherryPickId: cherryPickId,
545
+ conflictId: conflictId
546
+ },
547
+ body: conflict
548
+ });
549
+ }
550
+ /**
551
+ * Update multiple merge conflict resolutions
552
+ *
553
+ * @param conflictUpdates -
554
+ * @param repositoryId -
555
+ * @param cherryPickId -
556
+ * @param project - Project ID or project name
557
+ */
558
+ async updateCherryPickConflicts(conflictUpdates, repositoryId, cherryPickId, project) {
559
+ return this.beginRequest({
560
+ apiVersion: "7.2-preview.1",
561
+ method: "PATCH",
562
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}/conflicts/{conflictId}",
563
+ routeValues: {
564
+ project: project,
565
+ repositoryId: repositoryId,
566
+ cherryPickId: cherryPickId
567
+ },
568
+ body: conflictUpdates
569
+ });
570
+ }
571
+ /**
572
+ * Given a commitId, returns a list of commits that are in the same cherry-pick family.
573
+ *
574
+ * @param repositoryNameOrId -
575
+ * @param commitId -
576
+ * @param project - Project ID or project name
577
+ * @param includeLinks -
578
+ */
579
+ async getCherryPickRelationships(repositoryNameOrId, commitId, project, includeLinks) {
580
+ const queryValues = {
581
+ includeLinks: includeLinks
582
+ };
583
+ return this.beginRequest({
584
+ apiVersion: "7.2-preview.1",
585
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/cherryPickRelationships/{commitId}",
586
+ routeValues: {
587
+ project: project,
588
+ repositoryNameOrId: repositoryNameOrId,
589
+ commitId: commitId
590
+ },
591
+ queryParams: queryValues
592
+ });
593
+ }
594
+ /**
595
+ * Cherry pick a specific commit or commits that are associated to a pull request into a new branch.
596
+ *
597
+ * @param cherryPickToCreate -
598
+ * @param project - Project ID or project name
599
+ * @param repositoryId - ID of the repository.
600
+ */
601
+ async createCherryPick(cherryPickToCreate, project, repositoryId) {
602
+ return this.beginRequest({
603
+ apiVersion: "7.2-preview.2",
604
+ method: "POST",
605
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}",
606
+ routeValues: {
607
+ project: project,
608
+ repositoryId: repositoryId
609
+ },
610
+ body: cherryPickToCreate
611
+ });
612
+ }
613
+ /**
614
+ * Retrieve information about a cherry pick operation by cherry pick Id.
615
+ *
616
+ * @param project - Project ID or project name
617
+ * @param cherryPickId - ID of the cherry pick.
618
+ * @param repositoryId - ID of the repository.
619
+ */
620
+ async getCherryPick(project, cherryPickId, repositoryId) {
621
+ return this.beginRequest({
622
+ apiVersion: "7.2-preview.2",
623
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}",
624
+ routeValues: {
625
+ project: project,
626
+ cherryPickId: cherryPickId,
627
+ repositoryId: repositoryId
628
+ }
629
+ });
630
+ }
631
+ /**
632
+ * 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.
633
+ *
634
+ * @param project - Project ID or project name
635
+ * @param repositoryId - ID of the repository.
636
+ * @param refName - The GitAsyncRefOperationParameters generatedRefName used for the cherry pick operation.
637
+ */
638
+ async getCherryPickForRefName(project, repositoryId, refName) {
639
+ const queryValues = {
640
+ refName: refName
641
+ };
642
+ return this.beginRequest({
643
+ apiVersion: "7.2-preview.2",
644
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/cherryPicks/{cherryPickId}",
645
+ routeValues: {
646
+ project: project,
647
+ repositoryId: repositoryId
648
+ },
649
+ queryParams: queryValues
650
+ });
651
+ }
652
+ /**
653
+ * 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.
654
+ *
655
+ * @param repositoryId - The name or ID of the repository.
656
+ * @param project - Project ID or project name
657
+ * @param diffCommonCommit - If true, diff between common and target commits. If false, diff between base and target commits.
658
+ * @param top - Maximum number of changes to return. Defaults to 100.
659
+ * @param skip - Number of changes to skip
660
+ * @param baseVersionDescriptor - Descriptor for base commit.
661
+ * @param targetVersionDescriptor - Descriptor for target commit.
662
+ */
663
+ async getCommitDiffs(repositoryId, project, diffCommonCommit, top, skip, baseVersionDescriptor, targetVersionDescriptor) {
664
+ const queryValues = {
665
+ diffCommonCommit: diffCommonCommit,
666
+ '$top': top,
667
+ '$skip': skip,
668
+ };
669
+ if (baseVersionDescriptor) {
670
+ queryValues.baseVersionType = baseVersionDescriptor.versionType;
671
+ queryValues.baseVersion = baseVersionDescriptor.version;
672
+ queryValues.baseVersionOptions = baseVersionDescriptor.versionOptions;
673
+ }
674
+ if (targetVersionDescriptor) {
675
+ queryValues.targetVersionType = targetVersionDescriptor.versionType;
676
+ queryValues.targetVersion = targetVersionDescriptor.version;
677
+ queryValues.targetVersionOptions = targetVersionDescriptor.versionOptions;
678
+ }
679
+ return this.beginRequest({
680
+ apiVersion: "7.2-preview.1",
681
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/diffs/commits",
682
+ routeValues: {
683
+ project: project,
684
+ repositoryId: repositoryId
685
+ },
686
+ queryParams: queryValues
687
+ });
688
+ }
689
+ /**
690
+ * Retrieve a particular commit.
691
+ *
692
+ * @param commitId - The id of the commit.
693
+ * @param repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified.
694
+ * @param project - Project ID or project name
695
+ * @param changeCount - The number of changes to include in the result.
696
+ */
697
+ async getCommit(commitId, repositoryId, project, changeCount) {
698
+ const queryValues = {
699
+ changeCount: changeCount
700
+ };
701
+ return this.beginRequest({
702
+ apiVersion: "7.2-preview.2",
703
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Commits/{commitId}",
704
+ routeValues: {
705
+ project: project,
706
+ commitId: commitId,
707
+ repositoryId: repositoryId
708
+ },
709
+ queryParams: queryValues
710
+ });
711
+ }
712
+ /**
713
+ * Retrieve git commits for a project
714
+ *
715
+ * @param repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified.
716
+ * @param searchCriteria -
717
+ * @param project - Project ID or project name
718
+ * @param skip -
719
+ * @param top -
720
+ */
721
+ async getCommits(repositoryId, searchCriteria, project, skip, top) {
722
+ const queryValues = {
723
+ searchCriteria: searchCriteria,
724
+ '$skip': skip,
725
+ '$top': top
726
+ };
727
+ return this.beginRequest({
728
+ apiVersion: "7.2-preview.2",
729
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Commits/{commitId}",
730
+ routeValues: {
731
+ project: project,
732
+ repositoryId: repositoryId
733
+ },
734
+ queryParams: queryValues
735
+ });
736
+ }
737
+ /**
738
+ * Retrieve a list of commits associated with a particular push.
739
+ *
740
+ * @param repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified.
741
+ * @param pushId - The id of the push.
742
+ * @param project - Project ID or project name
743
+ * @param top - The maximum number of commits to return ("get the top x commits").
744
+ * @param skip - The number of commits to skip.
745
+ * @param includeLinks - Set to false to avoid including REST Url links for resources. Defaults to true.
746
+ */
747
+ async getPushCommits(repositoryId, pushId, project, top, skip, includeLinks) {
748
+ const queryValues = {
749
+ pushId: pushId,
750
+ top: top,
751
+ skip: skip,
752
+ includeLinks: includeLinks
753
+ };
754
+ return this.beginRequest({
755
+ apiVersion: "7.2-preview.2",
756
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Commits/{commitId}",
757
+ routeValues: {
758
+ project: project,
759
+ repositoryId: repositoryId
760
+ },
761
+ queryParams: queryValues
762
+ });
763
+ }
764
+ /**
765
+ * Retrieve git commits for a project matching the search criteria
766
+ *
767
+ * @param searchCriteria - Search options
768
+ * @param repositoryId - The name or ID of the repository.
769
+ * @param project - Project ID or project name
770
+ * @param skip - Number of commits to skip. The value cannot exceed 3,000,000.
771
+ * @param top - Maximum number of commits to return. The value cannot exceed 50,000.
772
+ * @param includeStatuses - True to include additional commit status information.
773
+ */
774
+ async getCommitsBatch(searchCriteria, repositoryId, project, skip, top, includeStatuses) {
775
+ const queryValues = {
776
+ '$skip': skip,
777
+ '$top': top,
778
+ includeStatuses: includeStatuses
779
+ };
780
+ return this.beginRequest({
781
+ apiVersion: "7.2-preview.2",
782
+ method: "POST",
783
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/CommitsBatch",
784
+ routeValues: {
785
+ project: project,
786
+ repositoryId: repositoryId
787
+ },
788
+ queryParams: queryValues,
789
+ body: searchCriteria
790
+ });
791
+ }
792
+ /**
793
+ * Retrieve deleted git repositories.
794
+ *
795
+ * @param project - Project ID or project name
796
+ */
797
+ async getDeletedRepositories(project) {
798
+ return this.beginRequest({
799
+ apiVersion: "7.2-preview.1",
800
+ routeTemplate: "{project}/_apis/git/DeletedRepositories",
801
+ routeValues: {
802
+ project: project
803
+ }
804
+ });
805
+ }
806
+ /**
807
+ * Get the file diffs for each of the specified files
808
+ *
809
+ * @param fileDiffsCriteria - List of file parameters objects
810
+ * @param project - Project ID or project name
811
+ * @param repositoryId - The name or ID of the repository
812
+ */
813
+ async getFileDiffs(fileDiffsCriteria, project, repositoryId) {
814
+ return this.beginRequest({
815
+ apiVersion: "7.2-preview.1",
816
+ method: "POST",
817
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/FileDiffs",
818
+ routeValues: {
819
+ project: project,
820
+ repositoryId: repositoryId
821
+ },
822
+ body: fileDiffsCriteria
823
+ });
824
+ }
825
+ /**
826
+ * Retrieve all forks of a repository in the collection.
827
+ *
828
+ * @param repositoryNameOrId - The name or ID of the repository.
829
+ * @param collectionId - Team project collection ID.
830
+ * @param project - Project ID or project name
831
+ * @param includeLinks - True to include links.
832
+ */
833
+ async getForks(repositoryNameOrId, collectionId, project, includeLinks) {
834
+ const queryValues = {
835
+ includeLinks: includeLinks
836
+ };
837
+ return this.beginRequest({
838
+ apiVersion: "7.2-preview.1",
839
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/forks/{collectionId}",
840
+ routeValues: {
841
+ project: project,
842
+ repositoryNameOrId: repositoryNameOrId,
843
+ collectionId: collectionId
844
+ },
845
+ queryParams: queryValues
846
+ });
847
+ }
848
+ /**
849
+ * 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\>
850
+ *
851
+ * @param syncParams - Source repository and ref mapping.
852
+ * @param repositoryNameOrId - The name or ID of the repository.
853
+ * @param project - Project ID or project name
854
+ * @param includeLinks - True to include links
855
+ */
856
+ async createForkSyncRequest(syncParams, repositoryNameOrId, project, includeLinks) {
857
+ const queryValues = {
858
+ includeLinks: includeLinks
859
+ };
860
+ return this.beginRequest({
861
+ apiVersion: "7.2-preview.1",
862
+ method: "POST",
863
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/forkSyncRequests/{forkSyncOperationId}",
864
+ routeValues: {
865
+ project: project,
866
+ repositoryNameOrId: repositoryNameOrId
867
+ },
868
+ queryParams: queryValues,
869
+ body: syncParams
870
+ });
871
+ }
872
+ /**
873
+ * Get a specific fork sync operation's details.
874
+ *
875
+ * @param repositoryNameOrId - The name or ID of the repository.
876
+ * @param forkSyncOperationId - OperationId of the sync request.
877
+ * @param project - Project ID or project name
878
+ * @param includeLinks - True to include links.
879
+ */
880
+ async getForkSyncRequest(repositoryNameOrId, forkSyncOperationId, project, includeLinks) {
881
+ const queryValues = {
882
+ includeLinks: includeLinks
883
+ };
884
+ return this.beginRequest({
885
+ apiVersion: "7.2-preview.1",
886
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/forkSyncRequests/{forkSyncOperationId}",
887
+ routeValues: {
888
+ project: project,
889
+ repositoryNameOrId: repositoryNameOrId,
890
+ forkSyncOperationId: forkSyncOperationId
891
+ },
892
+ queryParams: queryValues
893
+ });
894
+ }
895
+ /**
896
+ * Retrieve all requested fork sync operations on this repository.
897
+ *
898
+ * @param repositoryNameOrId - The name or ID of the repository.
899
+ * @param project - Project ID or project name
900
+ * @param includeAbandoned - True to include abandoned requests.
901
+ * @param includeLinks - True to include links.
902
+ */
903
+ async getForkSyncRequests(repositoryNameOrId, project, includeAbandoned, includeLinks) {
904
+ const queryValues = {
905
+ includeAbandoned: includeAbandoned,
906
+ includeLinks: includeLinks
907
+ };
908
+ return this.beginRequest({
909
+ apiVersion: "7.2-preview.1",
910
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/forkSyncRequests/{forkSyncOperationId}",
911
+ routeValues: {
912
+ project: project,
913
+ repositoryNameOrId: repositoryNameOrId
914
+ },
915
+ queryParams: queryValues
916
+ });
917
+ }
918
+ /**
919
+ * 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.
920
+ *
921
+ * @param repositoryId - The name or ID of the repository.
922
+ * @param path - The item path.
923
+ * @param project - Project ID or project name
924
+ * @param scopePath - The path scope. The default is null.
925
+ * @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
926
+ * @param includeContentMetadata - Set to true to include content metadata. Default is false.
927
+ * @param latestProcessedChange - Set to true to include the latest changes. Default is false.
928
+ * @param download - Set to true to download the response as a file. Default is false.
929
+ * @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
930
+ * @param includeContent - Set to true to include item content when requesting json. Default is false.
931
+ * @param resolveHfs - Set to true to resolve Git HFS pointer files to return actual content from Git HFS. Default is true.
932
+ * @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.
933
+ */
934
+ async getHfsItem(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveHfs, sanitize) {
935
+ const queryValues = {
936
+ path: path,
937
+ scopePath: scopePath,
938
+ recursionLevel: recursionLevel,
939
+ includeContentMetadata: includeContentMetadata,
940
+ latestProcessedChange: latestProcessedChange,
941
+ download: download,
942
+ versionDescriptor: versionDescriptor,
943
+ includeContent: includeContent,
944
+ resolveHfs: resolveHfs,
945
+ sanitize: sanitize
946
+ };
947
+ return this.beginRequest({
948
+ apiVersion: "7.2-preview.1",
949
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/HfsItems/{*path}",
950
+ routeValues: {
951
+ project: project,
952
+ repositoryId: repositoryId
953
+ },
954
+ queryParams: queryValues
955
+ });
956
+ }
957
+ /**
958
+ * 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.
959
+ *
960
+ * @param repositoryId - The name or ID of the repository.
961
+ * @param path - The item path.
962
+ * @param project - Project ID or project name
963
+ * @param scopePath - The path scope. The default is null.
964
+ * @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
965
+ * @param includeContentMetadata - Set to true to include content metadata. Default is false.
966
+ * @param latestProcessedChange - Set to true to include the latest changes. Default is false.
967
+ * @param download - Set to true to download the response as a file. Default is false.
968
+ * @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
969
+ * @param includeContent - Set to true to include item content when requesting json. Default is false.
970
+ * @param resolveHfs - Set to true to resolve Git HFS pointer files to return actual content from Git HFS. Default is true.
971
+ * @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.
972
+ */
973
+ async getHfsItemContent(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveHfs, sanitize) {
974
+ const queryValues = {
975
+ path: path,
976
+ scopePath: scopePath,
977
+ recursionLevel: recursionLevel,
978
+ includeContentMetadata: includeContentMetadata,
979
+ latestProcessedChange: latestProcessedChange,
980
+ download: download,
981
+ versionDescriptor: versionDescriptor,
982
+ includeContent: includeContent,
983
+ resolveHfs: resolveHfs,
984
+ sanitize: sanitize
985
+ };
986
+ return this.beginRequest({
987
+ apiVersion: "7.2-preview.1",
988
+ httpResponseType: "application/octet-stream",
989
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/HfsItems/{*path}",
990
+ routeValues: {
991
+ project: project,
992
+ repositoryId: repositoryId
993
+ },
994
+ queryParams: queryValues
995
+ });
996
+ }
997
+ /**
998
+ * 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.
999
+ *
1000
+ * @param repositoryId - The name or ID of the repository.
1001
+ * @param project - Project ID or project name
1002
+ * @param scopePath - The path scope. The default is null.
1003
+ * @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
1004
+ * @param includeContentMetadata - Set to true to include content metadata. Default is false.
1005
+ * @param latestProcessedChange - Set to true to include the latest changes. Default is false.
1006
+ * @param download - Set to true to download the response as a file. Default is false.
1007
+ * @param includeLinks - Set to true to include links to items. Default is false.
1008
+ * @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
1009
+ * @param zipForUnix - Set to true to keep the file permissions for unix (and POSIX) systems like executables and symlinks
1010
+ */
1011
+ async getHfsItems(repositoryId, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, includeLinks, versionDescriptor, zipForUnix) {
1012
+ const queryValues = {
1013
+ scopePath: scopePath,
1014
+ recursionLevel: recursionLevel,
1015
+ includeContentMetadata: includeContentMetadata,
1016
+ latestProcessedChange: latestProcessedChange,
1017
+ download: download,
1018
+ includeLinks: includeLinks,
1019
+ versionDescriptor: versionDescriptor,
1020
+ zipForUnix: zipForUnix
1021
+ };
1022
+ return this.beginRequest({
1023
+ apiVersion: "7.2-preview.1",
1024
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/HfsItems/{*path}",
1025
+ routeValues: {
1026
+ project: project,
1027
+ repositoryId: repositoryId
1028
+ },
1029
+ queryParams: queryValues
1030
+ });
1031
+ }
1032
+ /**
1033
+ * 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.
1034
+ *
1035
+ * @param repositoryId - The name or ID of the repository.
1036
+ * @param path - The item path.
1037
+ * @param project - Project ID or project name
1038
+ * @param scopePath - The path scope. The default is null.
1039
+ * @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
1040
+ * @param includeContentMetadata - Set to true to include content metadata. Default is false.
1041
+ * @param latestProcessedChange - Set to true to include the latest changes. Default is false.
1042
+ * @param download - Set to true to download the response as a file. Default is false.
1043
+ * @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
1044
+ * @param includeContent - Set to true to include item content when requesting json. Default is false.
1045
+ * @param resolveHfs - Set to true to resolve Git HFS pointer files to return actual content from Git HFS. Default is true.
1046
+ * @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.
1047
+ */
1048
+ async getHfsItemText(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveHfs, sanitize) {
1049
+ const queryValues = {
1050
+ path: path,
1051
+ scopePath: scopePath,
1052
+ recursionLevel: recursionLevel,
1053
+ includeContentMetadata: includeContentMetadata,
1054
+ latestProcessedChange: latestProcessedChange,
1055
+ download: download,
1056
+ versionDescriptor: versionDescriptor,
1057
+ includeContent: includeContent,
1058
+ resolveHfs: resolveHfs,
1059
+ sanitize: sanitize
1060
+ };
1061
+ return this.beginRequest({
1062
+ apiVersion: "7.2-preview.1",
1063
+ httpResponseType: "text/plain",
1064
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/HfsItems/{*path}",
1065
+ routeValues: {
1066
+ project: project,
1067
+ repositoryId: repositoryId
1068
+ },
1069
+ queryParams: queryValues
1070
+ });
1071
+ }
1072
+ /**
1073
+ * 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.
1074
+ *
1075
+ * @param repositoryId - The name or ID of the repository.
1076
+ * @param path - The item path.
1077
+ * @param project - Project ID or project name
1078
+ * @param scopePath - The path scope. The default is null.
1079
+ * @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
1080
+ * @param includeContentMetadata - Set to true to include content metadata. Default is false.
1081
+ * @param latestProcessedChange - Set to true to include the latest changes. Default is false.
1082
+ * @param download - Set to true to download the response as a file. Default is false.
1083
+ * @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
1084
+ * @param includeContent - Set to true to include item content when requesting json. Default is false.
1085
+ * @param resolveHfs - Set to true to resolve Git HFS pointer files to return actual content from Git HFS. Default is true.
1086
+ * @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.
1087
+ */
1088
+ async getHfsItemZip(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveHfs, sanitize) {
1089
+ const queryValues = {
1090
+ path: path,
1091
+ scopePath: scopePath,
1092
+ recursionLevel: recursionLevel,
1093
+ includeContentMetadata: includeContentMetadata,
1094
+ latestProcessedChange: latestProcessedChange,
1095
+ download: download,
1096
+ versionDescriptor: versionDescriptor,
1097
+ includeContent: includeContent,
1098
+ resolveHfs: resolveHfs,
1099
+ sanitize: sanitize
1100
+ };
1101
+ return this.beginRequest({
1102
+ apiVersion: "7.2-preview.1",
1103
+ httpResponseType: "application/zip",
1104
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/HfsItems/{*path}",
1105
+ routeValues: {
1106
+ project: project,
1107
+ repositoryId: repositoryId
1108
+ },
1109
+ queryParams: queryValues
1110
+ });
1111
+ }
1112
+ /**
1113
+ * Create an import request.
1114
+ *
1115
+ * @param importRequest - The import request to create.
1116
+ * @param project - Project ID or project name
1117
+ * @param repositoryId - The name or ID of the repository.
1118
+ */
1119
+ async createImportRequest(importRequest, project, repositoryId) {
1120
+ return this.beginRequest({
1121
+ apiVersion: "7.2-preview.1",
1122
+ method: "POST",
1123
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/importRequests/{importRequestId}",
1124
+ routeValues: {
1125
+ project: project,
1126
+ repositoryId: repositoryId
1127
+ },
1128
+ body: importRequest
1129
+ });
1130
+ }
1131
+ /**
1132
+ * Retrieve a particular import request.
1133
+ *
1134
+ * @param project - Project ID or project name
1135
+ * @param repositoryId - The name or ID of the repository.
1136
+ * @param importRequestId - The unique identifier for the import request.
1137
+ */
1138
+ async getImportRequest(project, repositoryId, importRequestId) {
1139
+ return this.beginRequest({
1140
+ apiVersion: "7.2-preview.1",
1141
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/importRequests/{importRequestId}",
1142
+ routeValues: {
1143
+ project: project,
1144
+ repositoryId: repositoryId,
1145
+ importRequestId: importRequestId
1146
+ }
1147
+ });
1148
+ }
1149
+ /**
1150
+ * Retrieve import requests for a repository.
1151
+ *
1152
+ * @param project - Project ID or project name
1153
+ * @param repositoryId - The name or ID of the repository.
1154
+ * @param includeAbandoned - True to include abandoned import requests in the results.
1155
+ */
1156
+ async queryImportRequests(project, repositoryId, includeAbandoned) {
1157
+ const queryValues = {
1158
+ includeAbandoned: includeAbandoned
1159
+ };
1160
+ return this.beginRequest({
1161
+ apiVersion: "7.2-preview.1",
1162
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/importRequests/{importRequestId}",
1163
+ routeValues: {
1164
+ project: project,
1165
+ repositoryId: repositoryId
1166
+ },
1167
+ queryParams: queryValues
1168
+ });
1169
+ }
1170
+ /**
1171
+ * Retry or abandon a failed import request.
1172
+ *
1173
+ * @param importRequestToUpdate - The updated version of the import request. Currently, the only change allowed is setting the Status to Queued or Abandoned.
1174
+ * @param project - Project ID or project name
1175
+ * @param repositoryId - The name or ID of the repository.
1176
+ * @param importRequestId - The unique identifier for the import request to update.
1177
+ */
1178
+ async updateImportRequest(importRequestToUpdate, project, repositoryId, importRequestId) {
1179
+ return this.beginRequest({
1180
+ apiVersion: "7.2-preview.1",
1181
+ method: "PATCH",
1182
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/importRequests/{importRequestId}",
1183
+ routeValues: {
1184
+ project: project,
1185
+ repositoryId: repositoryId,
1186
+ importRequestId: importRequestId
1187
+ },
1188
+ body: importRequestToUpdate
1189
+ });
1190
+ }
1191
+ /**
1192
+ * 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.
1193
+ *
1194
+ * @param repositoryId - The name or ID of the repository.
1195
+ * @param path - The item path.
1196
+ * @param project - Project ID or project name
1197
+ * @param scopePath - The path scope. The default is null.
1198
+ * @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
1199
+ * @param includeContentMetadata - Set to true to include content metadata. Default is false.
1200
+ * @param latestProcessedChange - Set to true to include the latest changes. Default is false.
1201
+ * @param download - Set to true to download the response as a file. Default is false.
1202
+ * @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
1203
+ * @param includeContent - Set to true to include item content when requesting json. Default is false.
1204
+ * @param resolveLfs - Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.
1205
+ * @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.
1206
+ */
1207
+ async getItem(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveLfs, sanitize) {
1208
+ const queryValues = {
1209
+ path: path,
1210
+ scopePath: scopePath,
1211
+ recursionLevel: recursionLevel,
1212
+ includeContentMetadata: includeContentMetadata,
1213
+ latestProcessedChange: latestProcessedChange,
1214
+ download: download,
1215
+ versionDescriptor: versionDescriptor,
1216
+ includeContent: includeContent,
1217
+ resolveLfs: resolveLfs,
1218
+ sanitize: sanitize
1219
+ };
1220
+ return this.beginRequest({
1221
+ apiVersion: "7.2-preview.1",
1222
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Items/{*path}",
1223
+ routeValues: {
1224
+ project: project,
1225
+ repositoryId: repositoryId
1226
+ },
1227
+ queryParams: queryValues
1228
+ });
1229
+ }
1230
+ /**
1231
+ * 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.
1232
+ *
1233
+ * @param repositoryId - The name or ID of the repository.
1234
+ * @param path - The item path.
1235
+ * @param project - Project ID or project name
1236
+ * @param scopePath - The path scope. The default is null.
1237
+ * @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
1238
+ * @param includeContentMetadata - Set to true to include content metadata. Default is false.
1239
+ * @param latestProcessedChange - Set to true to include the latest changes. Default is false.
1240
+ * @param download - Set to true to download the response as a file. Default is false.
1241
+ * @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
1242
+ * @param includeContent - Set to true to include item content when requesting json. Default is false.
1243
+ * @param resolveLfs - Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.
1244
+ * @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.
1245
+ */
1246
+ async getItemContent(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveLfs, sanitize) {
1247
+ const queryValues = {
1248
+ path: path,
1249
+ scopePath: scopePath,
1250
+ recursionLevel: recursionLevel,
1251
+ includeContentMetadata: includeContentMetadata,
1252
+ latestProcessedChange: latestProcessedChange,
1253
+ download: download,
1254
+ versionDescriptor: versionDescriptor,
1255
+ includeContent: includeContent,
1256
+ resolveLfs: resolveLfs,
1257
+ sanitize: sanitize
1258
+ };
1259
+ return this.beginRequest({
1260
+ apiVersion: "7.2-preview.1",
1261
+ httpResponseType: "application/octet-stream",
1262
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Items/{*path}",
1263
+ routeValues: {
1264
+ project: project,
1265
+ repositoryId: repositoryId
1266
+ },
1267
+ queryParams: queryValues
1268
+ });
1269
+ }
1270
+ /**
1271
+ * 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.
1272
+ *
1273
+ * @param repositoryId - The name or ID of the repository.
1274
+ * @param project - Project ID or project name
1275
+ * @param scopePath - The path scope. The default is null.
1276
+ * @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
1277
+ * @param includeContentMetadata - Set to true to include content metadata. Default is false.
1278
+ * @param latestProcessedChange - Set to true to include the latest changes. Default is false.
1279
+ * @param download - Set to true to download the response as a file. Default is false.
1280
+ * @param includeLinks - Set to true to include links to items. Default is false.
1281
+ * @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
1282
+ * @param zipForUnix - Set to true to keep the file permissions for unix (and POSIX) systems like executables and symlinks
1283
+ */
1284
+ async getItems(repositoryId, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, includeLinks, versionDescriptor, zipForUnix) {
1285
+ const queryValues = {
1286
+ scopePath: scopePath,
1287
+ recursionLevel: recursionLevel,
1288
+ includeContentMetadata: includeContentMetadata,
1289
+ latestProcessedChange: latestProcessedChange,
1290
+ download: download,
1291
+ includeLinks: includeLinks,
1292
+ versionDescriptor: versionDescriptor,
1293
+ zipForUnix: zipForUnix
1294
+ };
1295
+ return this.beginRequest({
1296
+ apiVersion: "7.2-preview.1",
1297
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Items/{*path}",
1298
+ routeValues: {
1299
+ project: project,
1300
+ repositoryId: repositoryId
1301
+ },
1302
+ queryParams: queryValues
1303
+ });
1304
+ }
1305
+ /**
1306
+ * 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.
1307
+ *
1308
+ * @param repositoryId - The name or ID of the repository.
1309
+ * @param path - The item path.
1310
+ * @param project - Project ID or project name
1311
+ * @param scopePath - The path scope. The default is null.
1312
+ * @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
1313
+ * @param includeContentMetadata - Set to true to include content metadata. Default is false.
1314
+ * @param latestProcessedChange - Set to true to include the latest changes. Default is false.
1315
+ * @param download - Set to true to download the response as a file. Default is false.
1316
+ * @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
1317
+ * @param includeContent - Set to true to include item content when requesting json. Default is false.
1318
+ * @param resolveLfs - Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.
1319
+ * @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.
1320
+ */
1321
+ async getItemText(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveLfs, sanitize) {
1322
+ const queryValues = {
1323
+ path: path,
1324
+ scopePath: scopePath,
1325
+ recursionLevel: recursionLevel,
1326
+ includeContentMetadata: includeContentMetadata,
1327
+ latestProcessedChange: latestProcessedChange,
1328
+ download: download,
1329
+ versionDescriptor: versionDescriptor,
1330
+ includeContent: includeContent,
1331
+ resolveLfs: resolveLfs,
1332
+ sanitize: sanitize
1333
+ };
1334
+ return this.beginRequest({
1335
+ apiVersion: "7.2-preview.1",
1336
+ httpResponseType: "text/plain",
1337
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Items/{*path}",
1338
+ routeValues: {
1339
+ project: project,
1340
+ repositoryId: repositoryId
1341
+ },
1342
+ queryParams: queryValues
1343
+ });
1344
+ }
1345
+ /**
1346
+ * 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.
1347
+ *
1348
+ * @param repositoryId - The name or ID of the repository.
1349
+ * @param path - The item path.
1350
+ * @param project - Project ID or project name
1351
+ * @param scopePath - The path scope. The default is null.
1352
+ * @param recursionLevel - The recursion level of this request. The default is 'none', no recursion.
1353
+ * @param includeContentMetadata - Set to true to include content metadata. Default is false.
1354
+ * @param latestProcessedChange - Set to true to include the latest changes. Default is false.
1355
+ * @param download - Set to true to download the response as a file. Default is false.
1356
+ * @param versionDescriptor - Version descriptor. Default is the default branch for the repository.
1357
+ * @param includeContent - Set to true to include item content when requesting json. Default is false.
1358
+ * @param resolveLfs - Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.
1359
+ * @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.
1360
+ */
1361
+ async getItemZip(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveLfs, sanitize) {
1362
+ const queryValues = {
1363
+ path: path,
1364
+ scopePath: scopePath,
1365
+ recursionLevel: recursionLevel,
1366
+ includeContentMetadata: includeContentMetadata,
1367
+ latestProcessedChange: latestProcessedChange,
1368
+ download: download,
1369
+ versionDescriptor: versionDescriptor,
1370
+ includeContent: includeContent,
1371
+ resolveLfs: resolveLfs,
1372
+ sanitize: sanitize
1373
+ };
1374
+ return this.beginRequest({
1375
+ apiVersion: "7.2-preview.1",
1376
+ httpResponseType: "application/zip",
1377
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Items/{*path}",
1378
+ routeValues: {
1379
+ project: project,
1380
+ repositoryId: repositoryId
1381
+ },
1382
+ queryParams: queryValues
1383
+ });
1384
+ }
1385
+ /**
1386
+ * Retrieves a batch of items in a repo / project for a given list of paths or a long path
1387
+ *
1388
+ * @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.
1389
+ * @param repositoryId - The name or ID of the repository
1390
+ * @param project - Project ID or project name
1391
+ */
1392
+ async getItemsBatch(requestData, repositoryId, project) {
1393
+ return this.beginRequest({
1394
+ apiVersion: "7.2-preview.1",
1395
+ method: "POST",
1396
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/ItemsBatch",
1397
+ routeValues: {
1398
+ project: project,
1399
+ repositoryId: repositoryId
1400
+ },
1401
+ body: requestData
1402
+ });
1403
+ }
1404
+ /**
1405
+ * 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.
1406
+ *
1407
+ * @param repositoryNameOrId - ID or name of the local repository.
1408
+ * @param commitId - First commit, usually the tip of the target branch of the potential merge.
1409
+ * @param otherCommitId - Other commit, usually the tip of the source branch of the potential merge.
1410
+ * @param project - Project ID or project name
1411
+ * @param otherCollectionId - The collection ID where otherCommitId lives.
1412
+ * @param otherRepositoryId - The repository ID where otherCommitId lives.
1413
+ */
1414
+ async getMergeBases(repositoryNameOrId, commitId, otherCommitId, project, otherCollectionId, otherRepositoryId) {
1415
+ const queryValues = {
1416
+ otherCommitId: otherCommitId,
1417
+ otherCollectionId: otherCollectionId,
1418
+ otherRepositoryId: otherRepositoryId
1419
+ };
1420
+ return this.beginRequest({
1421
+ apiVersion: "7.2-preview.1",
1422
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/commits/{commitId}/mergeBases",
1423
+ routeValues: {
1424
+ project: project,
1425
+ repositoryNameOrId: repositoryNameOrId,
1426
+ commitId: commitId
1427
+ },
1428
+ queryParams: queryValues
1429
+ });
1430
+ }
1431
+ /**
1432
+ * Request a git merge operation. Currently we support merging only 2 commits.
1433
+ *
1434
+ * @param mergeParameters - Parents commitIds and merge commit messsage.
1435
+ * @param project - Project ID or project name
1436
+ * @param repositoryNameOrId - The name or ID of the repository.
1437
+ * @param includeLinks - True to include links
1438
+ */
1439
+ async createMergeRequest(mergeParameters, project, repositoryNameOrId, includeLinks) {
1440
+ const queryValues = {
1441
+ includeLinks: includeLinks
1442
+ };
1443
+ return this.beginRequest({
1444
+ apiVersion: "7.2-preview.1",
1445
+ method: "POST",
1446
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/merges/{mergeOperationId}",
1447
+ routeValues: {
1448
+ project: project,
1449
+ repositoryNameOrId: repositoryNameOrId
1450
+ },
1451
+ queryParams: queryValues,
1452
+ body: mergeParameters
1453
+ });
1454
+ }
1455
+ /**
1456
+ * Get a specific merge operation's details.
1457
+ *
1458
+ * @param project - Project ID or project name
1459
+ * @param repositoryNameOrId - The name or ID of the repository.
1460
+ * @param mergeOperationId - OperationId of the merge request.
1461
+ * @param includeLinks - True to include links
1462
+ */
1463
+ async getMergeRequest(project, repositoryNameOrId, mergeOperationId, includeLinks) {
1464
+ const queryValues = {
1465
+ includeLinks: includeLinks
1466
+ };
1467
+ return this.beginRequest({
1468
+ apiVersion: "7.2-preview.1",
1469
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryNameOrId}/merges/{mergeOperationId}",
1470
+ routeValues: {
1471
+ project: project,
1472
+ repositoryNameOrId: repositoryNameOrId,
1473
+ mergeOperationId: mergeOperationId
1474
+ },
1475
+ queryParams: queryValues
1476
+ });
1477
+ }
1478
+ /**
1479
+ * Attach a new file to a pull request.
1480
+ *
1481
+ * @param content - Content to upload
1482
+ * @param fileName - The name of the file.
1483
+ * @param repositoryId - The repository ID of the pull request’s target branch.
1484
+ * @param pullRequestId - ID of the pull request.
1485
+ * @param project - Project ID or project name
1486
+ */
1487
+ async createAttachment(content, fileName, repositoryId, pullRequestId, project) {
1488
+ return this.beginRequest({
1489
+ apiVersion: "7.2-preview.1",
1490
+ method: "POST",
1491
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}",
1492
+ routeValues: {
1493
+ project: project,
1494
+ fileName: fileName,
1495
+ repositoryId: repositoryId,
1496
+ pullRequestId: pullRequestId
1497
+ },
1498
+ customHeaders: {
1499
+ "Content-Type": "application/octet-stream",
1500
+ },
1501
+ body: content,
1502
+ isRawData: true
1503
+ });
1504
+ }
1505
+ /**
1506
+ * Delete a pull request attachment.
1507
+ *
1508
+ * @param fileName - The name of the attachment to delete.
1509
+ * @param repositoryId - The repository ID of the pull request’s target branch.
1510
+ * @param pullRequestId - ID of the pull request.
1511
+ * @param project - Project ID or project name
1512
+ */
1513
+ async deleteAttachment(fileName, repositoryId, pullRequestId, project) {
1514
+ return this.beginRequest({
1515
+ apiVersion: "7.2-preview.1",
1516
+ method: "DELETE",
1517
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}",
1518
+ routeValues: {
1519
+ project: project,
1520
+ fileName: fileName,
1521
+ repositoryId: repositoryId,
1522
+ pullRequestId: pullRequestId
1523
+ }
1524
+ });
1525
+ }
1526
+ /**
1527
+ * Get the file content of a pull request attachment.
1528
+ *
1529
+ * @param fileName - The name of the attachment.
1530
+ * @param repositoryId - The repository ID of the pull request’s target branch.
1531
+ * @param pullRequestId - ID of the pull request.
1532
+ * @param project - Project ID or project name
1533
+ */
1534
+ async getAttachmentContent(fileName, repositoryId, pullRequestId, project) {
1535
+ return this.beginRequest({
1536
+ apiVersion: "7.2-preview.1",
1537
+ httpResponseType: "application/octet-stream",
1538
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}",
1539
+ routeValues: {
1540
+ project: project,
1541
+ fileName: fileName,
1542
+ repositoryId: repositoryId,
1543
+ pullRequestId: pullRequestId
1544
+ }
1545
+ });
1546
+ }
1547
+ /**
1548
+ * Get a list of files attached to a given pull request.
1549
+ *
1550
+ * @param repositoryId - The repository ID of the pull request’s target branch.
1551
+ * @param pullRequestId - ID of the pull request.
1552
+ * @param project - Project ID or project name
1553
+ */
1554
+ async getAttachments(repositoryId, pullRequestId, project) {
1555
+ return this.beginRequest({
1556
+ apiVersion: "7.2-preview.1",
1557
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}",
1558
+ routeValues: {
1559
+ project: project,
1560
+ repositoryId: repositoryId,
1561
+ pullRequestId: pullRequestId
1562
+ }
1563
+ });
1564
+ }
1565
+ /**
1566
+ * Get the file content of a pull request attachment.
1567
+ *
1568
+ * @param fileName - The name of the attachment.
1569
+ * @param repositoryId - The repository ID of the pull request’s target branch.
1570
+ * @param pullRequestId - ID of the pull request.
1571
+ * @param project - Project ID or project name
1572
+ */
1573
+ async getAttachmentZip(fileName, repositoryId, pullRequestId, project) {
1574
+ return this.beginRequest({
1575
+ apiVersion: "7.2-preview.1",
1576
+ httpResponseType: "application/zip",
1577
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}",
1578
+ routeValues: {
1579
+ project: project,
1580
+ fileName: fileName,
1581
+ repositoryId: repositoryId,
1582
+ pullRequestId: pullRequestId
1583
+ }
1584
+ });
1585
+ }
1586
+ /**
1587
+ * Add a like on a comment.
1588
+ *
1589
+ * @param repositoryId - The repository ID of the pull request's target branch.
1590
+ * @param pullRequestId - ID of the pull request.
1591
+ * @param threadId - The ID of the thread that contains the comment.
1592
+ * @param commentId - The ID of the comment.
1593
+ * @param project - Project ID or project name
1594
+ */
1595
+ async createLike(repositoryId, pullRequestId, threadId, commentId, project) {
1596
+ return this.beginRequest({
1597
+ apiVersion: "7.2-preview.1",
1598
+ method: "POST",
1599
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}/likes",
1600
+ routeValues: {
1601
+ project: project,
1602
+ repositoryId: repositoryId,
1603
+ pullRequestId: pullRequestId,
1604
+ threadId: threadId,
1605
+ commentId: commentId
1606
+ }
1607
+ });
1608
+ }
1609
+ /**
1610
+ * Delete a like on a comment.
1611
+ *
1612
+ * @param repositoryId - The repository ID of the pull request's target branch.
1613
+ * @param pullRequestId - ID of the pull request.
1614
+ * @param threadId - The ID of the thread that contains the comment.
1615
+ * @param commentId - The ID of the comment.
1616
+ * @param project - Project ID or project name
1617
+ */
1618
+ async deleteLike(repositoryId, pullRequestId, threadId, commentId, project) {
1619
+ return this.beginRequest({
1620
+ apiVersion: "7.2-preview.1",
1621
+ method: "DELETE",
1622
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}/likes",
1623
+ routeValues: {
1624
+ project: project,
1625
+ repositoryId: repositoryId,
1626
+ pullRequestId: pullRequestId,
1627
+ threadId: threadId,
1628
+ commentId: commentId
1629
+ }
1630
+ });
1631
+ }
1632
+ /**
1633
+ * Get likes for a comment.
1634
+ *
1635
+ * @param repositoryId - The repository ID of the pull request's target branch.
1636
+ * @param pullRequestId - ID of the pull request.
1637
+ * @param threadId - The ID of the thread that contains the comment.
1638
+ * @param commentId - The ID of the comment.
1639
+ * @param project - Project ID or project name
1640
+ */
1641
+ async getLikes(repositoryId, pullRequestId, threadId, commentId, project) {
1642
+ return this.beginRequest({
1643
+ apiVersion: "7.2-preview.1",
1644
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}/likes",
1645
+ routeValues: {
1646
+ project: project,
1647
+ repositoryId: repositoryId,
1648
+ pullRequestId: pullRequestId,
1649
+ threadId: threadId,
1650
+ commentId: commentId
1651
+ }
1652
+ });
1653
+ }
1654
+ /**
1655
+ * Get the commits for the specified iteration of a pull request.
1656
+ *
1657
+ * @param repositoryId - ID or name of the repository.
1658
+ * @param pullRequestId - ID of the pull request.
1659
+ * @param iterationId - ID of the iteration from which to get the commits.
1660
+ * @param project - Project ID or project name
1661
+ * @param top - Maximum number of commits to return. The maximum number of commits that can be returned per batch is 500.
1662
+ * @param skip - Number of commits to skip.
1663
+ */
1664
+ async getPullRequestIterationCommits(repositoryId, pullRequestId, iterationId, project, top, skip) {
1665
+ const queryValues = {
1666
+ top: top,
1667
+ skip: skip
1668
+ };
1669
+ return this.beginRequest({
1670
+ apiVersion: "7.2-preview.1",
1671
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/commits",
1672
+ routeValues: {
1673
+ project: project,
1674
+ repositoryId: repositoryId,
1675
+ pullRequestId: pullRequestId,
1676
+ iterationId: iterationId
1677
+ },
1678
+ queryParams: queryValues
1679
+ });
1680
+ }
1681
+ /**
1682
+ * Get the commits for the specified pull request.
1683
+ *
1684
+ * @param repositoryId - ID or name of the repository.
1685
+ * @param pullRequestId - ID of the pull request.
1686
+ * @param project - Project ID or project name
1687
+ */
1688
+ async getPullRequestCommits(repositoryId, pullRequestId, project) {
1689
+ return this.beginRequest({
1690
+ apiVersion: "7.2-preview.1",
1691
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/commits",
1692
+ routeValues: {
1693
+ project: project,
1694
+ repositoryId: repositoryId,
1695
+ pullRequestId: pullRequestId
1696
+ },
1697
+ returnRawResponse: true
1698
+ }).then(async (response) => {
1699
+ const body = await response.text().then(deserializeVssJsonObject);
1700
+ body.continuationToken = response.headers.get("x-ms-continuationtoken");
1701
+ return body;
1702
+ });
1703
+ }
1704
+ /**
1705
+ * Retrieve one conflict for a pull request by ID
1706
+ *
1707
+ * @param repositoryId -
1708
+ * @param pullRequestId -
1709
+ * @param conflictId -
1710
+ * @param project - Project ID or project name
1711
+ */
1712
+ async getPullRequestConflict(repositoryId, pullRequestId, conflictId, project) {
1713
+ return this.beginRequest({
1714
+ apiVersion: "7.2-preview.1",
1715
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/conflicts/{conflictId}",
1716
+ routeValues: {
1717
+ project: project,
1718
+ repositoryId: repositoryId,
1719
+ pullRequestId: pullRequestId,
1720
+ conflictId: conflictId
1721
+ }
1722
+ });
1723
+ }
1724
+ /**
1725
+ * Retrieve all conflicts for a pull request
1726
+ *
1727
+ * @param repositoryId - The repository of the Pull Request.
1728
+ * @param pullRequestId - The pull request ID.
1729
+ * @param project - Project ID or project name
1730
+ * @param skip - Conflicts to skip.
1731
+ * @param top - Conflicts to return after skip.
1732
+ * @param includeObsolete - Includes obsolete conflicts.
1733
+ * @param excludeResolved - Excludes conflicts already resolved.
1734
+ * @param onlyResolved - Returns only the conflicts that are resolved.
1735
+ */
1736
+ async getPullRequestConflicts(repositoryId, pullRequestId, project, skip, top, includeObsolete, excludeResolved, onlyResolved) {
1737
+ const queryValues = {
1738
+ '$skip': skip,
1739
+ '$top': top,
1740
+ includeObsolete: includeObsolete,
1741
+ excludeResolved: excludeResolved,
1742
+ onlyResolved: onlyResolved
1743
+ };
1744
+ return this.beginRequest({
1745
+ apiVersion: "7.2-preview.1",
1746
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/conflicts/{conflictId}",
1747
+ routeValues: {
1748
+ project: project,
1749
+ repositoryId: repositoryId,
1750
+ pullRequestId: pullRequestId
1751
+ },
1752
+ queryParams: queryValues
1753
+ });
1754
+ }
1755
+ /**
1756
+ * Update merge conflict resolution
1757
+ *
1758
+ * @param conflict -
1759
+ * @param repositoryId -
1760
+ * @param pullRequestId -
1761
+ * @param conflictId -
1762
+ * @param project - Project ID or project name
1763
+ */
1764
+ async updatePullRequestConflict(conflict, repositoryId, pullRequestId, conflictId, project) {
1765
+ return this.beginRequest({
1766
+ apiVersion: "7.2-preview.1",
1767
+ method: "PATCH",
1768
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/conflicts/{conflictId}",
1769
+ routeValues: {
1770
+ project: project,
1771
+ repositoryId: repositoryId,
1772
+ pullRequestId: pullRequestId,
1773
+ conflictId: conflictId
1774
+ },
1775
+ body: conflict
1776
+ });
1777
+ }
1778
+ /**
1779
+ * Update multiple merge conflict resolutions
1780
+ *
1781
+ * @param conflictUpdates -
1782
+ * @param repositoryId -
1783
+ * @param pullRequestId -
1784
+ * @param project - Project ID or project name
1785
+ */
1786
+ async updatePullRequestConflicts(conflictUpdates, repositoryId, pullRequestId, project) {
1787
+ return this.beginRequest({
1788
+ apiVersion: "7.2-preview.1",
1789
+ method: "PATCH",
1790
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/conflicts/{conflictId}",
1791
+ routeValues: {
1792
+ project: project,
1793
+ repositoryId: repositoryId,
1794
+ pullRequestId: pullRequestId
1795
+ },
1796
+ body: conflictUpdates
1797
+ });
1798
+ }
1799
+ /**
1800
+ * Retrieve the file diffs for all changes in a pull request.
1801
+ *
1802
+ * @param repositoryId - The repository ID of the pull request's target branch.
1803
+ * @param pullRequestId - ID of the pull request.
1804
+ * @param project - Project ID or project name
1805
+ * @param iteration - If specified, file diffs will be retrieved for this iteration. If not specified, uses the latest iteration.
1806
+ * @param baseIteration - If specified, file diffs will be compared against this iteration. The default value is zero which indicates the comparison is made against the common commit between the source and target branches.
1807
+ * @param top - Optional. The number of file diffs to retrieve. The default value is 100 and the maximum value is 300.
1808
+ * @param skip - Optional. The number of file diffs to ignore. For example, to retrieve file diffs 101-150, set top to 50 and skip to 100.
1809
+ */
1810
+ async getPullRequestFilesDiff(repositoryId, pullRequestId, project, iteration, baseIteration, top, skip) {
1811
+ const queryValues = {
1812
+ iteration: iteration,
1813
+ baseIteration: baseIteration,
1814
+ '$top': top,
1815
+ '$skip': skip
1816
+ };
1817
+ return this.beginRequest({
1818
+ apiVersion: "7.2-preview.1",
1819
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/filesdiff",
1820
+ routeValues: {
1821
+ project: project,
1822
+ repositoryId: repositoryId,
1823
+ pullRequestId: pullRequestId
1824
+ },
1825
+ queryParams: queryValues
1826
+ });
1827
+ }
1828
+ /**
1829
+ * Retrieve the changes made in a pull request between two iterations.
1830
+ *
1831
+ * @param repositoryId - The repository ID of the pull request's target branch.
1832
+ * @param pullRequestId - ID of the pull request.
1833
+ * @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.
1834
+ * @param project - Project ID or project name
1835
+ * @param top - Optional. The number of changes to retrieve. The default value is 100 and the maximum value is 2000.
1836
+ * @param skip - Optional. The number of changes to ignore. For example, to retrieve changes 101-150, set top 50 and skip to 100.
1837
+ * @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
1838
+ */
1839
+ async getPullRequestIterationChanges(repositoryId, pullRequestId, iterationId, project, top, skip, compareTo) {
1840
+ const queryValues = {
1841
+ '$top': top,
1842
+ '$skip': skip,
1843
+ '$compareTo': compareTo
1844
+ };
1845
+ return this.beginRequest({
1846
+ apiVersion: "7.2-preview.1",
1847
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/changes",
1848
+ routeValues: {
1849
+ project: project,
1850
+ repositoryId: repositoryId,
1851
+ pullRequestId: pullRequestId,
1852
+ iterationId: iterationId
1853
+ },
1854
+ queryParams: queryValues
1855
+ });
1856
+ }
1857
+ /**
1858
+ * Get the specified iteration for a pull request.
1859
+ *
1860
+ * @param repositoryId - ID or name of the repository.
1861
+ * @param pullRequestId - ID of the pull request.
1862
+ * @param iterationId - ID of the pull request iteration to return.
1863
+ * @param project - Project ID or project name
1864
+ */
1865
+ async getPullRequestIteration(repositoryId, pullRequestId, iterationId, project) {
1866
+ return this.beginRequest({
1867
+ apiVersion: "7.2-preview.2",
1868
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}",
1869
+ routeValues: {
1870
+ project: project,
1871
+ repositoryId: repositoryId,
1872
+ pullRequestId: pullRequestId,
1873
+ iterationId: iterationId
1874
+ }
1875
+ });
1876
+ }
1877
+ /**
1878
+ * Get the list of iterations for the specified pull request.
1879
+ *
1880
+ * @param repositoryId - ID or name of the repository.
1881
+ * @param pullRequestId - ID of the pull request.
1882
+ * @param project - Project ID or project name
1883
+ * @param includeCommits - If true, include the commits associated with each iteration in the response.
1884
+ */
1885
+ async getPullRequestIterations(repositoryId, pullRequestId, project, includeCommits) {
1886
+ const queryValues = {
1887
+ includeCommits: includeCommits
1888
+ };
1889
+ return this.beginRequest({
1890
+ apiVersion: "7.2-preview.2",
1891
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}",
1892
+ routeValues: {
1893
+ project: project,
1894
+ repositoryId: repositoryId,
1895
+ pullRequestId: pullRequestId
1896
+ },
1897
+ queryParams: queryValues
1898
+ });
1899
+ }
1900
+ /**
1901
+ * 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.
1902
+ *
1903
+ * @param status - Pull request status to create.
1904
+ * @param repositoryId - The repository ID of the pull request’s target branch.
1905
+ * @param pullRequestId - ID of the pull request.
1906
+ * @param iterationId - ID of the pull request iteration.
1907
+ * @param project - Project ID or project name
1908
+ */
1909
+ async createPullRequestIterationStatus(status, repositoryId, pullRequestId, iterationId, project) {
1910
+ return this.beginRequest({
1911
+ apiVersion: "7.2-preview.2",
1912
+ method: "POST",
1913
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses/{statusId}",
1914
+ routeValues: {
1915
+ project: project,
1916
+ repositoryId: repositoryId,
1917
+ pullRequestId: pullRequestId,
1918
+ iterationId: iterationId
1919
+ },
1920
+ body: status
1921
+ });
1922
+ }
1923
+ /**
1924
+ * Delete pull request iteration status.
1925
+ *
1926
+ * @param repositoryId - The repository ID of the pull request’s target branch.
1927
+ * @param pullRequestId - ID of the pull request.
1928
+ * @param iterationId - ID of the pull request iteration.
1929
+ * @param statusId - ID of the pull request status.
1930
+ * @param project - Project ID or project name
1931
+ */
1932
+ async deletePullRequestIterationStatus(repositoryId, pullRequestId, iterationId, statusId, project) {
1933
+ return this.beginRequest({
1934
+ apiVersion: "7.2-preview.2",
1935
+ method: "DELETE",
1936
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses/{statusId}",
1937
+ routeValues: {
1938
+ project: project,
1939
+ repositoryId: repositoryId,
1940
+ pullRequestId: pullRequestId,
1941
+ iterationId: iterationId,
1942
+ statusId: statusId
1943
+ }
1944
+ });
1945
+ }
1946
+ /**
1947
+ * Get the specific pull request iteration status by ID. The status ID is unique within the pull request across all iterations.
1948
+ *
1949
+ * @param repositoryId - The repository ID of the pull request’s target branch.
1950
+ * @param pullRequestId - ID of the pull request.
1951
+ * @param iterationId - ID of the pull request iteration.
1952
+ * @param statusId - ID of the pull request status.
1953
+ * @param project - Project ID or project name
1954
+ */
1955
+ async getPullRequestIterationStatus(repositoryId, pullRequestId, iterationId, statusId, project) {
1956
+ return this.beginRequest({
1957
+ apiVersion: "7.2-preview.2",
1958
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses/{statusId}",
1959
+ routeValues: {
1960
+ project: project,
1961
+ repositoryId: repositoryId,
1962
+ pullRequestId: pullRequestId,
1963
+ iterationId: iterationId,
1964
+ statusId: statusId
1965
+ }
1966
+ });
1967
+ }
1968
+ /**
1969
+ * Get all the statuses associated with a pull request iteration.
1970
+ *
1971
+ * @param repositoryId - The repository ID of the pull request’s target branch.
1972
+ * @param pullRequestId - ID of the pull request.
1973
+ * @param iterationId - ID of the pull request iteration.
1974
+ * @param project - Project ID or project name
1975
+ */
1976
+ async getPullRequestIterationStatuses(repositoryId, pullRequestId, iterationId, project) {
1977
+ return this.beginRequest({
1978
+ apiVersion: "7.2-preview.2",
1979
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses/{statusId}",
1980
+ routeValues: {
1981
+ project: project,
1982
+ repositoryId: repositoryId,
1983
+ pullRequestId: pullRequestId,
1984
+ iterationId: iterationId
1985
+ }
1986
+ });
1987
+ }
1988
+ /**
1989
+ * Update pull request iteration statuses collection. The only supported operation type is \`remove\`.
1990
+ *
1991
+ * @param patchDocument - Operations to apply to the pull request statuses in JSON Patch format.
1992
+ * @param repositoryId - The repository ID of the pull request’s target branch.
1993
+ * @param pullRequestId - ID of the pull request.
1994
+ * @param iterationId - ID of the pull request iteration.
1995
+ * @param project - Project ID or project name
1996
+ */
1997
+ async updatePullRequestIterationStatuses(patchDocument, repositoryId, pullRequestId, iterationId, project) {
1998
+ return this.beginRequest({
1999
+ apiVersion: "7.2-preview.2",
2000
+ method: "PATCH",
2001
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}/statuses/{statusId}",
2002
+ routeValues: {
2003
+ project: project,
2004
+ repositoryId: repositoryId,
2005
+ pullRequestId: pullRequestId,
2006
+ iterationId: iterationId
2007
+ },
2008
+ customHeaders: {
2009
+ "Content-Type": "application/json-patch+json",
2010
+ },
2011
+ body: patchDocument
2012
+ });
2013
+ }
2014
+ /**
2015
+ * 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).
2016
+ *
2017
+ * @param label - Label to assign to the pull request.
2018
+ * @param repositoryId - The repository ID of the pull request’s target branch.
2019
+ * @param pullRequestId - ID of the pull request.
2020
+ * @param project - Project ID or project name
2021
+ * @param projectId - Project ID or project name.
2022
+ */
2023
+ async createPullRequestLabel(label, repositoryId, pullRequestId, project, projectId) {
2024
+ const queryValues = {
2025
+ projectId: projectId
2026
+ };
2027
+ return this.beginRequest({
2028
+ apiVersion: "7.2-preview.1",
2029
+ method: "POST",
2030
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/labels/{labelIdOrName}",
2031
+ routeValues: {
2032
+ project: project,
2033
+ repositoryId: repositoryId,
2034
+ pullRequestId: pullRequestId
2035
+ },
2036
+ queryParams: queryValues,
2037
+ body: label
2038
+ });
2039
+ }
2040
+ /**
2041
+ * Removes a label (tag) from the set of those assigned to the pull request. The tag itself will not be deleted.
2042
+ *
2043
+ * @param repositoryId - The repository ID of the pull request’s target branch.
2044
+ * @param pullRequestId - ID of the pull request.
2045
+ * @param labelIdOrName - The name or ID of the label requested.
2046
+ * @param project - Project ID or project name
2047
+ * @param projectId - Project ID or project name.
2048
+ */
2049
+ async deletePullRequestLabels(repositoryId, pullRequestId, labelIdOrName, project, projectId) {
2050
+ const queryValues = {
2051
+ projectId: projectId
2052
+ };
2053
+ return this.beginRequest({
2054
+ apiVersion: "7.2-preview.1",
2055
+ method: "DELETE",
2056
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/labels/{labelIdOrName}",
2057
+ routeValues: {
2058
+ project: project,
2059
+ repositoryId: repositoryId,
2060
+ pullRequestId: pullRequestId,
2061
+ labelIdOrName: labelIdOrName
2062
+ },
2063
+ queryParams: queryValues
2064
+ });
2065
+ }
2066
+ /**
2067
+ * Retrieves a single label (tag) that has been assigned to a pull request.
2068
+ *
2069
+ * @param repositoryId - The repository ID of the pull request’s target branch.
2070
+ * @param pullRequestId - ID of the pull request.
2071
+ * @param labelIdOrName - The name or ID of the label requested.
2072
+ * @param project - Project ID or project name
2073
+ * @param projectId - Project ID or project name.
2074
+ */
2075
+ async getPullRequestLabel(repositoryId, pullRequestId, labelIdOrName, project, projectId) {
2076
+ const queryValues = {
2077
+ projectId: projectId
2078
+ };
2079
+ return this.beginRequest({
2080
+ apiVersion: "7.2-preview.1",
2081
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/labels/{labelIdOrName}",
2082
+ routeValues: {
2083
+ project: project,
2084
+ repositoryId: repositoryId,
2085
+ pullRequestId: pullRequestId,
2086
+ labelIdOrName: labelIdOrName
2087
+ },
2088
+ queryParams: queryValues
2089
+ });
2090
+ }
2091
+ /**
2092
+ * Get all the labels (tags) assigned to a pull request.
2093
+ *
2094
+ * @param repositoryId - The repository ID of the pull request’s target branch.
2095
+ * @param pullRequestId - ID of the pull request.
2096
+ * @param project - Project ID or project name
2097
+ * @param projectId - Project ID or project name.
2098
+ */
2099
+ async getPullRequestLabels(repositoryId, pullRequestId, project, projectId) {
2100
+ const queryValues = {
2101
+ projectId: projectId
2102
+ };
2103
+ return this.beginRequest({
2104
+ apiVersion: "7.2-preview.1",
2105
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/labels/{labelIdOrName}",
2106
+ routeValues: {
2107
+ project: project,
2108
+ repositoryId: repositoryId,
2109
+ pullRequestId: pullRequestId
2110
+ },
2111
+ queryParams: queryValues
2112
+ });
2113
+ }
2114
+ /**
2115
+ * Get external properties of the pull request.
2116
+ *
2117
+ * @param repositoryId - The repository ID of the pull request’s target branch.
2118
+ * @param pullRequestId - ID of the pull request.
2119
+ * @param project - Project ID or project name
2120
+ */
2121
+ async getPullRequestProperties(repositoryId, pullRequestId, project) {
2122
+ return this.beginRequest({
2123
+ apiVersion: "7.2-preview.1",
2124
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/properties",
2125
+ routeValues: {
2126
+ project: project,
2127
+ repositoryId: repositoryId,
2128
+ pullRequestId: pullRequestId
2129
+ }
2130
+ });
2131
+ }
2132
+ /**
2133
+ * 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.
2134
+ *
2135
+ * @param patchDocument - Properties to add, replace or remove in JSON Patch format.
2136
+ * @param repositoryId - The repository ID of the pull request’s target branch.
2137
+ * @param pullRequestId - ID of the pull request.
2138
+ * @param project - Project ID or project name
2139
+ */
2140
+ async updatePullRequestProperties(patchDocument, repositoryId, pullRequestId, project) {
2141
+ return this.beginRequest({
2142
+ apiVersion: "7.2-preview.1",
2143
+ method: "PATCH",
2144
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/properties",
2145
+ routeValues: {
2146
+ project: project,
2147
+ repositoryId: repositoryId,
2148
+ pullRequestId: pullRequestId
2149
+ },
2150
+ customHeaders: {
2151
+ "Content-Type": "application/json-patch+json",
2152
+ },
2153
+ body: patchDocument
2154
+ });
2155
+ }
2156
+ /**
2157
+ * 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.
2158
+ *
2159
+ * @param queries - The list of queries to perform.
2160
+ * @param repositoryId - ID of the repository.
2161
+ * @param project - Project ID or project name
2162
+ */
2163
+ async getPullRequestQuery(queries, repositoryId, project) {
2164
+ return this.beginRequest({
2165
+ apiVersion: "7.2-preview.1",
2166
+ method: "POST",
2167
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/PullRequestQuery",
2168
+ routeValues: {
2169
+ project: project,
2170
+ repositoryId: repositoryId
2171
+ },
2172
+ body: queries
2173
+ });
2174
+ }
2175
+ /**
2176
+ * Add a reviewer to a pull request or cast a vote.
2177
+ *
2178
+ * @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.
2179
+ * @param repositoryId - The repository ID of the pull request's target branch.
2180
+ * @param pullRequestId - ID of the pull request.
2181
+ * @param reviewerId - ID of the reviewer.
2182
+ * @param project - Project ID or project name
2183
+ */
2184
+ async createPullRequestReviewer(reviewer, repositoryId, pullRequestId, reviewerId, project) {
2185
+ return this.beginRequest({
2186
+ apiVersion: "7.2-preview.1",
2187
+ method: "PUT",
2188
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
2189
+ routeValues: {
2190
+ project: project,
2191
+ repositoryId: repositoryId,
2192
+ pullRequestId: pullRequestId,
2193
+ reviewerId: reviewerId
2194
+ },
2195
+ body: reviewer
2196
+ });
2197
+ }
2198
+ /**
2199
+ * Add reviewers to a pull request.
2200
+ *
2201
+ * @param reviewers - Reviewers to add to the pull request.
2202
+ * @param repositoryId - The repository ID of the pull request's target branch.
2203
+ * @param pullRequestId - ID of the pull request.
2204
+ * @param project - Project ID or project name
2205
+ */
2206
+ async createPullRequestReviewers(reviewers, repositoryId, pullRequestId, project) {
2207
+ return this.beginRequest({
2208
+ apiVersion: "7.2-preview.1",
2209
+ method: "POST",
2210
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
2211
+ routeValues: {
2212
+ project: project,
2213
+ repositoryId: repositoryId,
2214
+ pullRequestId: pullRequestId
2215
+ },
2216
+ body: reviewers
2217
+ });
2218
+ }
2219
+ /**
2220
+ * Add an unmaterialized identity to the reviewers of a pull request.
2221
+ *
2222
+ * @param reviewer - Reviewer to add to the pull request.
2223
+ * @param repositoryId - The repository ID of the pull request's target branch.
2224
+ * @param pullRequestId - ID of the pull request.
2225
+ * @param project - Project ID or project name
2226
+ */
2227
+ async createUnmaterializedPullRequestReviewer(reviewer, repositoryId, pullRequestId, project) {
2228
+ return this.beginRequest({
2229
+ apiVersion: "7.2-preview.1",
2230
+ method: "PUT",
2231
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
2232
+ routeValues: {
2233
+ project: project,
2234
+ repositoryId: repositoryId,
2235
+ pullRequestId: pullRequestId
2236
+ },
2237
+ body: reviewer
2238
+ });
2239
+ }
2240
+ /**
2241
+ * Remove a reviewer from a pull request.
2242
+ *
2243
+ * @param repositoryId - The repository ID of the pull request's target branch.
2244
+ * @param pullRequestId - ID of the pull request.
2245
+ * @param reviewerId - ID of the reviewer to remove.
2246
+ * @param project - Project ID or project name
2247
+ */
2248
+ async deletePullRequestReviewer(repositoryId, pullRequestId, reviewerId, project) {
2249
+ return this.beginRequest({
2250
+ apiVersion: "7.2-preview.1",
2251
+ method: "DELETE",
2252
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
2253
+ routeValues: {
2254
+ project: project,
2255
+ repositoryId: repositoryId,
2256
+ pullRequestId: pullRequestId,
2257
+ reviewerId: reviewerId
2258
+ }
2259
+ });
2260
+ }
2261
+ /**
2262
+ * Retrieve information about a particular reviewer on a pull request
2263
+ *
2264
+ * @param repositoryId - The repository ID of the pull request's target branch.
2265
+ * @param pullRequestId - ID of the pull request.
2266
+ * @param reviewerId - ID of the reviewer.
2267
+ * @param project - Project ID or project name
2268
+ */
2269
+ async getPullRequestReviewer(repositoryId, pullRequestId, reviewerId, project) {
2270
+ return this.beginRequest({
2271
+ apiVersion: "7.2-preview.1",
2272
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
2273
+ routeValues: {
2274
+ project: project,
2275
+ repositoryId: repositoryId,
2276
+ pullRequestId: pullRequestId,
2277
+ reviewerId: reviewerId
2278
+ }
2279
+ });
2280
+ }
2281
+ /**
2282
+ * Retrieve the reviewers for a pull request
2283
+ *
2284
+ * @param repositoryId - The repository ID of the pull request's target branch.
2285
+ * @param pullRequestId - ID of the pull request.
2286
+ * @param project - Project ID or project name
2287
+ */
2288
+ async getPullRequestReviewers(repositoryId, pullRequestId, project) {
2289
+ return this.beginRequest({
2290
+ apiVersion: "7.2-preview.1",
2291
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
2292
+ routeValues: {
2293
+ project: project,
2294
+ repositoryId: repositoryId,
2295
+ pullRequestId: pullRequestId
2296
+ }
2297
+ });
2298
+ }
2299
+ /**
2300
+ * Edit a reviewer entry. These fields are patchable: isFlagged, hasDeclined
2301
+ *
2302
+ * @param reviewer - Reviewer data.\<br /\>If the reviewer's ID is included here, it must match the reviewerID parameter.
2303
+ * @param repositoryId - The repository ID of the pull request's target branch.
2304
+ * @param pullRequestId - ID of the pull request.
2305
+ * @param reviewerId - ID of the reviewer.
2306
+ * @param project - Project ID or project name
2307
+ */
2308
+ async updatePullRequestReviewer(reviewer, repositoryId, pullRequestId, reviewerId, project) {
2309
+ return this.beginRequest({
2310
+ apiVersion: "7.2-preview.1",
2311
+ method: "PATCH",
2312
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
2313
+ routeValues: {
2314
+ project: project,
2315
+ repositoryId: repositoryId,
2316
+ pullRequestId: pullRequestId,
2317
+ reviewerId: reviewerId
2318
+ },
2319
+ body: reviewer
2320
+ });
2321
+ }
2322
+ /**
2323
+ * 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.
2324
+ *
2325
+ * @param patchVotes - IDs of the reviewers whose votes will be reset to zero
2326
+ * @param repositoryId - The repository ID of the pull request's target branch.
2327
+ * @param pullRequestId - ID of the pull request
2328
+ * @param project - Project ID or project name
2329
+ */
2330
+ async updatePullRequestReviewers(patchVotes, repositoryId, pullRequestId, project) {
2331
+ return this.beginRequest({
2332
+ apiVersion: "7.2-preview.1",
2333
+ method: "PATCH",
2334
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}",
2335
+ routeValues: {
2336
+ project: project,
2337
+ repositoryId: repositoryId,
2338
+ pullRequestId: pullRequestId
2339
+ },
2340
+ body: patchVotes
2341
+ });
2342
+ }
2343
+ /**
2344
+ * Retrieve a pull request.
2345
+ *
2346
+ * @param pullRequestId - The ID of the pull request to retrieve.
2347
+ * @param project - Project ID or project name
2348
+ */
2349
+ async getPullRequestById(pullRequestId, project) {
2350
+ return this.beginRequest({
2351
+ apiVersion: "7.2-preview.2",
2352
+ routeTemplate: "{project}/_apis/git/pullRequests/{pullRequestId}",
2353
+ routeValues: {
2354
+ project: project,
2355
+ pullRequestId: pullRequestId
2356
+ }
2357
+ });
2358
+ }
2359
+ /**
2360
+ * Retrieve all pull requests matching a specified criteria.
2361
+ *
2362
+ * @param project - Project ID or project name
2363
+ * @param searchCriteria - Pull requests will be returned that match this search criteria.
2364
+ * @param maxCommentLength - Not used.
2365
+ * @param skip - The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100.
2366
+ * @param top - The number of pull requests to retrieve.
2367
+ */
2368
+ async getPullRequestsByProject(project, searchCriteria, maxCommentLength, skip, top) {
2369
+ const queryValues = {
2370
+ searchCriteria: searchCriteria,
2371
+ maxCommentLength: maxCommentLength,
2372
+ '$skip': skip,
2373
+ '$top': top
2374
+ };
2375
+ return this.beginRequest({
2376
+ apiVersion: "7.2-preview.2",
2377
+ routeTemplate: "{project}/_apis/git/pullRequests",
2378
+ routeValues: {
2379
+ project: project
2380
+ },
2381
+ queryParams: queryValues
2382
+ });
2383
+ }
2384
+ /**
2385
+ * Create a pull request.
2386
+ *
2387
+ * @param gitPullRequestToCreate - The pull request to create.
2388
+ * @param repositoryId - The repository ID of the pull request's target branch.
2389
+ * @param project - Project ID or project name
2390
+ * @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.
2391
+ */
2392
+ async createPullRequest(gitPullRequestToCreate, repositoryId, project, supportsIterations) {
2393
+ const queryValues = {
2394
+ supportsIterations: supportsIterations
2395
+ };
2396
+ return this.beginRequest({
2397
+ apiVersion: "7.2-preview.2",
2398
+ method: "POST",
2399
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}",
2400
+ routeValues: {
2401
+ project: project,
2402
+ repositoryId: repositoryId
2403
+ },
2404
+ queryParams: queryValues,
2405
+ body: gitPullRequestToCreate
2406
+ });
2407
+ }
2408
+ /**
2409
+ * Retrieve a pull request.
2410
+ *
2411
+ * @param repositoryId - The repository ID of the pull request's target branch.
2412
+ * @param pullRequestId - The ID of the pull request to retrieve.
2413
+ * @param project - Project ID or project name
2414
+ * @param maxCommentLength - Not used.
2415
+ * @param skip - Not used.
2416
+ * @param top - Not used.
2417
+ * @param includeCommits - If true, the pull request will be returned with the associated commits.
2418
+ * @param includeWorkItemRefs - If true, the pull request will be returned with the associated work item references.
2419
+ */
2420
+ async getPullRequest(repositoryId, pullRequestId, project, maxCommentLength, skip, top, includeCommits, includeWorkItemRefs) {
2421
+ const queryValues = {
2422
+ maxCommentLength: maxCommentLength,
2423
+ '$skip': skip,
2424
+ '$top': top,
2425
+ includeCommits: includeCommits,
2426
+ includeWorkItemRefs: includeWorkItemRefs
2427
+ };
2428
+ return this.beginRequest({
2429
+ apiVersion: "7.2-preview.2",
2430
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}",
2431
+ routeValues: {
2432
+ project: project,
2433
+ repositoryId: repositoryId,
2434
+ pullRequestId: pullRequestId
2435
+ },
2436
+ queryParams: queryValues
2437
+ });
2438
+ }
2439
+ /**
2440
+ * Retrieve all pull requests matching a specified criteria.
2441
+ *
2442
+ * @param repositoryId - The repository ID of the pull request's target branch.
2443
+ * @param searchCriteria - Pull requests will be returned that match this search criteria.
2444
+ * @param project - Project ID or project name
2445
+ * @param maxCommentLength - Not used.
2446
+ * @param skip - The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100.
2447
+ * @param top - The number of pull requests to retrieve.
2448
+ */
2449
+ async getPullRequests(repositoryId, searchCriteria, project, maxCommentLength, skip, top) {
2450
+ const queryValues = {
2451
+ searchCriteria: searchCriteria,
2452
+ maxCommentLength: maxCommentLength,
2453
+ '$skip': skip,
2454
+ '$top': top
2455
+ };
2456
+ return this.beginRequest({
2457
+ apiVersion: "7.2-preview.2",
2458
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}",
2459
+ routeValues: {
2460
+ project: project,
2461
+ repositoryId: repositoryId
2462
+ },
2463
+ queryParams: queryValues
2464
+ });
2465
+ }
2466
+ /**
2467
+ * Update a pull request
2468
+ *
2469
+ * @param gitPullRequestToUpdate - The pull request content that should be updated.
2470
+ * @param repositoryId - The repository ID of the pull request's target branch.
2471
+ * @param pullRequestId - ID of the pull request to update.
2472
+ * @param project - Project ID or project name
2473
+ */
2474
+ async updatePullRequest(gitPullRequestToUpdate, repositoryId, pullRequestId, project) {
2475
+ return this.beginRequest({
2476
+ apiVersion: "7.2-preview.2",
2477
+ method: "PATCH",
2478
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}",
2479
+ routeValues: {
2480
+ project: project,
2481
+ repositoryId: repositoryId,
2482
+ pullRequestId: pullRequestId
2483
+ },
2484
+ body: gitPullRequestToUpdate
2485
+ });
2486
+ }
2487
+ /**
2488
+ * Sends an e-mail notification about a specific pull request to a set of recipients
2489
+ *
2490
+ * @param userMessage -
2491
+ * @param repositoryId - ID of the git repository.
2492
+ * @param pullRequestId - ID of the pull request.
2493
+ * @param project - Project ID or project name
2494
+ */
2495
+ async sharePullRequest(userMessage, repositoryId, pullRequestId, project) {
2496
+ return this.beginRequest({
2497
+ apiVersion: "7.2-preview.1",
2498
+ method: "POST",
2499
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/share",
2500
+ routeValues: {
2501
+ project: project,
2502
+ repositoryId: repositoryId,
2503
+ pullRequestId: pullRequestId
2504
+ },
2505
+ body: userMessage
2506
+ });
2507
+ }
2508
+ /**
2509
+ * Create a pull request status.
2510
+ *
2511
+ * @param status - Pull request status to create.
2512
+ * @param repositoryId - The repository ID of the pull request’s target branch.
2513
+ * @param pullRequestId - ID of the pull request.
2514
+ * @param project - Project ID or project name
2515
+ */
2516
+ async createPullRequestStatus(status, repositoryId, pullRequestId, project) {
2517
+ return this.beginRequest({
2518
+ apiVersion: "7.2-preview.2",
2519
+ method: "POST",
2520
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}",
2521
+ routeValues: {
2522
+ project: project,
2523
+ repositoryId: repositoryId,
2524
+ pullRequestId: pullRequestId
2525
+ },
2526
+ body: status
2527
+ });
2528
+ }
2529
+ /**
2530
+ * Delete pull request status.
2531
+ *
2532
+ * @param repositoryId - The repository ID of the pull request’s target branch.
2533
+ * @param pullRequestId - ID of the pull request.
2534
+ * @param statusId - ID of the pull request status.
2535
+ * @param project - Project ID or project name
2536
+ */
2537
+ async deletePullRequestStatus(repositoryId, pullRequestId, statusId, project) {
2538
+ return this.beginRequest({
2539
+ apiVersion: "7.2-preview.2",
2540
+ method: "DELETE",
2541
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}",
2542
+ routeValues: {
2543
+ project: project,
2544
+ repositoryId: repositoryId,
2545
+ pullRequestId: pullRequestId,
2546
+ statusId: statusId
2547
+ }
2548
+ });
2549
+ }
2550
+ /**
2551
+ * Get the specific pull request status by ID. The status ID is unique within the pull request across all iterations.
2552
+ *
2553
+ * @param repositoryId - The repository ID of the pull request’s target branch.
2554
+ * @param pullRequestId - ID of the pull request.
2555
+ * @param statusId - ID of the pull request status.
2556
+ * @param project - Project ID or project name
2557
+ */
2558
+ async getPullRequestStatus(repositoryId, pullRequestId, statusId, project) {
2559
+ return this.beginRequest({
2560
+ apiVersion: "7.2-preview.2",
2561
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}",
2562
+ routeValues: {
2563
+ project: project,
2564
+ repositoryId: repositoryId,
2565
+ pullRequestId: pullRequestId,
2566
+ statusId: statusId
2567
+ }
2568
+ });
2569
+ }
2570
+ /**
2571
+ * Get all the statuses associated with a pull request.
2572
+ *
2573
+ * @param repositoryId - The repository ID of the pull request’s target branch.
2574
+ * @param pullRequestId - ID of the pull request.
2575
+ * @param project - Project ID or project name
2576
+ */
2577
+ async getPullRequestStatuses(repositoryId, pullRequestId, project) {
2578
+ return this.beginRequest({
2579
+ apiVersion: "7.2-preview.2",
2580
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}",
2581
+ routeValues: {
2582
+ project: project,
2583
+ repositoryId: repositoryId,
2584
+ pullRequestId: pullRequestId
2585
+ }
2586
+ });
2587
+ }
2588
+ /**
2589
+ * Update pull request statuses collection. The only supported operation type is \`remove\`.
2590
+ *
2591
+ * @param patchDocument - Operations to apply to the pull request statuses in JSON Patch format.
2592
+ * @param repositoryId - The repository ID of the pull request’s target branch.
2593
+ * @param pullRequestId - ID of the pull request.
2594
+ * @param project - Project ID or project name
2595
+ */
2596
+ async updatePullRequestStatuses(patchDocument, repositoryId, pullRequestId, project) {
2597
+ return this.beginRequest({
2598
+ apiVersion: "7.2-preview.2",
2599
+ method: "PATCH",
2600
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}",
2601
+ routeValues: {
2602
+ project: project,
2603
+ repositoryId: repositoryId,
2604
+ pullRequestId: pullRequestId
2605
+ },
2606
+ customHeaders: {
2607
+ "Content-Type": "application/json-patch+json",
2608
+ },
2609
+ body: patchDocument
2610
+ });
2611
+ }
2612
+ /**
2613
+ * Create a comment on a specific thread in a pull request (up to 500 comments can be created per thread).
2614
+ *
2615
+ * @param comment - The comment to create. Comments can be up to 150,000 characters.
2616
+ * @param repositoryId - The repository ID of the pull request's target branch.
2617
+ * @param pullRequestId - ID of the pull request.
2618
+ * @param threadId - ID of the thread that the desired comment is in.
2619
+ * @param project - Project ID or project name
2620
+ */
2621
+ async createComment(comment, repositoryId, pullRequestId, threadId, project) {
2622
+ return this.beginRequest({
2623
+ apiVersion: "7.2-preview.1",
2624
+ method: "POST",
2625
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}",
2626
+ routeValues: {
2627
+ project: project,
2628
+ repositoryId: repositoryId,
2629
+ pullRequestId: pullRequestId,
2630
+ threadId: threadId
2631
+ },
2632
+ body: comment
2633
+ });
2634
+ }
2635
+ /**
2636
+ * Delete a comment associated with a specific thread in a pull request.
2637
+ *
2638
+ * @param repositoryId - The repository ID of the pull request's target branch.
2639
+ * @param pullRequestId - ID of the pull request.
2640
+ * @param threadId - ID of the thread that the desired comment is in.
2641
+ * @param commentId - ID of the comment.
2642
+ * @param project - Project ID or project name
2643
+ */
2644
+ async deleteComment(repositoryId, pullRequestId, threadId, commentId, project) {
2645
+ return this.beginRequest({
2646
+ apiVersion: "7.2-preview.1",
2647
+ method: "DELETE",
2648
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}",
2649
+ routeValues: {
2650
+ project: project,
2651
+ repositoryId: repositoryId,
2652
+ pullRequestId: pullRequestId,
2653
+ threadId: threadId,
2654
+ commentId: commentId
2655
+ }
2656
+ });
2657
+ }
2658
+ /**
2659
+ * Retrieve a comment associated with a specific thread in a pull request.
2660
+ *
2661
+ * @param repositoryId - The repository ID of the pull request's target branch.
2662
+ * @param pullRequestId - ID of the pull request.
2663
+ * @param threadId - ID of the thread that the desired comment is in.
2664
+ * @param commentId - ID of the comment.
2665
+ * @param project - Project ID or project name
2666
+ */
2667
+ async getComment(repositoryId, pullRequestId, threadId, commentId, project) {
2668
+ return this.beginRequest({
2669
+ apiVersion: "7.2-preview.1",
2670
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}",
2671
+ routeValues: {
2672
+ project: project,
2673
+ repositoryId: repositoryId,
2674
+ pullRequestId: pullRequestId,
2675
+ threadId: threadId,
2676
+ commentId: commentId
2677
+ }
2678
+ });
2679
+ }
2680
+ /**
2681
+ * Retrieve all comments associated with a specific thread in a pull request.
2682
+ *
2683
+ * @param repositoryId - The repository ID of the pull request's target branch.
2684
+ * @param pullRequestId - ID of the pull request.
2685
+ * @param threadId - ID of the thread.
2686
+ * @param project - Project ID or project name
2687
+ */
2688
+ async getComments(repositoryId, pullRequestId, threadId, project) {
2689
+ return this.beginRequest({
2690
+ apiVersion: "7.2-preview.1",
2691
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}",
2692
+ routeValues: {
2693
+ project: project,
2694
+ repositoryId: repositoryId,
2695
+ pullRequestId: pullRequestId,
2696
+ threadId: threadId
2697
+ }
2698
+ });
2699
+ }
2700
+ /**
2701
+ * Update a comment associated with a specific thread in a pull request.
2702
+ *
2703
+ * @param comment - The comment content that should be updated. Comments can be up to 150,000 characters.
2704
+ * @param repositoryId - The repository ID of the pull request's target branch.
2705
+ * @param pullRequestId - ID of the pull request.
2706
+ * @param threadId - ID of the thread that the desired comment is in.
2707
+ * @param commentId - ID of the comment to update.
2708
+ * @param project - Project ID or project name
2709
+ */
2710
+ async updateComment(comment, repositoryId, pullRequestId, threadId, commentId, project) {
2711
+ return this.beginRequest({
2712
+ apiVersion: "7.2-preview.1",
2713
+ method: "PATCH",
2714
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}/comments/{commentId}",
2715
+ routeValues: {
2716
+ project: project,
2717
+ repositoryId: repositoryId,
2718
+ pullRequestId: pullRequestId,
2719
+ threadId: threadId,
2720
+ commentId: commentId
2721
+ },
2722
+ body: comment
2723
+ });
2724
+ }
2725
+ /**
2726
+ * Create a thread in a pull request.
2727
+ *
2728
+ * @param commentThread - The thread to create. Thread must contain at least one comment.
2729
+ * @param repositoryId - Repository ID of the pull request's target branch.
2730
+ * @param pullRequestId - ID of the pull request.
2731
+ * @param project - Project ID or project name
2732
+ */
2733
+ async createThread(commentThread, repositoryId, pullRequestId, project) {
2734
+ return this.beginRequest({
2735
+ apiVersion: "7.2-preview.1",
2736
+ method: "POST",
2737
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}",
2738
+ routeValues: {
2739
+ project: project,
2740
+ repositoryId: repositoryId,
2741
+ pullRequestId: pullRequestId
2742
+ },
2743
+ body: commentThread
2744
+ });
2745
+ }
2746
+ /**
2747
+ * Retrieve a thread in a pull request.
2748
+ *
2749
+ * @param repositoryId - The repository ID of the pull request's target branch.
2750
+ * @param pullRequestId - ID of the pull request.
2751
+ * @param threadId - ID of the thread.
2752
+ * @param project - Project ID or project name
2753
+ * @param iteration - If specified, thread position will be tracked using this iteration as the right side of the diff.
2754
+ * @param baseIteration - If specified, thread position will be tracked using this iteration as the left side of the diff.
2755
+ */
2756
+ async getPullRequestThread(repositoryId, pullRequestId, threadId, project, iteration, baseIteration) {
2757
+ const queryValues = {
2758
+ '$iteration': iteration,
2759
+ '$baseIteration': baseIteration
2760
+ };
2761
+ return this.beginRequest({
2762
+ apiVersion: "7.2-preview.1",
2763
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}",
2764
+ routeValues: {
2765
+ project: project,
2766
+ repositoryId: repositoryId,
2767
+ pullRequestId: pullRequestId,
2768
+ threadId: threadId
2769
+ },
2770
+ queryParams: queryValues
2771
+ });
2772
+ }
2773
+ /**
2774
+ * Retrieve all threads in a pull request.
2775
+ *
2776
+ * @param repositoryId - The repository ID of the pull request's target branch.
2777
+ * @param pullRequestId - ID of the pull request.
2778
+ * @param project - Project ID or project name
2779
+ * @param iteration - If specified, thread positions will be tracked using this iteration as the right side of the diff.
2780
+ * @param baseIteration - If specified, thread positions will be tracked using this iteration as the left side of the diff.
2781
+ */
2782
+ async getThreads(repositoryId, pullRequestId, project, iteration, baseIteration) {
2783
+ const queryValues = {
2784
+ '$iteration': iteration,
2785
+ '$baseIteration': baseIteration
2786
+ };
2787
+ return this.beginRequest({
2788
+ apiVersion: "7.2-preview.1",
2789
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}",
2790
+ routeValues: {
2791
+ project: project,
2792
+ repositoryId: repositoryId,
2793
+ pullRequestId: pullRequestId
2794
+ },
2795
+ queryParams: queryValues
2796
+ });
2797
+ }
2798
+ /**
2799
+ * Update a thread in a pull request.
2800
+ *
2801
+ * @param commentThread - The thread content that should be updated.
2802
+ * @param repositoryId - The repository ID of the pull request's target branch.
2803
+ * @param pullRequestId - ID of the pull request.
2804
+ * @param threadId - ID of the thread to update.
2805
+ * @param project - Project ID or project name
2806
+ */
2807
+ async updateThread(commentThread, repositoryId, pullRequestId, threadId, project) {
2808
+ return this.beginRequest({
2809
+ apiVersion: "7.2-preview.1",
2810
+ method: "PATCH",
2811
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}",
2812
+ routeValues: {
2813
+ project: project,
2814
+ repositoryId: repositoryId,
2815
+ pullRequestId: pullRequestId,
2816
+ threadId: threadId
2817
+ },
2818
+ body: commentThread
2819
+ });
2820
+ }
2821
+ /**
2822
+ * Retrieve a list of work items associated with a pull request.
2823
+ *
2824
+ * @param repositoryId - ID or name of the repository.
2825
+ * @param pullRequestId - ID of the pull request.
2826
+ * @param project - Project ID or project name
2827
+ */
2828
+ async getPullRequestWorkItemRefs(repositoryId, pullRequestId, project) {
2829
+ return this.beginRequest({
2830
+ apiVersion: "7.2-preview.1",
2831
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/workitems",
2832
+ routeValues: {
2833
+ project: project,
2834
+ repositoryId: repositoryId,
2835
+ pullRequestId: pullRequestId
2836
+ }
2837
+ });
2838
+ }
2839
+ /**
2840
+ * Push changes to the repository.
2841
+ *
2842
+ * @param push -
2843
+ * @param repositoryId - The name or ID of the repository.
2844
+ * @param project - Project ID or project name
2845
+ */
2846
+ async createPush(push, repositoryId, project) {
2847
+ return this.beginRequest({
2848
+ apiVersion: "7.2-preview.3",
2849
+ method: "POST",
2850
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pushes/{pushId}",
2851
+ routeValues: {
2852
+ project: project,
2853
+ repositoryId: repositoryId
2854
+ },
2855
+ body: push
2856
+ });
2857
+ }
2858
+ /**
2859
+ * Retrieves a particular push.
2860
+ *
2861
+ * @param repositoryId - The name or ID of the repository.
2862
+ * @param pushId - ID of the push.
2863
+ * @param project - Project ID or project name
2864
+ * @param includeCommits - The number of commits to include in the result.
2865
+ * @param includeRefUpdates - If true, include the list of refs that were updated by the push.
2866
+ */
2867
+ async getPush(repositoryId, pushId, project, includeCommits, includeRefUpdates) {
2868
+ const queryValues = {
2869
+ includeCommits: includeCommits,
2870
+ includeRefUpdates: includeRefUpdates
2871
+ };
2872
+ return this.beginRequest({
2873
+ apiVersion: "7.2-preview.3",
2874
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pushes/{pushId}",
2875
+ routeValues: {
2876
+ project: project,
2877
+ repositoryId: repositoryId,
2878
+ pushId: pushId
2879
+ },
2880
+ queryParams: queryValues
2881
+ });
2882
+ }
2883
+ /**
2884
+ * Retrieves pushes associated with the specified repository.
2885
+ *
2886
+ * @param repositoryId - The name or ID of the repository.
2887
+ * @param project - Project ID or project name
2888
+ * @param skip - Number of pushes to skip.
2889
+ * @param top - Number of pushes to return.
2890
+ * @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.
2891
+ */
2892
+ async getPushes(repositoryId, project, skip, top, searchCriteria) {
2893
+ const queryValues = {
2894
+ '$skip': skip,
2895
+ '$top': top,
2896
+ searchCriteria: searchCriteria
2897
+ };
2898
+ return this.beginRequest({
2899
+ apiVersion: "7.2-preview.3",
2900
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/pushes/{pushId}",
2901
+ routeValues: {
2902
+ project: project,
2903
+ repositoryId: repositoryId
2904
+ },
2905
+ queryParams: queryValues
2906
+ });
2907
+ }
2908
+ /**
2909
+ * Destroy (hard delete) a soft-deleted Git repository.
2910
+ *
2911
+ * @param project - Project ID or project name
2912
+ * @param repositoryId - The ID of the repository.
2913
+ */
2914
+ async deleteRepositoryFromRecycleBin(project, repositoryId) {
2915
+ return this.beginRequest({
2916
+ apiVersion: "7.2-preview.1",
2917
+ method: "DELETE",
2918
+ routeTemplate: "{project}/_apis/git/recycleBin/repositories/{repositoryId}",
2919
+ routeValues: {
2920
+ project: project,
2921
+ repositoryId: repositoryId
2922
+ }
2923
+ });
2924
+ }
2925
+ /**
2926
+ * Retrieve soft-deleted git repositories from the recycle bin.
2927
+ *
2928
+ * @param project - Project ID or project name
2929
+ */
2930
+ async getRecycleBinRepositories(project) {
2931
+ return this.beginRequest({
2932
+ apiVersion: "7.2-preview.1",
2933
+ routeTemplate: "{project}/_apis/git/recycleBin/repositories/{repositoryId}",
2934
+ routeValues: {
2935
+ project: project
2936
+ }
2937
+ });
2938
+ }
2939
+ /**
2940
+ * 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.
2941
+ *
2942
+ * @param repositoryDetails -
2943
+ * @param project - Project ID or project name
2944
+ * @param repositoryId - The ID of the repository.
2945
+ */
2946
+ async restoreRepositoryFromRecycleBin(repositoryDetails, project, repositoryId) {
2947
+ return this.beginRequest({
2948
+ apiVersion: "7.2-preview.1",
2949
+ method: "PATCH",
2950
+ routeTemplate: "{project}/_apis/git/recycleBin/repositories/{repositoryId}",
2951
+ routeValues: {
2952
+ project: project,
2953
+ repositoryId: repositoryId
2954
+ },
2955
+ body: repositoryDetails
2956
+ });
2957
+ }
2958
+ /**
2959
+ * Queries the provided repository for its refs and returns them.
2960
+ *
2961
+ * @param repositoryId - The name or ID of the repository.
2962
+ * @param project - Project ID or project name
2963
+ * @param filter - [optional] A filter to apply to the refs (starts with).
2964
+ * @param includeLinks - [optional] Specifies if referenceLinks should be included in the result. default is false.
2965
+ * @param includeStatuses - [optional] Includes up to the first 1000 commit statuses for each ref. The default value is false.
2966
+ * @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.
2967
+ * @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.
2968
+ * @param peelTags - [optional] Annotated tags will populate the PeeledObjectId property. default is false.
2969
+ * @param filterContains - [optional] A filter to apply to the refs (contains).
2970
+ * @param includeTargetBranches - [optional] Includes target branches defined by patterns in pull_request_targets.yml.
2971
+ */
2972
+ async getRefs(repositoryId, project, filter, includeLinks, includeStatuses, includeMyBranches, latestStatusesOnly, peelTags, filterContains, includeTargetBranches) {
2973
+ const queryValues = {
2974
+ filter: filter,
2975
+ includeLinks: includeLinks,
2976
+ includeStatuses: includeStatuses,
2977
+ includeMyBranches: includeMyBranches,
2978
+ latestStatusesOnly: latestStatusesOnly,
2979
+ peelTags: peelTags,
2980
+ filterContains: filterContains,
2981
+ includeTargetBranches: includeTargetBranches
2982
+ };
2983
+ return this.beginRequest({
2984
+ apiVersion: "7.2-preview.2",
2985
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/refs/{*filter}",
2986
+ routeValues: {
2987
+ project: project,
2988
+ repositoryId: repositoryId
2989
+ },
2990
+ queryParams: queryValues,
2991
+ returnRawResponse: true
2992
+ }).then(async (response) => {
2993
+ const body = await response.text().then(deserializeVssJsonObject);
2994
+ body.continuationToken = response.headers.get("x-ms-continuationtoken");
2995
+ return body;
2996
+ });
2997
+ }
2998
+ /**
2999
+ * Lock or Unlock a branch.
3000
+ *
3001
+ * @param newRefInfo - The ref update action (lock/unlock) to perform
3002
+ * @param repositoryId - The name or ID of the repository.
3003
+ * @param filter - The name of the branch to lock/unlock
3004
+ * @param project - Project ID or project name
3005
+ * @param projectId - ID or name of the team project. Optional if specifying an ID for repository.
3006
+ */
3007
+ async updateRef(newRefInfo, repositoryId, filter, project, projectId) {
3008
+ const queryValues = {
3009
+ filter: filter,
3010
+ projectId: projectId
3011
+ };
3012
+ return this.beginRequest({
3013
+ apiVersion: "7.2-preview.2",
3014
+ method: "PATCH",
3015
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/refs/{*filter}",
3016
+ routeValues: {
3017
+ project: project,
3018
+ repositoryId: repositoryId
3019
+ },
3020
+ queryParams: queryValues,
3021
+ body: newRefInfo
3022
+ });
3023
+ }
3024
+ /**
3025
+ * Creating, updating, or deleting refs(branches).
3026
+ *
3027
+ * @param refUpdates - List of ref updates to attempt to perform
3028
+ * @param repositoryId - The name or ID of the repository.
3029
+ * @param project - Project ID or project name
3030
+ * @param projectId - ID or name of the team project. Optional if specifying an ID for repository.
3031
+ */
3032
+ async updateRefs(refUpdates, repositoryId, project, projectId) {
3033
+ const queryValues = {
3034
+ projectId: projectId
3035
+ };
3036
+ return this.beginRequest({
3037
+ apiVersion: "7.2-preview.2",
3038
+ method: "POST",
3039
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/refs/{*filter}",
3040
+ routeValues: {
3041
+ project: project,
3042
+ repositoryId: repositoryId
3043
+ },
3044
+ queryParams: queryValues,
3045
+ body: refUpdates
3046
+ });
3047
+ }
3048
+ /**
3049
+ * Creates a ref favorite
3050
+ *
3051
+ * @param favorite - The ref favorite to create.
3052
+ * @param project - Project ID or project name
3053
+ */
3054
+ async createFavorite(favorite, project) {
3055
+ return this.beginRequest({
3056
+ apiVersion: "7.2-preview.1",
3057
+ method: "POST",
3058
+ routeTemplate: "{project}/_apis/git/favorites/refs/{favoriteId}",
3059
+ routeValues: {
3060
+ project: project
3061
+ },
3062
+ body: favorite
3063
+ });
3064
+ }
3065
+ /**
3066
+ * Deletes the refs favorite specified
3067
+ *
3068
+ * @param project - Project ID or project name
3069
+ * @param favoriteId - The Id of the ref favorite to delete.
3070
+ */
3071
+ async deleteRefFavorite(project, favoriteId) {
3072
+ return this.beginRequest({
3073
+ apiVersion: "7.2-preview.1",
3074
+ method: "DELETE",
3075
+ routeTemplate: "{project}/_apis/git/favorites/refs/{favoriteId}",
3076
+ routeValues: {
3077
+ project: project,
3078
+ favoriteId: favoriteId
3079
+ }
3080
+ });
3081
+ }
3082
+ /**
3083
+ * Gets the refs favorite for a favorite Id.
3084
+ *
3085
+ * @param project - Project ID or project name
3086
+ * @param favoriteId - The Id of the requested ref favorite.
3087
+ */
3088
+ async getRefFavorite(project, favoriteId) {
3089
+ return this.beginRequest({
3090
+ apiVersion: "7.2-preview.1",
3091
+ routeTemplate: "{project}/_apis/git/favorites/refs/{favoriteId}",
3092
+ routeValues: {
3093
+ project: project,
3094
+ favoriteId: favoriteId
3095
+ }
3096
+ });
3097
+ }
3098
+ /**
3099
+ * Gets the refs favorites for a repo and an identity.
3100
+ *
3101
+ * @param project - Project ID or project name
3102
+ * @param repositoryId - The id of the repository.
3103
+ * @param identityId - The id of the identity whose favorites are to be retrieved. If null, the requesting identity is used.
3104
+ */
3105
+ async getRefFavorites(project, repositoryId, identityId) {
3106
+ const queryValues = {
3107
+ repositoryId: repositoryId,
3108
+ identityId: identityId
3109
+ };
3110
+ return this.beginRequest({
3111
+ apiVersion: "7.2-preview.1",
3112
+ routeTemplate: "{project}/_apis/git/favorites/refs/{favoriteId}",
3113
+ routeValues: {
3114
+ project: project
3115
+ },
3116
+ queryParams: queryValues
3117
+ });
3118
+ }
3119
+ /**
3120
+ * @param project - Project ID or project name
3121
+ * @param identityId -
3122
+ */
3123
+ async getRefFavoritesForProject(project, identityId) {
3124
+ const queryValues = {
3125
+ identityId: identityId
3126
+ };
3127
+ return this.beginRequest({
3128
+ apiVersion: "7.2-preview.1",
3129
+ routeTemplate: "{project}/_apis/git/favorites/refsForProject",
3130
+ routeValues: {
3131
+ project: project
3132
+ },
3133
+ queryParams: queryValues
3134
+ });
3135
+ }
3136
+ /**
3137
+ * Create a git repository in a team project.
3138
+ *
3139
+ * @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).
3140
+ * @param project - Project ID or project name
3141
+ * @param sourceRef - [optional] Specify the source refs to use while creating a fork repo
3142
+ */
3143
+ async createRepository(gitRepositoryToCreate, project, sourceRef) {
3144
+ const queryValues = {
3145
+ sourceRef: sourceRef
3146
+ };
3147
+ return this.beginRequest({
3148
+ apiVersion: "7.2-preview.2",
3149
+ method: "POST",
3150
+ routeTemplate: "{project}/_apis/git/Repositories/{repositoryId}",
3151
+ routeValues: {
3152
+ project: project
3153
+ },
3154
+ queryParams: queryValues,
3155
+ body: gitRepositoryToCreate
3156
+ });
3157
+ }
3158
+ /**
3159
+ * Delete a git repository
3160
+ *
3161
+ * @param repositoryId - The ID of the repository.
3162
+ * @param project - Project ID or project name
3163
+ */
3164
+ async deleteRepository(repositoryId, project) {
3165
+ return this.beginRequest({
3166
+ apiVersion: "7.2-preview.2",
3167
+ method: "DELETE",
3168
+ routeTemplate: "{project}/_apis/git/Repositories/{repositoryId}",
3169
+ routeValues: {
3170
+ project: project,
3171
+ repositoryId: repositoryId
3172
+ }
3173
+ });
3174
+ }
3175
+ /**
3176
+ * Retrieve git repositories.
3177
+ *
3178
+ * @param project - Project ID or project name
3179
+ * @param includeLinks - [optional] True to include reference links. The default value is false.
3180
+ * @param includeAllUrls - [optional] True to include all remote URLs. The default value is false.
3181
+ * @param includeHidden - [optional] True to include hidden repositories. The default value is false.
3182
+ */
3183
+ async getRepositories(project, includeLinks, includeAllUrls, includeHidden) {
3184
+ const queryValues = {
3185
+ includeLinks: includeLinks,
3186
+ includeAllUrls: includeAllUrls,
3187
+ includeHidden: includeHidden
3188
+ };
3189
+ return this.beginRequest({
3190
+ apiVersion: "7.2-preview.2",
3191
+ routeTemplate: "{project}/_apis/git/Repositories/{repositoryId}",
3192
+ routeValues: {
3193
+ project: project
3194
+ },
3195
+ queryParams: queryValues
3196
+ });
3197
+ }
3198
+ /**
3199
+ * Retrieve a git repository.
3200
+ *
3201
+ * @param repositoryId - The name or ID of the repository.
3202
+ * @param project - Project ID or project name
3203
+ */
3204
+ async getRepository(repositoryId, project) {
3205
+ return this.beginRequest({
3206
+ apiVersion: "7.2-preview.2",
3207
+ routeTemplate: "{project}/_apis/git/Repositories/{repositoryId}",
3208
+ routeValues: {
3209
+ project: project,
3210
+ repositoryId: repositoryId
3211
+ }
3212
+ });
3213
+ }
3214
+ /**
3215
+ * Retrieve a git repository.
3216
+ *
3217
+ * @param repositoryId - The name or ID of the repository.
3218
+ * @param includeParent - True to include parent repository. Only available in authenticated calls.
3219
+ * @param project - Project ID or project name
3220
+ */
3221
+ async getRepositoryWithParent(repositoryId, includeParent, project) {
3222
+ const queryValues = {
3223
+ includeParent: includeParent
3224
+ };
3225
+ return this.beginRequest({
3226
+ apiVersion: "7.2-preview.2",
3227
+ routeTemplate: "{project}/_apis/git/Repositories/{repositoryId}",
3228
+ routeValues: {
3229
+ project: project,
3230
+ repositoryId: repositoryId
3231
+ },
3232
+ queryParams: queryValues
3233
+ });
3234
+ }
3235
+ /**
3236
+ * Updates the Git repository with either a new repo name or a new default branch.
3237
+ *
3238
+ * @param newRepositoryInfo - Specify a new repo name or a new default branch of the repository
3239
+ * @param repositoryId - The ID of the repository.
3240
+ * @param project - Project ID or project name
3241
+ */
3242
+ async updateRepository(newRepositoryInfo, repositoryId, project) {
3243
+ return this.beginRequest({
3244
+ apiVersion: "7.2-preview.2",
3245
+ method: "PATCH",
3246
+ routeTemplate: "{project}/_apis/git/Repositories/{repositoryId}",
3247
+ routeValues: {
3248
+ project: project,
3249
+ repositoryId: repositoryId
3250
+ },
3251
+ body: newRepositoryInfo
3252
+ });
3253
+ }
3254
+ /**
3255
+ * Retrieve git repositories with filter by name and pagination.
3256
+ *
3257
+ * @param projectId - ID or name of the team project.
3258
+ * @param includeLinks - [optional] True to include reference links. The default value is false.
3259
+ * @param includeAllUrls - [optional] True to include all remote URLs. The default value is false.
3260
+ * @param includeHidden - [optional] True to include hidden repositories. The default value is false.
3261
+ * @param filterContains - [optional] A filter to apply to the refs (contains).
3262
+ * @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.
3263
+ * @param continuationToken - The continuation token used for pagination.
3264
+ */
3265
+ async getRepositoriesPaged(projectId, includeLinks, includeAllUrls, includeHidden, filterContains, top, continuationToken) {
3266
+ const queryValues = {
3267
+ includeLinks: includeLinks,
3268
+ includeAllUrls: includeAllUrls,
3269
+ includeHidden: includeHidden,
3270
+ filterContains: filterContains,
3271
+ '$top': top,
3272
+ continuationToken: continuationToken
3273
+ };
3274
+ return this.beginRequest({
3275
+ apiVersion: "7.2-preview.1",
3276
+ routeTemplate: "_apis/git/{projectId}/repositoriesPaged",
3277
+ routeValues: {
3278
+ projectId: projectId
3279
+ },
3280
+ queryParams: queryValues,
3281
+ returnRawResponse: true
3282
+ }).then(async (response) => {
3283
+ const body = await response.text().then(deserializeVssJsonObject);
3284
+ body.continuationToken = response.headers.get("x-ms-continuationtoken");
3285
+ return body;
3286
+ });
3287
+ }
3288
+ /**
3289
+ * Retrieve one conflict for a revert by ID
3290
+ *
3291
+ * @param repositoryId -
3292
+ * @param revertId -
3293
+ * @param conflictId -
3294
+ * @param project - Project ID or project name
3295
+ */
3296
+ async getRevertConflict(repositoryId, revertId, conflictId, project) {
3297
+ return this.beginRequest({
3298
+ apiVersion: "7.2-preview.1",
3299
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}/conflicts/{conflictId}",
3300
+ routeValues: {
3301
+ project: project,
3302
+ repositoryId: repositoryId,
3303
+ revertId: revertId,
3304
+ conflictId: conflictId
3305
+ }
3306
+ });
3307
+ }
3308
+ /**
3309
+ * Retrieve all conflicts for a revert
3310
+ *
3311
+ * @param repositoryId -
3312
+ * @param revertId -
3313
+ * @param project - Project ID or project name
3314
+ * @param continuationToken -
3315
+ * @param top -
3316
+ * @param excludeResolved -
3317
+ * @param onlyResolved -
3318
+ * @param includeObsolete -
3319
+ */
3320
+ async getRevertConflicts(repositoryId, revertId, project, continuationToken, top, excludeResolved, onlyResolved, includeObsolete) {
3321
+ const queryValues = {
3322
+ continuationToken: continuationToken,
3323
+ '$top': top,
3324
+ excludeResolved: excludeResolved,
3325
+ onlyResolved: onlyResolved,
3326
+ includeObsolete: includeObsolete
3327
+ };
3328
+ return this.beginRequest({
3329
+ apiVersion: "7.2-preview.1",
3330
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}/conflicts/{conflictId}",
3331
+ routeValues: {
3332
+ project: project,
3333
+ repositoryId: repositoryId,
3334
+ revertId: revertId
3335
+ },
3336
+ queryParams: queryValues,
3337
+ returnRawResponse: true
3338
+ }).then(async (response) => {
3339
+ const body = await response.text().then(deserializeVssJsonObject);
3340
+ body.continuationToken = response.headers.get("x-ms-continuationtoken");
3341
+ return body;
3342
+ });
3343
+ }
3344
+ /**
3345
+ * Update merge conflict resolution
3346
+ *
3347
+ * @param conflict -
3348
+ * @param repositoryId -
3349
+ * @param revertId -
3350
+ * @param conflictId -
3351
+ * @param project - Project ID or project name
3352
+ */
3353
+ async updateRevertConflict(conflict, repositoryId, revertId, conflictId, project) {
3354
+ return this.beginRequest({
3355
+ apiVersion: "7.2-preview.1",
3356
+ method: "PATCH",
3357
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}/conflicts/{conflictId}",
3358
+ routeValues: {
3359
+ project: project,
3360
+ repositoryId: repositoryId,
3361
+ revertId: revertId,
3362
+ conflictId: conflictId
3363
+ },
3364
+ body: conflict
3365
+ });
3366
+ }
3367
+ /**
3368
+ * Update multiple merge conflict resolutions
3369
+ *
3370
+ * @param conflictUpdates -
3371
+ * @param repositoryId -
3372
+ * @param revertId -
3373
+ * @param project - Project ID or project name
3374
+ */
3375
+ async updateRevertConflicts(conflictUpdates, repositoryId, revertId, project) {
3376
+ return this.beginRequest({
3377
+ apiVersion: "7.2-preview.1",
3378
+ method: "PATCH",
3379
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}/conflicts/{conflictId}",
3380
+ routeValues: {
3381
+ project: project,
3382
+ repositoryId: repositoryId,
3383
+ revertId: revertId
3384
+ },
3385
+ body: conflictUpdates
3386
+ });
3387
+ }
3388
+ /**
3389
+ * 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.
3390
+ *
3391
+ * @param revertToCreate -
3392
+ * @param project - Project ID or project name
3393
+ * @param repositoryId - ID of the repository.
3394
+ */
3395
+ async createRevert(revertToCreate, project, repositoryId) {
3396
+ return this.beginRequest({
3397
+ apiVersion: "7.2-preview.2",
3398
+ method: "POST",
3399
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}",
3400
+ routeValues: {
3401
+ project: project,
3402
+ repositoryId: repositoryId
3403
+ },
3404
+ body: revertToCreate
3405
+ });
3406
+ }
3407
+ /**
3408
+ * Retrieve information about a revert operation by revert Id.
3409
+ *
3410
+ * @param project - Project ID or project name
3411
+ * @param revertId - ID of the revert operation.
3412
+ * @param repositoryId - ID of the repository.
3413
+ */
3414
+ async getRevert(project, revertId, repositoryId) {
3415
+ return this.beginRequest({
3416
+ apiVersion: "7.2-preview.2",
3417
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}",
3418
+ routeValues: {
3419
+ project: project,
3420
+ revertId: revertId,
3421
+ repositoryId: repositoryId
3422
+ }
3423
+ });
3424
+ }
3425
+ /**
3426
+ * Retrieve information about a revert operation for a specific branch.
3427
+ *
3428
+ * @param project - Project ID or project name
3429
+ * @param repositoryId - ID of the repository.
3430
+ * @param refName - The GitAsyncRefOperationParameters generatedRefName used for the revert operation.
3431
+ */
3432
+ async getRevertForRefName(project, repositoryId, refName) {
3433
+ const queryValues = {
3434
+ refName: refName
3435
+ };
3436
+ return this.beginRequest({
3437
+ apiVersion: "7.2-preview.2",
3438
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/reverts/{revertId}",
3439
+ routeValues: {
3440
+ project: project,
3441
+ repositoryId: repositoryId
3442
+ },
3443
+ queryParams: queryValues
3444
+ });
3445
+ }
3446
+ /**
3447
+ * Create Git commit status.
3448
+ *
3449
+ * @param gitCommitStatusToCreate - Git commit status object to create.
3450
+ * @param commitId - ID of the Git commit.
3451
+ * @param repositoryId - ID of the repository.
3452
+ * @param project - Project ID or project name
3453
+ */
3454
+ async createCommitStatus(gitCommitStatusToCreate, commitId, repositoryId, project) {
3455
+ return this.beginRequest({
3456
+ apiVersion: "7.2-preview.2",
3457
+ method: "POST",
3458
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/Statuses",
3459
+ routeValues: {
3460
+ project: project,
3461
+ commitId: commitId,
3462
+ repositoryId: repositoryId
3463
+ },
3464
+ body: gitCommitStatusToCreate
3465
+ });
3466
+ }
3467
+ /**
3468
+ * Get statuses associated with the Git commit.
3469
+ *
3470
+ * @param commitId - ID of the Git commit.
3471
+ * @param repositoryId - ID of the repository.
3472
+ * @param project - Project ID or project name
3473
+ * @param top - Optional. The number of statuses to retrieve. Default is 1000.
3474
+ * @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.
3475
+ * @param latestOnly - The flag indicates whether to get only latest statuses grouped by \`Context.Name\` and \`Context.Genre\`.
3476
+ */
3477
+ async getStatuses(commitId, repositoryId, project, top, skip, latestOnly) {
3478
+ const queryValues = {
3479
+ top: top,
3480
+ skip: skip,
3481
+ latestOnly: latestOnly
3482
+ };
3483
+ return this.beginRequest({
3484
+ apiVersion: "7.2-preview.2",
3485
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/Statuses",
3486
+ routeValues: {
3487
+ project: project,
3488
+ commitId: commitId,
3489
+ repositoryId: repositoryId
3490
+ },
3491
+ queryParams: queryValues
3492
+ });
3493
+ }
3494
+ /**
3495
+ * Retrieve a pull request suggestion for a particular repository or team project.
3496
+ *
3497
+ * @param repositoryId - ID of the git repository.
3498
+ * @param project - Project ID or project name
3499
+ * @param preferCompareBranch - If true, prefer the compare branch over the default branch as target branch for pull requests.
3500
+ */
3501
+ async getSuggestions(repositoryId, project, preferCompareBranch) {
3502
+ const queryValues = {
3503
+ preferCompareBranch: preferCompareBranch
3504
+ };
3505
+ return this.beginRequest({
3506
+ apiVersion: "7.2-preview.1",
3507
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/suggestions",
3508
+ routeValues: {
3509
+ project: project,
3510
+ repositoryId: repositoryId
3511
+ },
3512
+ queryParams: queryValues
3513
+ });
3514
+ }
3515
+ /**
3516
+ * The Tree endpoint returns the collection of objects underneath the specified tree. Trees are folders in a Git repository.
3517
+ *
3518
+ * @param repositoryId - Repository Id.
3519
+ * @param sha1 - SHA1 hash of the tree object.
3520
+ * @param project - Project ID or project name
3521
+ * @param projectId - Project Id.
3522
+ * @param recursive - Search recursively. Include trees underneath this tree. Default is false.
3523
+ * @param fileName - Name to use if a .zip file is returned. Default is the object ID.
3524
+ */
3525
+ async getTree(repositoryId, sha1, project, projectId, recursive, fileName) {
3526
+ const queryValues = {
3527
+ projectId: projectId,
3528
+ recursive: recursive,
3529
+ fileName: fileName
3530
+ };
3531
+ return this.beginRequest({
3532
+ apiVersion: "7.2-preview.1",
3533
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Trees/{sha1}",
3534
+ routeValues: {
3535
+ project: project,
3536
+ repositoryId: repositoryId,
3537
+ sha1: sha1
3538
+ },
3539
+ queryParams: queryValues
3540
+ });
3541
+ }
3542
+ /**
3543
+ * The Tree endpoint returns the collection of objects underneath the specified tree. Trees are folders in a Git repository.
3544
+ *
3545
+ * @param repositoryId - Repository Id.
3546
+ * @param sha1 - SHA1 hash of the tree object.
3547
+ * @param project - Project ID or project name
3548
+ * @param projectId - Project Id.
3549
+ * @param recursive - Search recursively. Include trees underneath this tree. Default is false.
3550
+ * @param fileName - Name to use if a .zip file is returned. Default is the object ID.
3551
+ */
3552
+ async getTreeZip(repositoryId, sha1, project, projectId, recursive, fileName) {
3553
+ const queryValues = {
3554
+ projectId: projectId,
3555
+ recursive: recursive,
3556
+ fileName: fileName
3557
+ };
3558
+ return this.beginRequest({
3559
+ apiVersion: "7.2-preview.1",
3560
+ httpResponseType: "application/zip",
3561
+ routeTemplate: "{project}/_apis/git/repositories/{repositoryId}/Trees/{sha1}",
3562
+ routeValues: {
3563
+ project: project,
3564
+ repositoryId: repositoryId,
3565
+ sha1: sha1
3566
+ },
3567
+ queryParams: queryValues
3568
+ });
3569
+ }
3570
+ }
3571
+ GitRestClient.RESOURCE_AREA_ID = "4e080c62-fa21-4fbc-8fef-2a10a2b38049";