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
@@ -1,2568 +1,2319 @@
1
- /*
2
- * ---------------------------------------------------------
3
- * Copyright(C) Microsoft Corporation. All rights reserved.
4
- * ---------------------------------------------------------
5
- */
6
- var __extends = (this && this.__extends) || (function () {
7
- var extendStatics = Object.setPrototypeOf ||
8
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
9
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
10
- return function (d, b) {
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
- return new (P || (P = Promise))(function (resolve, reject) {
18
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
21
- step((generator = generator.apply(thisArg, _arguments || [])).next());
22
- });
23
- };
24
- var __generator = (this && this.__generator) || function (thisArg, body) {
25
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
26
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
- function verb(n) { return function (v) { return step([n, v]); }; }
28
- function step(op) {
29
- if (f) throw new TypeError("Generator is already executing.");
30
- while (_) try {
31
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
32
- if (y = 0, t) op = [op[0] & 2, t.value];
33
- switch (op[0]) {
34
- case 0: case 1: t = op; break;
35
- case 4: _.label++; return { value: op[1], done: false };
36
- case 5: _.label++; y = op[1]; op = [0]; continue;
37
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
38
- default:
39
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
40
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
41
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
42
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
43
- if (t[2]) _.ops.pop();
44
- _.trys.pop(); continue;
45
- }
46
- op = body.call(thisArg, _);
47
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
48
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
49
- }
50
- };
51
- define(["require", "exports", "../Common/RestClientBase", "../Common/Util/Serialization"], function (require, exports, RestClientBase_1, Serialization_1) {
52
- "use strict";
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- var BuildRestClient = /** @class */ (function (_super) {
55
- __extends(BuildRestClient, _super);
56
- function BuildRestClient(options) {
57
- return _super.call(this, options) || this;
58
- }
59
- /**
60
- * Associates an artifact with a build.
61
- *
62
- * @param artifact - The artifact.
63
- * @param project - Project ID or project name
64
- * @param buildId - The ID of the build.
65
- */
66
- BuildRestClient.prototype.createArtifact = function (artifact, project, buildId) {
67
- return __awaiter(this, void 0, void 0, function () {
68
- return __generator(this, function (_a) {
69
- return [2 /*return*/, this.beginRequest({
70
- apiVersion: "7.2-preview.5",
71
- method: "POST",
72
- routeTemplate: "{project}/_apis/build/builds/{buildId}/artifacts/{artifactName}",
73
- routeValues: {
74
- project: project,
75
- buildId: buildId
76
- },
77
- body: artifact
78
- })];
79
- });
80
- });
81
- };
82
- /**
83
- * Gets a specific artifact for a build.
84
- *
85
- * @param project - Project ID or project name
86
- * @param buildId - The ID of the build.
87
- * @param artifactName - The name of the artifact.
88
- */
89
- BuildRestClient.prototype.getArtifact = function (project, buildId, artifactName) {
90
- return __awaiter(this, void 0, void 0, function () {
91
- var queryValues;
92
- return __generator(this, function (_a) {
93
- queryValues = {
94
- artifactName: artifactName
95
- };
96
- return [2 /*return*/, this.beginRequest({
97
- apiVersion: "7.2-preview.5",
98
- routeTemplate: "{project}/_apis/build/builds/{buildId}/artifacts/{artifactName}",
99
- routeValues: {
100
- project: project,
101
- buildId: buildId
102
- },
103
- queryParams: queryValues
104
- })];
105
- });
106
- });
107
- };
108
- /**
109
- * Gets a specific artifact for a build.
110
- *
111
- * @param project - Project ID or project name
112
- * @param buildId - The ID of the build.
113
- * @param artifactName - The name of the artifact.
114
- */
115
- BuildRestClient.prototype.getArtifactContentZip = function (project, buildId, artifactName) {
116
- return __awaiter(this, void 0, void 0, function () {
117
- var queryValues;
118
- return __generator(this, function (_a) {
119
- queryValues = {
120
- artifactName: artifactName
121
- };
122
- return [2 /*return*/, this.beginRequest({
123
- apiVersion: "7.2-preview.5",
124
- httpResponseType: "application/zip",
125
- routeTemplate: "{project}/_apis/build/builds/{buildId}/artifacts/{artifactName}",
126
- routeValues: {
127
- project: project,
128
- buildId: buildId
129
- },
130
- queryParams: queryValues
131
- })];
132
- });
133
- });
134
- };
135
- /**
136
- * Gets all artifacts for a build.
137
- *
138
- * @param project - Project ID or project name
139
- * @param buildId - The ID of the build.
140
- */
141
- BuildRestClient.prototype.getArtifacts = function (project, buildId) {
142
- return __awaiter(this, void 0, void 0, function () {
143
- return __generator(this, function (_a) {
144
- return [2 /*return*/, this.beginRequest({
145
- apiVersion: "7.2-preview.5",
146
- routeTemplate: "{project}/_apis/build/builds/{buildId}/artifacts/{artifactName}",
147
- routeValues: {
148
- project: project,
149
- buildId: buildId
150
- }
151
- })];
152
- });
153
- });
154
- };
155
- /**
156
- * Gets a file from the build.
157
- *
158
- * @param project - Project ID or project name
159
- * @param buildId - The ID of the build.
160
- * @param artifactName - The name of the artifact.
161
- * @param fileId - The primary key for the file.
162
- * @param fileName - The name that the file will be set to.
163
- */
164
- BuildRestClient.prototype.getFile = function (project, buildId, artifactName, fileId, fileName) {
165
- return __awaiter(this, void 0, void 0, function () {
166
- var queryValues;
167
- return __generator(this, function (_a) {
168
- queryValues = {
169
- artifactName: artifactName,
170
- fileId: fileId,
171
- fileName: fileName
172
- };
173
- return [2 /*return*/, this.beginRequest({
174
- apiVersion: "7.2-preview.5",
175
- httpResponseType: "application/octet-stream",
176
- routeTemplate: "{project}/_apis/build/builds/{buildId}/artifacts/{artifactName}",
177
- routeValues: {
178
- project: project,
179
- buildId: buildId
180
- },
181
- queryParams: queryValues
182
- })];
183
- });
184
- });
185
- };
186
- /**
187
- * Gets the list of attachments of a specific type that are associated with a build.
188
- *
189
- * @param project - Project ID or project name
190
- * @param buildId - The ID of the build.
191
- * @param type - The type of attachment.
192
- */
193
- BuildRestClient.prototype.getAttachments = function (project, buildId, type) {
194
- return __awaiter(this, void 0, void 0, function () {
195
- return __generator(this, function (_a) {
196
- return [2 /*return*/, this.beginRequest({
197
- apiVersion: "7.2-preview.2",
198
- routeTemplate: "{project}/_apis/build/builds/{buildId}/attachments/{type}",
199
- routeValues: {
200
- project: project,
201
- buildId: buildId,
202
- type: type
203
- }
204
- })];
205
- });
206
- });
207
- };
208
- /**
209
- * Gets a specific attachment.
210
- *
211
- * @param project - Project ID or project name
212
- * @param buildId - The ID of the build.
213
- * @param timelineId - The ID of the timeline.
214
- * @param recordId - The ID of the timeline record.
215
- * @param type - The type of the attachment.
216
- * @param name - The name of the attachment.
217
- */
218
- BuildRestClient.prototype.getAttachment = function (project, buildId, timelineId, recordId, type, name) {
219
- return __awaiter(this, void 0, void 0, function () {
220
- return __generator(this, function (_a) {
221
- return [2 /*return*/, this.beginRequest({
222
- apiVersion: "7.2-preview.2",
223
- httpResponseType: "application/octet-stream",
224
- routeTemplate: "{project}/_apis/build/builds/{buildId}/{timelineId}/{recordId}/attachments/{type}/{name}",
225
- routeValues: {
226
- project: project,
227
- buildId: buildId,
228
- timelineId: timelineId,
229
- recordId: recordId,
230
- type: type,
231
- name: name
232
- }
233
- })];
234
- });
235
- });
236
- };
237
- /**
238
- * @param resources -
239
- * @param project - Project ID or project name
240
- */
241
- BuildRestClient.prototype.authorizeProjectResources = function (resources, project) {
242
- return __awaiter(this, void 0, void 0, function () {
243
- return __generator(this, function (_a) {
244
- return [2 /*return*/, this.beginRequest({
245
- apiVersion: "7.2-preview.1",
246
- method: "PATCH",
247
- routeTemplate: "{project}/_apis/build/authorizedresources",
248
- routeValues: {
249
- project: project
250
- },
251
- body: resources
252
- })];
253
- });
254
- });
255
- };
256
- /**
257
- * @param project - Project ID or project name
258
- * @param type -
259
- * @param id -
260
- */
261
- BuildRestClient.prototype.getProjectResources = function (project, type, id) {
262
- return __awaiter(this, void 0, void 0, function () {
263
- var queryValues;
264
- return __generator(this, function (_a) {
265
- queryValues = {
266
- type: type,
267
- id: id
268
- };
269
- return [2 /*return*/, this.beginRequest({
270
- apiVersion: "7.2-preview.1",
271
- routeTemplate: "{project}/_apis/build/authorizedresources",
272
- routeValues: {
273
- project: project
274
- },
275
- queryParams: queryValues
276
- })];
277
- });
278
- });
279
- };
280
- /**
281
- * Gets a badge that indicates the status of the most recent build for a definition. Note that this API is deprecated. Prefer StatusBadgeController.GetStatusBadge.
282
- *
283
- * @param project - The project ID or name.
284
- * @param definitionId - The ID of the definition.
285
- * @param branchName - The name of the branch.
286
- */
287
- BuildRestClient.prototype.getBadge = function (project, definitionId, branchName) {
288
- return __awaiter(this, void 0, void 0, function () {
289
- var queryValues;
290
- return __generator(this, function (_a) {
291
- queryValues = {
292
- branchName: branchName
293
- };
294
- return [2 /*return*/, this.beginRequest({
295
- apiVersion: "7.2-preview.2",
296
- routeTemplate: "_apis/public/build/definitions/{project}/{definitionId}/badge",
297
- routeValues: {
298
- project: project,
299
- definitionId: definitionId
300
- },
301
- queryParams: queryValues
302
- })];
303
- });
304
- });
305
- };
306
- /**
307
- * Gets a list of branches for the given source code repository.
308
- *
309
- * @param project - Project ID or project name
310
- * @param providerName - The name of the source provider.
311
- * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
312
- * @param repository - The vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories.
313
- * @param branchName - If supplied, the name of the branch to check for specifically.
314
- */
315
- BuildRestClient.prototype.listBranches = function (project, providerName, serviceEndpointId, repository, branchName) {
316
- return __awaiter(this, void 0, void 0, function () {
317
- var queryValues;
318
- return __generator(this, function (_a) {
319
- queryValues = {
320
- serviceEndpointId: serviceEndpointId,
321
- repository: repository,
322
- branchName: branchName
323
- };
324
- return [2 /*return*/, this.beginRequest({
325
- apiVersion: "7.2-preview.1",
326
- routeTemplate: "{project}/_apis/sourceProviders/{providerName}/branches",
327
- routeValues: {
328
- project: project,
329
- providerName: providerName
330
- },
331
- queryParams: queryValues
332
- })];
333
- });
334
- });
335
- };
336
- /**
337
- * Gets a badge that indicates the status of the most recent build for the specified branch.
338
- *
339
- * @param project - Project ID or project name
340
- * @param repoType - The repository type.
341
- * @param repoId - The repository ID.
342
- * @param branchName - The branch name.
343
- */
344
- BuildRestClient.prototype.getBuildBadge = function (project, repoType, repoId, branchName) {
345
- return __awaiter(this, void 0, void 0, function () {
346
- var queryValues;
347
- return __generator(this, function (_a) {
348
- queryValues = {
349
- repoId: repoId,
350
- branchName: branchName
351
- };
352
- return [2 /*return*/, this.beginRequest({
353
- apiVersion: "7.2-preview.2",
354
- routeTemplate: "{project}/_apis/build/repos/{repoType}/badge",
355
- routeValues: {
356
- project: project,
357
- repoType: repoType
358
- },
359
- queryParams: queryValues
360
- })];
361
- });
362
- });
363
- };
364
- /**
365
- * Gets a badge that indicates the status of the most recent build for the specified branch.
366
- *
367
- * @param project - Project ID or project name
368
- * @param repoType - The repository type.
369
- * @param repoId - The repository ID.
370
- * @param branchName - The branch name.
371
- */
372
- BuildRestClient.prototype.getBuildBadgeData = function (project, repoType, repoId, branchName) {
373
- return __awaiter(this, void 0, void 0, function () {
374
- var queryValues;
375
- return __generator(this, function (_a) {
376
- queryValues = {
377
- repoId: repoId,
378
- branchName: branchName
379
- };
380
- return [2 /*return*/, this.beginRequest({
381
- apiVersion: "7.2-preview.2",
382
- routeTemplate: "{project}/_apis/build/repos/{repoType}/badge",
383
- routeValues: {
384
- project: project,
385
- repoType: repoType
386
- },
387
- queryParams: queryValues
388
- })];
389
- });
390
- });
391
- };
392
- /**
393
- * Gets all retention leases that apply to a specific build.
394
- *
395
- * @param project - Project ID or project name
396
- * @param buildId - The ID of the build.
397
- */
398
- BuildRestClient.prototype.getRetentionLeasesForBuild = function (project, buildId) {
399
- return __awaiter(this, void 0, void 0, function () {
400
- return __generator(this, function (_a) {
401
- return [2 /*return*/, this.beginRequest({
402
- apiVersion: "7.2-preview.1",
403
- routeTemplate: "{project}/_apis/build/builds/{buildId}/leases",
404
- routeValues: {
405
- project: project,
406
- buildId: buildId
407
- }
408
- })];
409
- });
410
- });
411
- };
412
- /**
413
- * Deletes a build.
414
- *
415
- * @param project - Project ID or project name
416
- * @param buildId - The ID of the build.
417
- */
418
- BuildRestClient.prototype.deleteBuild = function (project, buildId) {
419
- return __awaiter(this, void 0, void 0, function () {
420
- return __generator(this, function (_a) {
421
- return [2 /*return*/, this.beginRequest({
422
- apiVersion: "7.2-preview.8",
423
- method: "DELETE",
424
- routeTemplate: "{project}/_apis/build/builds/{buildId}",
425
- routeValues: {
426
- project: project,
427
- buildId: buildId
428
- }
429
- })];
430
- });
431
- });
432
- };
433
- /**
434
- * Gets a build
435
- *
436
- * @param project - Project ID or project name
437
- * @param buildId -
438
- * @param propertyFilters -
439
- */
440
- BuildRestClient.prototype.getBuild = function (project, buildId, propertyFilters) {
441
- return __awaiter(this, void 0, void 0, function () {
442
- var queryValues;
443
- return __generator(this, function (_a) {
444
- queryValues = {
445
- propertyFilters: propertyFilters
446
- };
447
- return [2 /*return*/, this.beginRequest({
448
- apiVersion: "7.2-preview.8",
449
- routeTemplate: "{project}/_apis/build/builds/{buildId}",
450
- routeValues: {
451
- project: project,
452
- buildId: buildId
453
- },
454
- queryParams: queryValues
455
- })];
456
- });
457
- });
458
- };
459
- /**
460
- * Gets a list of builds.
461
- *
462
- * @param project - Project ID or project name
463
- * @param definitions - A comma-delimited list of definition IDs. If specified, filters to builds for these definitions.
464
- * @param queues - A comma-delimited list of queue IDs. If specified, filters to builds that ran against these queues.
465
- * @param buildNumber - If specified, filters to builds that match this build number. Append * to do a prefix search.
466
- * @param minTime - If specified, filters to builds that finished/started/queued after this date based on the queryOrder specified.
467
- * @param maxTime - If specified, filters to builds that finished/started/queued before this date based on the queryOrder specified.
468
- * @param requestedFor - If specified, filters to builds requested for the specified user.
469
- * @param reasonFilter - If specified, filters to builds that match this reason.
470
- * @param statusFilter - If specified, filters to builds that match this status.
471
- * @param resultFilter - If specified, filters to builds that match this result.
472
- * @param tagFilters - A comma-delimited list of tags. If specified, filters to builds that have the specified tags.
473
- * @param properties - A comma-delimited list of properties to retrieve.
474
- * @param top - The maximum number of builds to return.
475
- * @param continuationToken - A continuation token, returned by a previous call to this method, that can be used to return the next set of builds.
476
- * @param maxBuildsPerDefinition - The maximum number of builds to return per definition.
477
- * @param deletedFilter - Indicates whether to exclude, include, or only return deleted builds.
478
- * @param queryOrder - The order in which builds should be returned.
479
- * @param branchName - If specified, filters to builds that built branches that built this branch.
480
- * @param buildIds - A comma-delimited list that specifies the IDs of builds to retrieve.
481
- * @param repositoryId - If specified, filters to builds that built from this repository.
482
- * @param repositoryType - If specified, filters to builds that built from repositories of this type.
483
- */
484
- BuildRestClient.prototype.getBuilds = function (project, definitions, queues, buildNumber, minTime, maxTime, requestedFor, reasonFilter, statusFilter, resultFilter, tagFilters, properties, top, continuationToken, maxBuildsPerDefinition, deletedFilter, queryOrder, branchName, buildIds, repositoryId, repositoryType) {
485
- return __awaiter(this, void 0, void 0, function () {
486
- var queryValues;
487
- var _this = this;
488
- return __generator(this, function (_a) {
489
- queryValues = {
490
- definitions: definitions && definitions.join(","),
491
- queues: queues && queues.join(","),
492
- buildNumber: buildNumber,
493
- minTime: minTime,
494
- maxTime: maxTime,
495
- requestedFor: requestedFor,
496
- reasonFilter: reasonFilter,
497
- statusFilter: statusFilter,
498
- resultFilter: resultFilter,
499
- tagFilters: tagFilters && tagFilters.join(","),
500
- properties: properties && properties.join(","),
501
- '$top': top,
502
- continuationToken: continuationToken,
503
- maxBuildsPerDefinition: maxBuildsPerDefinition,
504
- deletedFilter: deletedFilter,
505
- queryOrder: queryOrder,
506
- branchName: branchName,
507
- buildIds: buildIds && buildIds.join(","),
508
- repositoryId: repositoryId,
509
- repositoryType: repositoryType
510
- };
511
- return [2 /*return*/, this.beginRequest({
512
- apiVersion: "7.2-preview.8",
513
- routeTemplate: "{project}/_apis/build/builds/{buildId}",
514
- routeValues: {
515
- project: project
516
- },
517
- queryParams: queryValues,
518
- returnRawResponse: true
519
- }).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
520
- var body;
521
- return __generator(this, function (_a) {
522
- switch (_a.label) {
523
- case 0: return [4 /*yield*/, response.text().then(Serialization_1.deserializeVssJsonObject)];
524
- case 1:
525
- body = _a.sent();
526
- body.continuationToken = response.headers.get("x-ms-continuationtoken");
527
- return [2 /*return*/, body];
528
- }
529
- });
530
- }); })];
531
- });
532
- });
533
- };
534
- /**
535
- * Queues a build
536
- *
537
- * @param build -
538
- * @param project - Project ID or project name
539
- * @param ignoreWarnings -
540
- * @param checkInTicket -
541
- * @param sourceBuildId -
542
- * @param definitionId - Optional definition id to queue a build without a body. Ignored if there's a valid body
543
- */
544
- BuildRestClient.prototype.queueBuild = function (build, project, ignoreWarnings, checkInTicket, sourceBuildId, definitionId) {
545
- return __awaiter(this, void 0, void 0, function () {
546
- var queryValues;
547
- return __generator(this, function (_a) {
548
- queryValues = {
549
- ignoreWarnings: ignoreWarnings,
550
- checkInTicket: checkInTicket,
551
- sourceBuildId: sourceBuildId,
552
- definitionId: definitionId
553
- };
554
- return [2 /*return*/, this.beginRequest({
555
- apiVersion: "7.2-preview.8",
556
- method: "POST",
557
- routeTemplate: "{project}/_apis/build/builds/{buildId}",
558
- routeValues: {
559
- project: project
560
- },
561
- queryParams: queryValues,
562
- body: build
563
- })];
564
- });
565
- });
566
- };
567
- /**
568
- * Updates a build.
569
- *
570
- * @param build - The build.
571
- * @param project - Project ID or project name
572
- * @param buildId - The ID of the build.
573
- * @param retry -
574
- */
575
- BuildRestClient.prototype.updateBuild = function (build, project, buildId, retry) {
576
- return __awaiter(this, void 0, void 0, function () {
577
- var queryValues;
578
- return __generator(this, function (_a) {
579
- queryValues = {
580
- retry: retry
581
- };
582
- return [2 /*return*/, this.beginRequest({
583
- apiVersion: "7.2-preview.8",
584
- method: "PATCH",
585
- routeTemplate: "{project}/_apis/build/builds/{buildId}",
586
- routeValues: {
587
- project: project,
588
- buildId: buildId
589
- },
590
- queryParams: queryValues,
591
- body: build
592
- })];
593
- });
594
- });
595
- };
596
- /**
597
- * Updates multiple builds.
598
- *
599
- * @param builds - The builds to update.
600
- * @param project - Project ID or project name
601
- */
602
- BuildRestClient.prototype.updateBuilds = function (builds, project) {
603
- return __awaiter(this, void 0, void 0, function () {
604
- return __generator(this, function (_a) {
605
- return [2 /*return*/, this.beginRequest({
606
- apiVersion: "7.2-preview.8",
607
- method: "PATCH",
608
- routeTemplate: "{project}/_apis/build/builds/{buildId}",
609
- routeValues: {
610
- project: project
611
- },
612
- body: builds
613
- })];
614
- });
615
- });
616
- };
617
- /**
618
- * Gets the changes associated with a build
619
- *
620
- * @param project - Project ID or project name
621
- * @param buildId -
622
- * @param continuationToken -
623
- * @param top - The maximum number of changes to return
624
- * @param includeSourceChange -
625
- */
626
- BuildRestClient.prototype.getBuildChanges = function (project, buildId, continuationToken, top, includeSourceChange) {
627
- return __awaiter(this, void 0, void 0, function () {
628
- var queryValues;
629
- var _this = this;
630
- return __generator(this, function (_a) {
631
- queryValues = {
632
- continuationToken: continuationToken,
633
- '$top': top,
634
- includeSourceChange: includeSourceChange
635
- };
636
- return [2 /*return*/, this.beginRequest({
637
- apiVersion: "7.2-preview.2",
638
- routeTemplate: "{project}/_apis/build/builds/{buildId}/changes",
639
- routeValues: {
640
- project: project,
641
- buildId: buildId
642
- },
643
- queryParams: queryValues,
644
- returnRawResponse: true
645
- }).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
646
- var body;
647
- return __generator(this, function (_a) {
648
- switch (_a.label) {
649
- case 0: return [4 /*yield*/, response.text().then(Serialization_1.deserializeVssJsonObject)];
650
- case 1:
651
- body = _a.sent();
652
- body.continuationToken = response.headers.get("x-ms-continuationtoken");
653
- return [2 /*return*/, body];
654
- }
655
- });
656
- }); })];
657
- });
658
- });
659
- };
660
- /**
661
- * Gets the changes made to the repository between two given builds.
662
- *
663
- * @param project - Project ID or project name
664
- * @param fromBuildId - The ID of the first build.
665
- * @param toBuildId - The ID of the last build.
666
- * @param top - The maximum number of changes to return.
667
- */
668
- BuildRestClient.prototype.getChangesBetweenBuilds = function (project, fromBuildId, toBuildId, top) {
669
- return __awaiter(this, void 0, void 0, function () {
670
- var queryValues;
671
- return __generator(this, function (_a) {
672
- queryValues = {
673
- fromBuildId: fromBuildId,
674
- toBuildId: toBuildId,
675
- '$top': top
676
- };
677
- return [2 /*return*/, this.beginRequest({
678
- apiVersion: "7.2-preview.2",
679
- routeTemplate: "{project}/_apis/build/changes",
680
- routeValues: {
681
- project: project
682
- },
683
- queryParams: queryValues
684
- })];
685
- });
686
- });
687
- };
688
- /**
689
- * Gets a controller
690
- *
691
- * @param controllerId -
692
- */
693
- BuildRestClient.prototype.getBuildController = function (controllerId) {
694
- return __awaiter(this, void 0, void 0, function () {
695
- return __generator(this, function (_a) {
696
- return [2 /*return*/, this.beginRequest({
697
- apiVersion: "7.2-preview.2",
698
- routeTemplate: "_apis/build/Controllers/{controllerId}",
699
- routeValues: {
700
- controllerId: controllerId
701
- }
702
- })];
703
- });
704
- });
705
- };
706
- /**
707
- * Gets controller, optionally filtered by name
708
- *
709
- * @param name -
710
- */
711
- BuildRestClient.prototype.getBuildControllers = function (name) {
712
- return __awaiter(this, void 0, void 0, function () {
713
- var queryValues;
714
- return __generator(this, function (_a) {
715
- queryValues = {
716
- name: name
717
- };
718
- return [2 /*return*/, this.beginRequest({
719
- apiVersion: "7.2-preview.2",
720
- routeTemplate: "_apis/build/Controllers/{controllerId}",
721
- queryParams: queryValues
722
- })];
723
- });
724
- });
725
- };
726
- /**
727
- * Creates a new definition.
728
- *
729
- * @param definition - The definition.
730
- * @param project - Project ID or project name
731
- * @param definitionToCloneId -
732
- * @param definitionToCloneRevision -
733
- */
734
- BuildRestClient.prototype.createDefinition = function (definition, project, definitionToCloneId, definitionToCloneRevision) {
735
- return __awaiter(this, void 0, void 0, function () {
736
- var queryValues;
737
- return __generator(this, function (_a) {
738
- queryValues = {
739
- definitionToCloneId: definitionToCloneId,
740
- definitionToCloneRevision: definitionToCloneRevision
741
- };
742
- return [2 /*return*/, this.beginRequest({
743
- apiVersion: "7.2-preview.7",
744
- method: "POST",
745
- routeTemplate: "{project}/_apis/build/definitions/{definitionId}",
746
- routeValues: {
747
- project: project
748
- },
749
- queryParams: queryValues,
750
- body: definition
751
- })];
752
- });
753
- });
754
- };
755
- /**
756
- * Deletes a definition and all associated builds.
757
- *
758
- * @param project - Project ID or project name
759
- * @param definitionId - The ID of the definition.
760
- */
761
- BuildRestClient.prototype.deleteDefinition = function (project, definitionId) {
762
- return __awaiter(this, void 0, void 0, function () {
763
- return __generator(this, function (_a) {
764
- return [2 /*return*/, this.beginRequest({
765
- apiVersion: "7.2-preview.7",
766
- method: "DELETE",
767
- routeTemplate: "{project}/_apis/build/definitions/{definitionId}",
768
- routeValues: {
769
- project: project,
770
- definitionId: definitionId
771
- }
772
- })];
773
- });
774
- });
775
- };
776
- /**
777
- * Gets a definition, optionally at a specific revision.
778
- *
779
- * @param project - Project ID or project name
780
- * @param definitionId - The ID of the definition.
781
- * @param revision - The revision number to retrieve. If this is not specified, the latest version will be returned.
782
- * @param minMetricsTime - If specified, indicates the date from which metrics should be included.
783
- * @param propertyFilters - A comma-delimited list of properties to include in the results.
784
- * @param includeLatestBuilds -
785
- */
786
- BuildRestClient.prototype.getDefinition = function (project, definitionId, revision, minMetricsTime, propertyFilters, includeLatestBuilds) {
787
- return __awaiter(this, void 0, void 0, function () {
788
- var queryValues;
789
- return __generator(this, function (_a) {
790
- queryValues = {
791
- revision: revision,
792
- minMetricsTime: minMetricsTime,
793
- propertyFilters: propertyFilters && propertyFilters.join(","),
794
- includeLatestBuilds: includeLatestBuilds
795
- };
796
- return [2 /*return*/, this.beginRequest({
797
- apiVersion: "7.2-preview.7",
798
- routeTemplate: "{project}/_apis/build/definitions/{definitionId}",
799
- routeValues: {
800
- project: project,
801
- definitionId: definitionId
802
- },
803
- queryParams: queryValues
804
- })];
805
- });
806
- });
807
- };
808
- /**
809
- * Gets a list of definitions.
810
- *
811
- * @param project - Project ID or project name
812
- * @param name - If specified, filters to definitions whose names match this pattern.
813
- * @param repositoryId - A repository ID. If specified, filters to definitions that use this repository.
814
- * @param repositoryType - If specified, filters to definitions that have a repository of this type.
815
- * @param queryOrder - Indicates the order in which definitions should be returned.
816
- * @param top - The maximum number of definitions to return.
817
- * @param continuationToken - A continuation token, returned by a previous call to this method, that can be used to return the next set of definitions.
818
- * @param minMetricsTime - If specified, indicates the date from which metrics should be included.
819
- * @param definitionIds - A comma-delimited list that specifies the IDs of definitions to retrieve.
820
- * @param path - If specified, filters to definitions under this folder.
821
- * @param builtAfter - If specified, filters to definitions that have builds after this date.
822
- * @param notBuiltAfter - If specified, filters to definitions that do not have builds after this date.
823
- * @param includeAllProperties - Indicates whether the full definitions should be returned. By default, shallow representations of the definitions are returned.
824
- * @param includeLatestBuilds - Indicates whether to return the latest and latest completed builds for this definition.
825
- * @param taskIdFilter - If specified, filters to definitions that use the specified task.
826
- * @param processType - If specified, filters to definitions with the given process type.
827
- * @param yamlFilename - If specified, filters to YAML definitions that match the given filename. To use this filter includeAllProperties should be set to true
828
- */
829
- BuildRestClient.prototype.getDefinitions = function (project, name, repositoryId, repositoryType, queryOrder, top, continuationToken, minMetricsTime, definitionIds, path, builtAfter, notBuiltAfter, includeAllProperties, includeLatestBuilds, taskIdFilter, processType, yamlFilename) {
830
- return __awaiter(this, void 0, void 0, function () {
831
- var queryValues;
832
- var _this = this;
833
- return __generator(this, function (_a) {
834
- queryValues = {
835
- name: name,
836
- repositoryId: repositoryId,
837
- repositoryType: repositoryType,
838
- queryOrder: queryOrder,
839
- '$top': top,
840
- continuationToken: continuationToken,
841
- minMetricsTime: minMetricsTime,
842
- definitionIds: definitionIds && definitionIds.join(","),
843
- path: path,
844
- builtAfter: builtAfter,
845
- notBuiltAfter: notBuiltAfter,
846
- includeAllProperties: includeAllProperties,
847
- includeLatestBuilds: includeLatestBuilds,
848
- taskIdFilter: taskIdFilter,
849
- processType: processType,
850
- yamlFilename: yamlFilename
851
- };
852
- return [2 /*return*/, this.beginRequest({
853
- apiVersion: "7.2-preview.7",
854
- routeTemplate: "{project}/_apis/build/definitions/{definitionId}",
855
- routeValues: {
856
- project: project
857
- },
858
- queryParams: queryValues,
859
- returnRawResponse: true
860
- }).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
861
- var body;
862
- return __generator(this, function (_a) {
863
- switch (_a.label) {
864
- case 0: return [4 /*yield*/, response.text().then(Serialization_1.deserializeVssJsonObject)];
865
- case 1:
866
- body = _a.sent();
867
- body.continuationToken = response.headers.get("x-ms-continuationtoken");
868
- return [2 /*return*/, body];
869
- }
870
- });
871
- }); })];
872
- });
873
- });
874
- };
875
- /**
876
- * Restores a deleted definition
877
- *
878
- * @param project - Project ID or project name
879
- * @param definitionId - The identifier of the definition to restore.
880
- * @param deleted - When false, restores a deleted definition.
881
- */
882
- BuildRestClient.prototype.restoreDefinition = function (project, definitionId, deleted) {
883
- return __awaiter(this, void 0, void 0, function () {
884
- var queryValues;
885
- return __generator(this, function (_a) {
886
- queryValues = {
887
- deleted: deleted
888
- };
889
- return [2 /*return*/, this.beginRequest({
890
- apiVersion: "7.2-preview.7",
891
- method: "PATCH",
892
- routeTemplate: "{project}/_apis/build/definitions/{definitionId}",
893
- routeValues: {
894
- project: project,
895
- definitionId: definitionId
896
- },
897
- queryParams: queryValues
898
- })];
899
- });
900
- });
901
- };
902
- /**
903
- * Updates an existing build definition. In order for this operation to succeed, the value of the "Revision" property of the request body must match the existing build definition's. It is recommended that you obtain the existing build definition by using GET, modify the build definition as necessary, and then submit the modified definition with PUT.
904
- *
905
- * @param definition - The new version of the definition. Its "Revision" property must match the existing definition for the update to be accepted.
906
- * @param project - Project ID or project name
907
- * @param definitionId - The ID of the definition.
908
- * @param secretsSourceDefinitionId -
909
- * @param secretsSourceDefinitionRevision -
910
- */
911
- BuildRestClient.prototype.updateDefinition = function (definition, project, definitionId, secretsSourceDefinitionId, secretsSourceDefinitionRevision) {
912
- return __awaiter(this, void 0, void 0, function () {
913
- var queryValues;
914
- return __generator(this, function (_a) {
915
- queryValues = {
916
- secretsSourceDefinitionId: secretsSourceDefinitionId,
917
- secretsSourceDefinitionRevision: secretsSourceDefinitionRevision
918
- };
919
- return [2 /*return*/, this.beginRequest({
920
- apiVersion: "7.2-preview.7",
921
- method: "PUT",
922
- routeTemplate: "{project}/_apis/build/definitions/{definitionId}",
923
- routeValues: {
924
- project: project,
925
- definitionId: definitionId
926
- },
927
- queryParams: queryValues,
928
- body: definition
929
- })];
930
- });
931
- });
932
- };
933
- /**
934
- * Gets the contents of a file in the given source code repository.
935
- *
936
- * @param project - Project ID or project name
937
- * @param providerName - The name of the source provider.
938
- * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
939
- * @param repository - If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories.
940
- * @param commitOrBranch - The identifier of the commit or branch from which a file's contents are retrieved.
941
- * @param path - The path to the file to retrieve, relative to the root of the repository.
942
- */
943
- BuildRestClient.prototype.getFileContents = function (project, providerName, serviceEndpointId, repository, commitOrBranch, path) {
944
- return __awaiter(this, void 0, void 0, function () {
945
- var queryValues;
946
- return __generator(this, function (_a) {
947
- queryValues = {
948
- serviceEndpointId: serviceEndpointId,
949
- repository: repository,
950
- commitOrBranch: commitOrBranch,
951
- path: path
952
- };
953
- return [2 /*return*/, this.beginRequest({
954
- apiVersion: "7.2-preview.1",
955
- httpResponseType: "text/plain",
956
- routeTemplate: "{project}/_apis/sourceProviders/{providerName}/fileContents",
957
- routeValues: {
958
- project: project,
959
- providerName: providerName
960
- },
961
- queryParams: queryValues
962
- })];
963
- });
964
- });
965
- };
966
- /**
967
- * Creates a new folder.
968
- *
969
- * @param folder - The folder.
970
- * @param project - Project ID or project name
971
- * @param path - The full path of the folder.
972
- */
973
- BuildRestClient.prototype.createFolder = function (folder, project, path) {
974
- return __awaiter(this, void 0, void 0, function () {
975
- var queryValues;
976
- return __generator(this, function (_a) {
977
- queryValues = {
978
- path: path
979
- };
980
- return [2 /*return*/, this.beginRequest({
981
- apiVersion: "7.2-preview.2",
982
- method: "PUT",
983
- routeTemplate: "{project}/_apis/build/folders/{*path}",
984
- routeValues: {
985
- project: project
986
- },
987
- queryParams: queryValues,
988
- body: folder
989
- })];
990
- });
991
- });
992
- };
993
- /**
994
- * Deletes a definition folder. Definitions and their corresponding builds will also be deleted.
995
- *
996
- * @param project - Project ID or project name
997
- * @param path - The full path to the folder.
998
- */
999
- BuildRestClient.prototype.deleteFolder = function (project, path) {
1000
- return __awaiter(this, void 0, void 0, function () {
1001
- var queryValues;
1002
- return __generator(this, function (_a) {
1003
- queryValues = {
1004
- path: path
1005
- };
1006
- return [2 /*return*/, this.beginRequest({
1007
- apiVersion: "7.2-preview.2",
1008
- method: "DELETE",
1009
- routeTemplate: "{project}/_apis/build/folders/{*path}",
1010
- routeValues: {
1011
- project: project
1012
- },
1013
- queryParams: queryValues
1014
- })];
1015
- });
1016
- });
1017
- };
1018
- /**
1019
- * Gets a list of build definition folders.
1020
- *
1021
- * @param project - Project ID or project name
1022
- * @param path - The path to start with.
1023
- * @param queryOrder - The order in which folders should be returned.
1024
- */
1025
- BuildRestClient.prototype.getFolders = function (project, path, queryOrder) {
1026
- return __awaiter(this, void 0, void 0, function () {
1027
- var queryValues;
1028
- return __generator(this, function (_a) {
1029
- queryValues = {
1030
- queryOrder: queryOrder
1031
- };
1032
- return [2 /*return*/, this.beginRequest({
1033
- apiVersion: "7.2-preview.2",
1034
- routeTemplate: "{project}/_apis/build/folders/{*path}",
1035
- routeValues: {
1036
- project: project,
1037
- path: path
1038
- },
1039
- queryParams: queryValues
1040
- })];
1041
- });
1042
- });
1043
- };
1044
- /**
1045
- * Updates an existing folder at given existing path
1046
- *
1047
- * @param folder - The new version of the folder.
1048
- * @param project - Project ID or project name
1049
- * @param path - The full path to the folder.
1050
- */
1051
- BuildRestClient.prototype.updateFolder = function (folder, project, path) {
1052
- return __awaiter(this, void 0, void 0, function () {
1053
- var queryValues;
1054
- return __generator(this, function (_a) {
1055
- queryValues = {
1056
- path: path
1057
- };
1058
- return [2 /*return*/, this.beginRequest({
1059
- apiVersion: "7.2-preview.2",
1060
- method: "POST",
1061
- routeTemplate: "{project}/_apis/build/folders/{*path}",
1062
- routeValues: {
1063
- project: project
1064
- },
1065
- queryParams: queryValues,
1066
- body: folder
1067
- })];
1068
- });
1069
- });
1070
- };
1071
- /**
1072
- * Gets pipeline general settings.
1073
- *
1074
- * @param project - Project ID or project name
1075
- */
1076
- BuildRestClient.prototype.getBuildGeneralSettings = function (project) {
1077
- return __awaiter(this, void 0, void 0, function () {
1078
- return __generator(this, function (_a) {
1079
- return [2 /*return*/, this.beginRequest({
1080
- apiVersion: "7.2-preview.1",
1081
- routeTemplate: "{project}/_apis/build/generalSettings",
1082
- routeValues: {
1083
- project: project
1084
- }
1085
- })];
1086
- });
1087
- });
1088
- };
1089
- /**
1090
- * Updates pipeline general settings.
1091
- *
1092
- * @param newSettings -
1093
- * @param project - Project ID or project name
1094
- */
1095
- BuildRestClient.prototype.updateBuildGeneralSettings = function (newSettings, project) {
1096
- return __awaiter(this, void 0, void 0, function () {
1097
- return __generator(this, function (_a) {
1098
- return [2 /*return*/, this.beginRequest({
1099
- apiVersion: "7.2-preview.1",
1100
- method: "PATCH",
1101
- routeTemplate: "{project}/_apis/build/generalSettings",
1102
- routeValues: {
1103
- project: project
1104
- },
1105
- body: newSettings
1106
- })];
1107
- });
1108
- });
1109
- };
1110
- /**
1111
- * Returns the retention history for the project collection. This includes pipelines that have custom retention rules that may prevent the retention job from cleaning them up, runs per pipeline with retention type, files associated with pipelines owned by the collection with retention type, and the number of files per pipeline.
1112
- *
1113
- * @param daysToLookback -
1114
- */
1115
- BuildRestClient.prototype.getRetentionHistory = function (daysToLookback) {
1116
- return __awaiter(this, void 0, void 0, function () {
1117
- var queryValues;
1118
- return __generator(this, function (_a) {
1119
- queryValues = {
1120
- daysToLookback: daysToLookback
1121
- };
1122
- return [2 /*return*/, this.beginRequest({
1123
- apiVersion: "7.2-preview.1",
1124
- routeTemplate: "_apis/build/retention/history",
1125
- queryParams: queryValues
1126
- })];
1127
- });
1128
- });
1129
- };
1130
- /**
1131
- * Gets the latest build for a definition, optionally scoped to a specific branch.
1132
- *
1133
- * @param project - Project ID or project name
1134
- * @param definition - definition name with optional leading folder path, or the definition id
1135
- * @param branchName - optional parameter that indicates the specific branch to use. If not specified, the default branch is used.
1136
- */
1137
- BuildRestClient.prototype.getLatestBuild = function (project, definition, branchName) {
1138
- return __awaiter(this, void 0, void 0, function () {
1139
- var queryValues;
1140
- return __generator(this, function (_a) {
1141
- queryValues = {
1142
- branchName: branchName
1143
- };
1144
- return [2 /*return*/, this.beginRequest({
1145
- apiVersion: "7.2-preview.2",
1146
- routeTemplate: "{project}/_apis/build/latest/{*definition}",
1147
- routeValues: {
1148
- project: project,
1149
- definition: definition
1150
- },
1151
- queryParams: queryValues
1152
- })];
1153
- });
1154
- });
1155
- };
1156
- /**
1157
- * Adds new leases for pipeline runs.
1158
- *
1159
- * @param newLeases -
1160
- * @param project - Project ID or project name
1161
- */
1162
- BuildRestClient.prototype.addRetentionLeases = function (newLeases, project) {
1163
- return __awaiter(this, void 0, void 0, function () {
1164
- return __generator(this, function (_a) {
1165
- return [2 /*return*/, this.beginRequest({
1166
- apiVersion: "7.2-preview.2",
1167
- method: "POST",
1168
- routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1169
- routeValues: {
1170
- project: project
1171
- },
1172
- body: newLeases
1173
- })];
1174
- });
1175
- });
1176
- };
1177
- /**
1178
- * Removes specific retention leases.
1179
- *
1180
- * @param project - Project ID or project name
1181
- * @param ids -
1182
- */
1183
- BuildRestClient.prototype.deleteRetentionLeasesById = function (project, ids) {
1184
- return __awaiter(this, void 0, void 0, function () {
1185
- var queryValues;
1186
- return __generator(this, function (_a) {
1187
- queryValues = {
1188
- ids: ids && ids.join(",")
1189
- };
1190
- return [2 /*return*/, this.beginRequest({
1191
- apiVersion: "7.2-preview.2",
1192
- method: "DELETE",
1193
- routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1194
- routeValues: {
1195
- project: project
1196
- },
1197
- queryParams: queryValues
1198
- })];
1199
- });
1200
- });
1201
- };
1202
- /**
1203
- * Returns the details of the retention lease given a lease id.
1204
- *
1205
- * @param project - Project ID or project name
1206
- * @param leaseId -
1207
- */
1208
- BuildRestClient.prototype.getRetentionLease = function (project, leaseId) {
1209
- return __awaiter(this, void 0, void 0, function () {
1210
- return __generator(this, function (_a) {
1211
- return [2 /*return*/, this.beginRequest({
1212
- apiVersion: "7.2-preview.2",
1213
- routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1214
- routeValues: {
1215
- project: project,
1216
- leaseId: leaseId
1217
- }
1218
- })];
1219
- });
1220
- });
1221
- };
1222
- /**
1223
- * Returns any leases matching the specified MinimalRetentionLeases
1224
- *
1225
- * @param project - Project ID or project name
1226
- * @param leasesToFetch - List of JSON-serialized MinimalRetentionLeases separated by '|'
1227
- */
1228
- BuildRestClient.prototype.getRetentionLeasesByMinimalRetentionLeases = function (project, leasesToFetch) {
1229
- return __awaiter(this, void 0, void 0, function () {
1230
- var queryValues;
1231
- return __generator(this, function (_a) {
1232
- queryValues = {
1233
- leasesToFetch: leasesToFetch && leasesToFetch.join("|")
1234
- };
1235
- return [2 /*return*/, this.beginRequest({
1236
- apiVersion: "7.2-preview.2",
1237
- routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1238
- routeValues: {
1239
- project: project
1240
- },
1241
- queryParams: queryValues
1242
- })];
1243
- });
1244
- });
1245
- };
1246
- /**
1247
- * Returns any leases owned by the specified entity, optionally scoped to a single pipeline definition and run.
1248
- *
1249
- * @param project - Project ID or project name
1250
- * @param ownerId -
1251
- * @param definitionId - An optional parameter to limit the search to a specific pipeline definition.
1252
- * @param runId - An optional parameter to limit the search to a single pipeline run. Requires definitionId.
1253
- */
1254
- BuildRestClient.prototype.getRetentionLeasesByOwnerId = function (project, ownerId, definitionId, runId) {
1255
- return __awaiter(this, void 0, void 0, function () {
1256
- var queryValues;
1257
- return __generator(this, function (_a) {
1258
- queryValues = {
1259
- ownerId: ownerId,
1260
- definitionId: definitionId,
1261
- runId: runId
1262
- };
1263
- return [2 /*return*/, this.beginRequest({
1264
- apiVersion: "7.2-preview.2",
1265
- routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1266
- routeValues: {
1267
- project: project
1268
- },
1269
- queryParams: queryValues
1270
- })];
1271
- });
1272
- });
1273
- };
1274
- /**
1275
- * Returns any leases owned by the specified user, optionally scoped to a single pipeline definition and run.
1276
- *
1277
- * @param project - Project ID or project name
1278
- * @param userOwnerId - The user id to search for.
1279
- * @param definitionId - An optional parameter to limit the search to a specific pipeline definition.
1280
- * @param runId - An optional parameter to limit the search to a single pipeline run. Requires definitionId.
1281
- */
1282
- BuildRestClient.prototype.getRetentionLeasesByUserId = function (project, userOwnerId, definitionId, runId) {
1283
- return __awaiter(this, void 0, void 0, function () {
1284
- var queryValues;
1285
- return __generator(this, function (_a) {
1286
- queryValues = {
1287
- userOwnerId: userOwnerId,
1288
- definitionId: definitionId,
1289
- runId: runId
1290
- };
1291
- return [2 /*return*/, this.beginRequest({
1292
- apiVersion: "7.2-preview.2",
1293
- routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1294
- routeValues: {
1295
- project: project
1296
- },
1297
- queryParams: queryValues
1298
- })];
1299
- });
1300
- });
1301
- };
1302
- /**
1303
- * Updates the duration or pipeline protection status of a retention lease.
1304
- *
1305
- * @param leaseUpdate - The new data for the retention lease.
1306
- * @param project - Project ID or project name
1307
- * @param leaseId - The ID of the lease to update.
1308
- */
1309
- BuildRestClient.prototype.updateRetentionLease = function (leaseUpdate, project, leaseId) {
1310
- return __awaiter(this, void 0, void 0, function () {
1311
- return __generator(this, function (_a) {
1312
- return [2 /*return*/, this.beginRequest({
1313
- apiVersion: "7.2-preview.2",
1314
- method: "PATCH",
1315
- routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1316
- routeValues: {
1317
- project: project,
1318
- leaseId: leaseId
1319
- },
1320
- body: leaseUpdate
1321
- })];
1322
- });
1323
- });
1324
- };
1325
- /**
1326
- * Gets an individual log file for a build.
1327
- *
1328
- * @param project - Project ID or project name
1329
- * @param buildId - The ID of the build.
1330
- * @param logId - The ID of the log file.
1331
- * @param startLine - The start line.
1332
- * @param endLine - The end line.
1333
- */
1334
- BuildRestClient.prototype.getBuildLog = function (project, buildId, logId, startLine, endLine) {
1335
- return __awaiter(this, void 0, void 0, function () {
1336
- var queryValues;
1337
- return __generator(this, function (_a) {
1338
- queryValues = {
1339
- startLine: startLine,
1340
- endLine: endLine
1341
- };
1342
- return [2 /*return*/, this.beginRequest({
1343
- apiVersion: "7.2-preview.2",
1344
- httpResponseType: "text/plain",
1345
- routeTemplate: "{project}/_apis/build/builds/{buildId}/logs/{logId}",
1346
- routeValues: {
1347
- project: project,
1348
- buildId: buildId,
1349
- logId: logId
1350
- },
1351
- queryParams: queryValues
1352
- })];
1353
- });
1354
- });
1355
- };
1356
- /**
1357
- * Gets an individual log file for a build.
1358
- *
1359
- * @param project - Project ID or project name
1360
- * @param buildId - The ID of the build.
1361
- * @param logId - The ID of the log file.
1362
- * @param startLine - The start line.
1363
- * @param endLine - The end line.
1364
- */
1365
- BuildRestClient.prototype.getBuildLogLines = function (project, buildId, logId, startLine, endLine) {
1366
- return __awaiter(this, void 0, void 0, function () {
1367
- var queryValues;
1368
- return __generator(this, function (_a) {
1369
- queryValues = {
1370
- startLine: startLine,
1371
- endLine: endLine
1372
- };
1373
- return [2 /*return*/, this.beginRequest({
1374
- apiVersion: "7.2-preview.2",
1375
- routeTemplate: "{project}/_apis/build/builds/{buildId}/logs/{logId}",
1376
- routeValues: {
1377
- project: project,
1378
- buildId: buildId,
1379
- logId: logId
1380
- },
1381
- queryParams: queryValues
1382
- })];
1383
- });
1384
- });
1385
- };
1386
- /**
1387
- * Gets the logs for a build.
1388
- *
1389
- * @param project - Project ID or project name
1390
- * @param buildId - The ID of the build.
1391
- */
1392
- BuildRestClient.prototype.getBuildLogs = function (project, buildId) {
1393
- return __awaiter(this, void 0, void 0, function () {
1394
- return __generator(this, function (_a) {
1395
- return [2 /*return*/, this.beginRequest({
1396
- apiVersion: "7.2-preview.2",
1397
- routeTemplate: "{project}/_apis/build/builds/{buildId}/logs/{logId}",
1398
- routeValues: {
1399
- project: project,
1400
- buildId: buildId
1401
- }
1402
- })];
1403
- });
1404
- });
1405
- };
1406
- /**
1407
- * Gets the logs for a build.
1408
- *
1409
- * @param project - Project ID or project name
1410
- * @param buildId - The ID of the build.
1411
- */
1412
- BuildRestClient.prototype.getBuildLogsZip = function (project, buildId) {
1413
- return __awaiter(this, void 0, void 0, function () {
1414
- return __generator(this, function (_a) {
1415
- return [2 /*return*/, this.beginRequest({
1416
- apiVersion: "7.2-preview.2",
1417
- httpResponseType: "application/zip",
1418
- routeTemplate: "{project}/_apis/build/builds/{buildId}/logs/{logId}",
1419
- routeValues: {
1420
- project: project,
1421
- buildId: buildId
1422
- }
1423
- })];
1424
- });
1425
- });
1426
- };
1427
- /**
1428
- * Gets an individual log file for a build.
1429
- *
1430
- * @param project - Project ID or project name
1431
- * @param buildId - The ID of the build.
1432
- * @param logId - The ID of the log file.
1433
- * @param startLine - The start line.
1434
- * @param endLine - The end line.
1435
- */
1436
- BuildRestClient.prototype.getBuildLogZip = function (project, buildId, logId, startLine, endLine) {
1437
- return __awaiter(this, void 0, void 0, function () {
1438
- var queryValues;
1439
- return __generator(this, function (_a) {
1440
- queryValues = {
1441
- startLine: startLine,
1442
- endLine: endLine
1443
- };
1444
- return [2 /*return*/, this.beginRequest({
1445
- apiVersion: "7.2-preview.2",
1446
- httpResponseType: "application/zip",
1447
- routeTemplate: "{project}/_apis/build/builds/{buildId}/logs/{logId}",
1448
- routeValues: {
1449
- project: project,
1450
- buildId: buildId,
1451
- logId: logId
1452
- },
1453
- queryParams: queryValues
1454
- })];
1455
- });
1456
- });
1457
- };
1458
- /**
1459
- * Gets build metrics for a project.
1460
- *
1461
- * @param project - Project ID or project name
1462
- * @param metricAggregationType - The aggregation type to use (hourly, daily).
1463
- * @param minMetricsTime - The date from which to calculate metrics.
1464
- */
1465
- BuildRestClient.prototype.getProjectMetrics = function (project, metricAggregationType, minMetricsTime) {
1466
- return __awaiter(this, void 0, void 0, function () {
1467
- var queryValues;
1468
- return __generator(this, function (_a) {
1469
- queryValues = {
1470
- minMetricsTime: minMetricsTime
1471
- };
1472
- return [2 /*return*/, this.beginRequest({
1473
- apiVersion: "7.2-preview.1",
1474
- routeTemplate: "{project}/_apis/build/Metrics/{metricAggregationType}",
1475
- routeValues: {
1476
- project: project,
1477
- metricAggregationType: metricAggregationType
1478
- },
1479
- queryParams: queryValues
1480
- })];
1481
- });
1482
- });
1483
- };
1484
- /**
1485
- * Gets build metrics for a definition.
1486
- *
1487
- * @param project - Project ID or project name
1488
- * @param definitionId - The ID of the definition.
1489
- * @param minMetricsTime - The date from which to calculate metrics.
1490
- */
1491
- BuildRestClient.prototype.getDefinitionMetrics = function (project, definitionId, minMetricsTime) {
1492
- return __awaiter(this, void 0, void 0, function () {
1493
- var queryValues;
1494
- return __generator(this, function (_a) {
1495
- queryValues = {
1496
- minMetricsTime: minMetricsTime
1497
- };
1498
- return [2 /*return*/, this.beginRequest({
1499
- apiVersion: "7.2-preview.1",
1500
- routeTemplate: "{project}/_apis/build/definitions/{definitionId}/Metrics",
1501
- routeValues: {
1502
- project: project,
1503
- definitionId: definitionId
1504
- },
1505
- queryParams: queryValues
1506
- })];
1507
- });
1508
- });
1509
- };
1510
- /**
1511
- * Gets all build definition options supported by the system.
1512
- *
1513
- * @param project - Project ID or project name
1514
- */
1515
- BuildRestClient.prototype.getBuildOptionDefinitions = function (project) {
1516
- return __awaiter(this, void 0, void 0, function () {
1517
- return __generator(this, function (_a) {
1518
- return [2 /*return*/, this.beginRequest({
1519
- apiVersion: "7.2-preview.2",
1520
- routeTemplate: "{project}/_apis/build/options",
1521
- routeValues: {
1522
- project: project
1523
- }
1524
- })];
1525
- });
1526
- });
1527
- };
1528
- /**
1529
- * Gets the contents of a directory in the given source code repository.
1530
- *
1531
- * @param project - Project ID or project name
1532
- * @param providerName - The name of the source provider.
1533
- * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
1534
- * @param repository - If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories.
1535
- * @param commitOrBranch - The identifier of the commit or branch from which a file's contents are retrieved.
1536
- * @param path - The path contents to list, relative to the root of the repository.
1537
- */
1538
- BuildRestClient.prototype.getPathContents = function (project, providerName, serviceEndpointId, repository, commitOrBranch, path) {
1539
- return __awaiter(this, void 0, void 0, function () {
1540
- var queryValues;
1541
- return __generator(this, function (_a) {
1542
- queryValues = {
1543
- serviceEndpointId: serviceEndpointId,
1544
- repository: repository,
1545
- commitOrBranch: commitOrBranch,
1546
- path: path
1547
- };
1548
- return [2 /*return*/, this.beginRequest({
1549
- apiVersion: "7.2-preview.1",
1550
- routeTemplate: "{project}/_apis/sourceProviders/{providerName}/pathContents",
1551
- routeValues: {
1552
- project: project,
1553
- providerName: providerName
1554
- },
1555
- queryParams: queryValues
1556
- })];
1557
- });
1558
- });
1559
- };
1560
- /**
1561
- * Gets properties for a build.
1562
- *
1563
- * @param project - Project ID or project name
1564
- * @param buildId - The ID of the build.
1565
- * @param filter - A comma-delimited list of properties. If specified, filters to these specific properties.
1566
- */
1567
- BuildRestClient.prototype.getBuildProperties = function (project, buildId, filter) {
1568
- return __awaiter(this, void 0, void 0, function () {
1569
- var queryValues;
1570
- return __generator(this, function (_a) {
1571
- queryValues = {
1572
- filter: filter && filter.join(",")
1573
- };
1574
- return [2 /*return*/, this.beginRequest({
1575
- apiVersion: "7.2-preview.1",
1576
- routeTemplate: "{project}/_apis/build/builds/{buildId}/properties",
1577
- routeValues: {
1578
- project: project,
1579
- buildId: buildId
1580
- },
1581
- queryParams: queryValues
1582
- })];
1583
- });
1584
- });
1585
- };
1586
- /**
1587
- * Updates properties for a build.
1588
- *
1589
- * @param document - A json-patch document describing the properties to update.
1590
- * @param project - Project ID or project name
1591
- * @param buildId - The ID of the build.
1592
- */
1593
- BuildRestClient.prototype.updateBuildProperties = function (document, project, buildId) {
1594
- return __awaiter(this, void 0, void 0, function () {
1595
- return __generator(this, function (_a) {
1596
- return [2 /*return*/, this.beginRequest({
1597
- apiVersion: "7.2-preview.1",
1598
- method: "PATCH",
1599
- routeTemplate: "{project}/_apis/build/builds/{buildId}/properties",
1600
- routeValues: {
1601
- project: project,
1602
- buildId: buildId
1603
- },
1604
- customHeaders: {
1605
- "Content-Type": "application/json-patch+json",
1606
- },
1607
- body: document
1608
- })];
1609
- });
1610
- });
1611
- };
1612
- /**
1613
- * Gets properties for a definition.
1614
- *
1615
- * @param project - Project ID or project name
1616
- * @param definitionId - The ID of the definition.
1617
- * @param filter - A comma-delimited list of properties. If specified, filters to these specific properties.
1618
- */
1619
- BuildRestClient.prototype.getDefinitionProperties = function (project, definitionId, filter) {
1620
- return __awaiter(this, void 0, void 0, function () {
1621
- var queryValues;
1622
- return __generator(this, function (_a) {
1623
- queryValues = {
1624
- filter: filter && filter.join(",")
1625
- };
1626
- return [2 /*return*/, this.beginRequest({
1627
- apiVersion: "7.2-preview.1",
1628
- routeTemplate: "{project}/_apis/build/definitions/{definitionId}/properties",
1629
- routeValues: {
1630
- project: project,
1631
- definitionId: definitionId
1632
- },
1633
- queryParams: queryValues
1634
- })];
1635
- });
1636
- });
1637
- };
1638
- /**
1639
- * Updates properties for a definition.
1640
- *
1641
- * @param document - A json-patch document describing the properties to update.
1642
- * @param project - Project ID or project name
1643
- * @param definitionId - The ID of the definition.
1644
- */
1645
- BuildRestClient.prototype.updateDefinitionProperties = function (document, project, definitionId) {
1646
- return __awaiter(this, void 0, void 0, function () {
1647
- return __generator(this, function (_a) {
1648
- return [2 /*return*/, this.beginRequest({
1649
- apiVersion: "7.2-preview.1",
1650
- method: "PATCH",
1651
- routeTemplate: "{project}/_apis/build/definitions/{definitionId}/properties",
1652
- routeValues: {
1653
- project: project,
1654
- definitionId: definitionId
1655
- },
1656
- customHeaders: {
1657
- "Content-Type": "application/json-patch+json",
1658
- },
1659
- body: document
1660
- })];
1661
- });
1662
- });
1663
- };
1664
- /**
1665
- * Gets a pull request object from source provider.
1666
- *
1667
- * @param project - Project ID or project name
1668
- * @param providerName - The name of the source provider.
1669
- * @param pullRequestId - Vendor-specific id of the pull request.
1670
- * @param repositoryId - Vendor-specific identifier or the name of the repository that contains the pull request.
1671
- * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
1672
- */
1673
- BuildRestClient.prototype.getPullRequest = function (project, providerName, pullRequestId, repositoryId, serviceEndpointId) {
1674
- return __awaiter(this, void 0, void 0, function () {
1675
- var queryValues;
1676
- return __generator(this, function (_a) {
1677
- queryValues = {
1678
- repositoryId: repositoryId,
1679
- serviceEndpointId: serviceEndpointId
1680
- };
1681
- return [2 /*return*/, this.beginRequest({
1682
- apiVersion: "7.2-preview.1",
1683
- routeTemplate: "{project}/_apis/sourceProviders/{providerName}/pullRequests/{pullRequestId}",
1684
- routeValues: {
1685
- project: project,
1686
- providerName: providerName,
1687
- pullRequestId: pullRequestId
1688
- },
1689
- queryParams: queryValues
1690
- })];
1691
- });
1692
- });
1693
- };
1694
- /**
1695
- * Gets a build report.
1696
- *
1697
- * @param project - Project ID or project name
1698
- * @param buildId - The ID of the build.
1699
- * @param type -
1700
- */
1701
- BuildRestClient.prototype.getBuildReport = function (project, buildId, type) {
1702
- return __awaiter(this, void 0, void 0, function () {
1703
- var queryValues;
1704
- return __generator(this, function (_a) {
1705
- queryValues = {
1706
- type: type
1707
- };
1708
- return [2 /*return*/, this.beginRequest({
1709
- apiVersion: "7.2-preview.2",
1710
- routeTemplate: "{project}/_apis/build/builds/{buildId}/report",
1711
- routeValues: {
1712
- project: project,
1713
- buildId: buildId
1714
- },
1715
- queryParams: queryValues
1716
- })];
1717
- });
1718
- });
1719
- };
1720
- /**
1721
- * Gets a build report.
1722
- *
1723
- * @param project - Project ID or project name
1724
- * @param buildId - The ID of the build.
1725
- * @param type -
1726
- */
1727
- BuildRestClient.prototype.getBuildReportHtmlContent = function (project, buildId, type) {
1728
- return __awaiter(this, void 0, void 0, function () {
1729
- var queryValues;
1730
- return __generator(this, function (_a) {
1731
- queryValues = {
1732
- type: type
1733
- };
1734
- return [2 /*return*/, this.beginRequest({
1735
- apiVersion: "7.2-preview.2",
1736
- httpResponseType: "text/html",
1737
- routeTemplate: "{project}/_apis/build/builds/{buildId}/report",
1738
- routeValues: {
1739
- project: project,
1740
- buildId: buildId
1741
- },
1742
- queryParams: queryValues
1743
- })];
1744
- });
1745
- });
1746
- };
1747
- /**
1748
- * Gets a list of source code repositories.
1749
- *
1750
- * @param project - Project ID or project name
1751
- * @param providerName - The name of the source provider.
1752
- * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
1753
- * @param repository - If specified, the vendor-specific identifier or the name of a single repository to get.
1754
- * @param resultSet - 'top' for the repositories most relevant for the endpoint. If not set, all repositories are returned. Ignored if 'repository' is set.
1755
- * @param pageResults - If set to true, this will limit the set of results and will return a continuation token to continue the query.
1756
- * @param continuationToken - When paging results, this is a continuation token, returned by a previous call to this method, that can be used to return the next set of repositories.
1757
- */
1758
- BuildRestClient.prototype.listRepositories = function (project, providerName, serviceEndpointId, repository, resultSet, pageResults, continuationToken) {
1759
- return __awaiter(this, void 0, void 0, function () {
1760
- var queryValues;
1761
- return __generator(this, function (_a) {
1762
- queryValues = {
1763
- serviceEndpointId: serviceEndpointId,
1764
- repository: repository,
1765
- resultSet: resultSet,
1766
- pageResults: pageResults,
1767
- continuationToken: continuationToken
1768
- };
1769
- return [2 /*return*/, this.beginRequest({
1770
- apiVersion: "7.2-preview.1",
1771
- routeTemplate: "{project}/_apis/sourceProviders/{providerName}/repositories",
1772
- routeValues: {
1773
- project: project,
1774
- providerName: providerName
1775
- },
1776
- queryParams: queryValues
1777
- })];
1778
- });
1779
- });
1780
- };
1781
- /**
1782
- * @param resources -
1783
- * @param project - Project ID or project name
1784
- * @param definitionId -
1785
- */
1786
- BuildRestClient.prototype.authorizeDefinitionResources = function (resources, project, definitionId) {
1787
- return __awaiter(this, void 0, void 0, function () {
1788
- return __generator(this, function (_a) {
1789
- return [2 /*return*/, this.beginRequest({
1790
- apiVersion: "7.2-preview.1",
1791
- method: "PATCH",
1792
- routeTemplate: "{project}/_apis/build/definitions/{definitionId}/resources",
1793
- routeValues: {
1794
- project: project,
1795
- definitionId: definitionId
1796
- },
1797
- body: resources
1798
- })];
1799
- });
1800
- });
1801
- };
1802
- /**
1803
- * @param project - Project ID or project name
1804
- * @param definitionId -
1805
- */
1806
- BuildRestClient.prototype.getDefinitionResources = function (project, definitionId) {
1807
- return __awaiter(this, void 0, void 0, function () {
1808
- return __generator(this, function (_a) {
1809
- return [2 /*return*/, this.beginRequest({
1810
- apiVersion: "7.2-preview.1",
1811
- routeTemplate: "{project}/_apis/build/definitions/{definitionId}/resources",
1812
- routeValues: {
1813
- project: project,
1814
- definitionId: definitionId
1815
- }
1816
- })];
1817
- });
1818
- });
1819
- };
1820
- /**
1821
- * Gets information about build resources in the system.
1822
- *
1823
- */
1824
- BuildRestClient.prototype.getResourceUsage = function () {
1825
- return __awaiter(this, void 0, void 0, function () {
1826
- return __generator(this, function (_a) {
1827
- return [2 /*return*/, this.beginRequest({
1828
- apiVersion: "7.2-preview.2",
1829
- routeTemplate: "_apis/build/ResourceUsage"
1830
- })];
1831
- });
1832
- });
1833
- };
1834
- /**
1835
- * Gets the project's retention settings.
1836
- *
1837
- * @param project - Project ID or project name
1838
- */
1839
- BuildRestClient.prototype.getRetentionSettings = function (project) {
1840
- return __awaiter(this, void 0, void 0, function () {
1841
- return __generator(this, function (_a) {
1842
- return [2 /*return*/, this.beginRequest({
1843
- apiVersion: "7.2-preview.1",
1844
- routeTemplate: "{project}/_apis/build/retention",
1845
- routeValues: {
1846
- project: project
1847
- }
1848
- })];
1849
- });
1850
- });
1851
- };
1852
- /**
1853
- * Updates the project's retention settings.
1854
- *
1855
- * @param updateModel -
1856
- * @param project - Project ID or project name
1857
- */
1858
- BuildRestClient.prototype.updateRetentionSettings = function (updateModel, project) {
1859
- return __awaiter(this, void 0, void 0, function () {
1860
- return __generator(this, function (_a) {
1861
- return [2 /*return*/, this.beginRequest({
1862
- apiVersion: "7.2-preview.1",
1863
- method: "PATCH",
1864
- routeTemplate: "{project}/_apis/build/retention",
1865
- routeValues: {
1866
- project: project
1867
- },
1868
- body: updateModel
1869
- })];
1870
- });
1871
- });
1872
- };
1873
- /**
1874
- * Gets all revisions of a definition.
1875
- *
1876
- * @param project - Project ID or project name
1877
- * @param definitionId - The ID of the definition.
1878
- */
1879
- BuildRestClient.prototype.getDefinitionRevisions = function (project, definitionId) {
1880
- return __awaiter(this, void 0, void 0, function () {
1881
- return __generator(this, function (_a) {
1882
- return [2 /*return*/, this.beginRequest({
1883
- apiVersion: "7.2-preview.3",
1884
- routeTemplate: "{project}/_apis/build/definitions/{definitionId}/revisions",
1885
- routeValues: {
1886
- project: project,
1887
- definitionId: definitionId
1888
- }
1889
- })];
1890
- });
1891
- });
1892
- };
1893
- /**
1894
- * Gets the build settings.
1895
- *
1896
- * @param project - Project ID or project name
1897
- */
1898
- BuildRestClient.prototype.getBuildSettings = function (project) {
1899
- return __awaiter(this, void 0, void 0, function () {
1900
- return __generator(this, function (_a) {
1901
- return [2 /*return*/, this.beginRequest({
1902
- apiVersion: "7.2-preview.1",
1903
- routeTemplate: "{project}/_apis/build/settings",
1904
- routeValues: {
1905
- project: project
1906
- }
1907
- })];
1908
- });
1909
- });
1910
- };
1911
- /**
1912
- * Updates the build settings.
1913
- *
1914
- * @param settings - The new settings.
1915
- * @param project - Project ID or project name
1916
- */
1917
- BuildRestClient.prototype.updateBuildSettings = function (settings, project) {
1918
- return __awaiter(this, void 0, void 0, function () {
1919
- return __generator(this, function (_a) {
1920
- return [2 /*return*/, this.beginRequest({
1921
- apiVersion: "7.2-preview.1",
1922
- method: "PATCH",
1923
- routeTemplate: "{project}/_apis/build/settings",
1924
- routeValues: {
1925
- project: project
1926
- },
1927
- body: settings
1928
- })];
1929
- });
1930
- });
1931
- };
1932
- /**
1933
- * Get a list of source providers and their capabilities.
1934
- *
1935
- * @param project - Project ID or project name
1936
- */
1937
- BuildRestClient.prototype.listSourceProviders = function (project) {
1938
- return __awaiter(this, void 0, void 0, function () {
1939
- return __generator(this, function (_a) {
1940
- return [2 /*return*/, this.beginRequest({
1941
- apiVersion: "7.2-preview.1",
1942
- routeTemplate: "{project}/_apis/sourceProviders",
1943
- routeValues: {
1944
- project: project
1945
- }
1946
- })];
1947
- });
1948
- });
1949
- };
1950
- /**
1951
- * Update a build stage
1952
- *
1953
- * @param updateParameters -
1954
- * @param buildId -
1955
- * @param stageRefName -
1956
- * @param project - Project ID or project name
1957
- */
1958
- BuildRestClient.prototype.updateStage = function (updateParameters, buildId, stageRefName, project) {
1959
- return __awaiter(this, void 0, void 0, function () {
1960
- return __generator(this, function (_a) {
1961
- return [2 /*return*/, this.beginRequest({
1962
- apiVersion: "7.2-preview.1",
1963
- method: "PATCH",
1964
- routeTemplate: "{project}/_apis/build/builds/{buildId}/stages/{stageRefName}",
1965
- routeValues: {
1966
- project: project,
1967
- buildId: buildId,
1968
- stageRefName: stageRefName
1969
- },
1970
- body: updateParameters
1971
- })];
1972
- });
1973
- });
1974
- };
1975
- /**
1976
- * \<p\>Gets the build status for a definition, optionally scoped to a specific branch, stage, job, and configuration.\</p\> \<p\>If there are more than one, then it is required to pass in a stageName value when specifying a jobName, and the same rule then applies for both if passing a configuration parameter.\</p\>
1977
- *
1978
- * @param project - Project ID or project name
1979
- * @param definition - Either the definition name with optional leading folder path, or the definition id.
1980
- * @param branchName - Only consider the most recent build for this branch. If not specified, the default branch is used.
1981
- * @param stageName - Use this stage within the pipeline to render the status.
1982
- * @param jobName - Use this job within a stage of the pipeline to render the status.
1983
- * @param configuration - Use this job configuration to render the status
1984
- * @param label - Replaces the default text on the left side of the badge.
1985
- */
1986
- BuildRestClient.prototype.getStatusBadge = function (project, definition, branchName, stageName, jobName, configuration, label) {
1987
- return __awaiter(this, void 0, void 0, function () {
1988
- var queryValues;
1989
- return __generator(this, function (_a) {
1990
- queryValues = {
1991
- branchName: branchName,
1992
- stageName: stageName,
1993
- jobName: jobName,
1994
- configuration: configuration,
1995
- label: label
1996
- };
1997
- return [2 /*return*/, this.beginRequest({
1998
- apiVersion: "7.2-preview.1",
1999
- routeTemplate: "{project}/_apis/build/status/{*definition}",
2000
- routeValues: {
2001
- project: project,
2002
- definition: definition
2003
- },
2004
- queryParams: queryValues
2005
- })];
2006
- });
2007
- });
2008
- };
2009
- /**
2010
- * Adds a tag to a build.
2011
- *
2012
- * @param project - Project ID or project name
2013
- * @param buildId - The ID of the build.
2014
- * @param tag - The tag to add.
2015
- */
2016
- BuildRestClient.prototype.addBuildTag = function (project, buildId, tag) {
2017
- return __awaiter(this, void 0, void 0, function () {
2018
- return __generator(this, function (_a) {
2019
- return [2 /*return*/, this.beginRequest({
2020
- apiVersion: "7.2-preview.3",
2021
- method: "PUT",
2022
- routeTemplate: "{project}/_apis/build/builds/{buildId}/tags/{*tag}",
2023
- routeValues: {
2024
- project: project,
2025
- buildId: buildId,
2026
- tag: tag
2027
- }
2028
- })];
2029
- });
2030
- });
2031
- };
2032
- /**
2033
- * Adds tags to a build.
2034
- *
2035
- * @param tags - The tags to add. Request body is composed directly from listed tags.
2036
- * @param project - Project ID or project name
2037
- * @param buildId - The ID of the build.
2038
- */
2039
- BuildRestClient.prototype.addBuildTags = function (tags, project, buildId) {
2040
- return __awaiter(this, void 0, void 0, function () {
2041
- return __generator(this, function (_a) {
2042
- return [2 /*return*/, this.beginRequest({
2043
- apiVersion: "7.2-preview.3",
2044
- method: "POST",
2045
- routeTemplate: "{project}/_apis/build/builds/{buildId}/tags/{*tag}",
2046
- routeValues: {
2047
- project: project,
2048
- buildId: buildId
2049
- },
2050
- body: tags
2051
- })];
2052
- });
2053
- });
2054
- };
2055
- /**
2056
- * Removes a tag from a build. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+)
2057
- *
2058
- * @param project - Project ID or project name
2059
- * @param buildId - The ID of the build.
2060
- * @param tag - The tag to remove.
2061
- */
2062
- BuildRestClient.prototype.deleteBuildTag = function (project, buildId, tag) {
2063
- return __awaiter(this, void 0, void 0, function () {
2064
- return __generator(this, function (_a) {
2065
- return [2 /*return*/, this.beginRequest({
2066
- apiVersion: "7.2-preview.3",
2067
- method: "DELETE",
2068
- routeTemplate: "{project}/_apis/build/builds/{buildId}/tags/{*tag}",
2069
- routeValues: {
2070
- project: project,
2071
- buildId: buildId,
2072
- tag: tag
2073
- }
2074
- })];
2075
- });
2076
- });
2077
- };
2078
- /**
2079
- * Gets the tags for a build.
2080
- *
2081
- * @param project - Project ID or project name
2082
- * @param buildId - The ID of the build.
2083
- */
2084
- BuildRestClient.prototype.getBuildTags = function (project, buildId) {
2085
- return __awaiter(this, void 0, void 0, function () {
2086
- return __generator(this, function (_a) {
2087
- return [2 /*return*/, this.beginRequest({
2088
- apiVersion: "7.2-preview.3",
2089
- routeTemplate: "{project}/_apis/build/builds/{buildId}/tags/{*tag}",
2090
- routeValues: {
2091
- project: project,
2092
- buildId: buildId
2093
- }
2094
- })];
2095
- });
2096
- });
2097
- };
2098
- /**
2099
- * Adds/Removes tags from a build.
2100
- *
2101
- * @param updateParameters - The tags to add/remove.
2102
- * @param project - Project ID or project name
2103
- * @param buildId - The ID of the build.
2104
- */
2105
- BuildRestClient.prototype.updateBuildTags = function (updateParameters, project, buildId) {
2106
- return __awaiter(this, void 0, void 0, function () {
2107
- return __generator(this, function (_a) {
2108
- return [2 /*return*/, this.beginRequest({
2109
- apiVersion: "7.2-preview.3",
2110
- method: "PATCH",
2111
- routeTemplate: "{project}/_apis/build/builds/{buildId}/tags/{*tag}",
2112
- routeValues: {
2113
- project: project,
2114
- buildId: buildId
2115
- },
2116
- body: updateParameters
2117
- })];
2118
- });
2119
- });
2120
- };
2121
- /**
2122
- * Adds a tag to a definition
2123
- *
2124
- * @param project - Project ID or project name
2125
- * @param definitionId - The ID of the definition.
2126
- * @param tag - The tag to add.
2127
- */
2128
- BuildRestClient.prototype.addDefinitionTag = function (project, definitionId, tag) {
2129
- return __awaiter(this, void 0, void 0, function () {
2130
- return __generator(this, function (_a) {
2131
- return [2 /*return*/, this.beginRequest({
2132
- apiVersion: "7.2-preview.3",
2133
- method: "PUT",
2134
- routeTemplate: "{project}/_apis/build/definitions/{DefinitionId}/tags/{*tag}",
2135
- routeValues: {
2136
- project: project,
2137
- definitionId: definitionId,
2138
- tag: tag
2139
- }
2140
- })];
2141
- });
2142
- });
2143
- };
2144
- /**
2145
- * Adds multiple tags to a definition.
2146
- *
2147
- * @param tags - The tags to add.
2148
- * @param project - Project ID or project name
2149
- * @param definitionId - The ID of the definition.
2150
- */
2151
- BuildRestClient.prototype.addDefinitionTags = function (tags, project, definitionId) {
2152
- return __awaiter(this, void 0, void 0, function () {
2153
- return __generator(this, function (_a) {
2154
- return [2 /*return*/, this.beginRequest({
2155
- apiVersion: "7.2-preview.3",
2156
- method: "POST",
2157
- routeTemplate: "{project}/_apis/build/definitions/{DefinitionId}/tags/{*tag}",
2158
- routeValues: {
2159
- project: project,
2160
- definitionId: definitionId
2161
- },
2162
- body: tags
2163
- })];
2164
- });
2165
- });
2166
- };
2167
- /**
2168
- * Removes a tag from a definition. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+)
2169
- *
2170
- * @param project - Project ID or project name
2171
- * @param definitionId - The ID of the definition.
2172
- * @param tag - The tag to remove.
2173
- */
2174
- BuildRestClient.prototype.deleteDefinitionTag = function (project, definitionId, tag) {
2175
- return __awaiter(this, void 0, void 0, function () {
2176
- return __generator(this, function (_a) {
2177
- return [2 /*return*/, this.beginRequest({
2178
- apiVersion: "7.2-preview.3",
2179
- method: "DELETE",
2180
- routeTemplate: "{project}/_apis/build/definitions/{DefinitionId}/tags/{*tag}",
2181
- routeValues: {
2182
- project: project,
2183
- definitionId: definitionId,
2184
- tag: tag
2185
- }
2186
- })];
2187
- });
2188
- });
2189
- };
2190
- /**
2191
- * Gets the tags for a definition.
2192
- *
2193
- * @param project - Project ID or project name
2194
- * @param definitionId - The ID of the definition.
2195
- * @param revision - The definition revision number. If not specified, uses the latest revision of the definition.
2196
- */
2197
- BuildRestClient.prototype.getDefinitionTags = function (project, definitionId, revision) {
2198
- return __awaiter(this, void 0, void 0, function () {
2199
- var queryValues;
2200
- return __generator(this, function (_a) {
2201
- queryValues = {
2202
- revision: revision
2203
- };
2204
- return [2 /*return*/, this.beginRequest({
2205
- apiVersion: "7.2-preview.3",
2206
- routeTemplate: "{project}/_apis/build/definitions/{DefinitionId}/tags/{*tag}",
2207
- routeValues: {
2208
- project: project,
2209
- definitionId: definitionId
2210
- },
2211
- queryParams: queryValues
2212
- })];
2213
- });
2214
- });
2215
- };
2216
- /**
2217
- * Adds/Removes tags from a definition.
2218
- *
2219
- * @param updateParameters - The tags to add/remove.
2220
- * @param project - Project ID or project name
2221
- * @param definitionId - The ID of the definition.
2222
- */
2223
- BuildRestClient.prototype.updateDefinitionTags = function (updateParameters, project, definitionId) {
2224
- return __awaiter(this, void 0, void 0, function () {
2225
- return __generator(this, function (_a) {
2226
- return [2 /*return*/, this.beginRequest({
2227
- apiVersion: "7.2-preview.3",
2228
- method: "PATCH",
2229
- routeTemplate: "{project}/_apis/build/definitions/{DefinitionId}/tags/{*tag}",
2230
- routeValues: {
2231
- project: project,
2232
- definitionId: definitionId
2233
- },
2234
- body: updateParameters
2235
- })];
2236
- });
2237
- });
2238
- };
2239
- /**
2240
- * Removes a tag from builds, definitions, and from the tag store
2241
- *
2242
- * @param project - Project ID or project name
2243
- * @param tag - The tag to remove.
2244
- */
2245
- BuildRestClient.prototype.deleteTag = function (project, tag) {
2246
- return __awaiter(this, void 0, void 0, function () {
2247
- return __generator(this, function (_a) {
2248
- return [2 /*return*/, this.beginRequest({
2249
- apiVersion: "7.2-preview.3",
2250
- method: "DELETE",
2251
- routeTemplate: "{project}/_apis/build/tags/{*tag}",
2252
- routeValues: {
2253
- project: project,
2254
- tag: tag
2255
- }
2256
- })];
2257
- });
2258
- });
2259
- };
2260
- /**
2261
- * Gets a list of all build tags in the project.
2262
- *
2263
- * @param project - Project ID or project name
2264
- */
2265
- BuildRestClient.prototype.getTags = function (project) {
2266
- return __awaiter(this, void 0, void 0, function () {
2267
- return __generator(this, function (_a) {
2268
- return [2 /*return*/, this.beginRequest({
2269
- apiVersion: "7.2-preview.3",
2270
- routeTemplate: "{project}/_apis/build/tags/{*tag}",
2271
- routeValues: {
2272
- project: project
2273
- }
2274
- })];
2275
- });
2276
- });
2277
- };
2278
- /**
2279
- * Deletes a build definition template.
2280
- *
2281
- * @param project - Project ID or project name
2282
- * @param templateId - The ID of the template.
2283
- */
2284
- BuildRestClient.prototype.deleteTemplate = function (project, templateId) {
2285
- return __awaiter(this, void 0, void 0, function () {
2286
- return __generator(this, function (_a) {
2287
- return [2 /*return*/, this.beginRequest({
2288
- apiVersion: "7.2-preview.3",
2289
- method: "DELETE",
2290
- routeTemplate: "{project}/_apis/build/definitions/templates/{templateId}",
2291
- routeValues: {
2292
- project: project,
2293
- templateId: templateId
2294
- }
2295
- })];
2296
- });
2297
- });
2298
- };
2299
- /**
2300
- * Gets a specific build definition template.
2301
- *
2302
- * @param project - Project ID or project name
2303
- * @param templateId - The ID of the requested template.
2304
- */
2305
- BuildRestClient.prototype.getTemplate = function (project, templateId) {
2306
- return __awaiter(this, void 0, void 0, function () {
2307
- return __generator(this, function (_a) {
2308
- return [2 /*return*/, this.beginRequest({
2309
- apiVersion: "7.2-preview.3",
2310
- routeTemplate: "{project}/_apis/build/definitions/templates/{templateId}",
2311
- routeValues: {
2312
- project: project,
2313
- templateId: templateId
2314
- }
2315
- })];
2316
- });
2317
- });
2318
- };
2319
- /**
2320
- * Gets all definition templates.
2321
- *
2322
- * @param project - Project ID or project name
2323
- */
2324
- BuildRestClient.prototype.getTemplates = function (project) {
2325
- return __awaiter(this, void 0, void 0, function () {
2326
- return __generator(this, function (_a) {
2327
- return [2 /*return*/, this.beginRequest({
2328
- apiVersion: "7.2-preview.3",
2329
- routeTemplate: "{project}/_apis/build/definitions/templates/{templateId}",
2330
- routeValues: {
2331
- project: project
2332
- }
2333
- })];
2334
- });
2335
- });
2336
- };
2337
- /**
2338
- * Updates an existing build definition template.
2339
- *
2340
- * @param template - The new version of the template.
2341
- * @param project - Project ID or project name
2342
- * @param templateId - The ID of the template.
2343
- */
2344
- BuildRestClient.prototype.saveTemplate = function (template, project, templateId) {
2345
- return __awaiter(this, void 0, void 0, function () {
2346
- return __generator(this, function (_a) {
2347
- return [2 /*return*/, this.beginRequest({
2348
- apiVersion: "7.2-preview.3",
2349
- method: "PUT",
2350
- routeTemplate: "{project}/_apis/build/definitions/templates/{templateId}",
2351
- routeValues: {
2352
- project: project,
2353
- templateId: templateId
2354
- },
2355
- body: template
2356
- })];
2357
- });
2358
- });
2359
- };
2360
- /**
2361
- * Gets details for a build
2362
- *
2363
- * @param project - Project ID or project name
2364
- * @param buildId -
2365
- * @param timelineId -
2366
- * @param changeId -
2367
- * @param planId -
2368
- */
2369
- BuildRestClient.prototype.getBuildTimeline = function (project, buildId, timelineId, changeId, planId) {
2370
- return __awaiter(this, void 0, void 0, function () {
2371
- var queryValues;
2372
- return __generator(this, function (_a) {
2373
- queryValues = {
2374
- changeId: changeId,
2375
- planId: planId
2376
- };
2377
- return [2 /*return*/, this.beginRequest({
2378
- apiVersion: "7.2-preview.3",
2379
- routeTemplate: "{project}/_apis/build/builds/{buildId}/Timeline/{timelineId}",
2380
- routeValues: {
2381
- project: project,
2382
- buildId: buildId,
2383
- timelineId: timelineId
2384
- },
2385
- queryParams: queryValues
2386
- })];
2387
- });
2388
- });
2389
- };
2390
- /**
2391
- * Recreates the webhooks for the specified triggers in the given source code repository.
2392
- *
2393
- * @param triggerTypes - The types of triggers to restore webhooks for.
2394
- * @param project - Project ID or project name
2395
- * @param providerName - The name of the source provider.
2396
- * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
2397
- * @param repository - If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories.
2398
- */
2399
- BuildRestClient.prototype.restoreWebhooks = function (triggerTypes, project, providerName, serviceEndpointId, repository) {
2400
- return __awaiter(this, void 0, void 0, function () {
2401
- var queryValues;
2402
- return __generator(this, function (_a) {
2403
- queryValues = {
2404
- serviceEndpointId: serviceEndpointId,
2405
- repository: repository
2406
- };
2407
- return [2 /*return*/, this.beginRequest({
2408
- apiVersion: "7.2-preview.1",
2409
- method: "POST",
2410
- routeTemplate: "{project}/_apis/sourceProviders/{providerName}/webhooks",
2411
- routeValues: {
2412
- project: project,
2413
- providerName: providerName
2414
- },
2415
- queryParams: queryValues,
2416
- body: triggerTypes
2417
- })];
2418
- });
2419
- });
2420
- };
2421
- /**
2422
- * Gets a list of webhooks installed in the given source code repository.
2423
- *
2424
- * @param project - Project ID or project name
2425
- * @param providerName - The name of the source provider.
2426
- * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
2427
- * @param repository - If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories.
2428
- */
2429
- BuildRestClient.prototype.listWebhooks = function (project, providerName, serviceEndpointId, repository) {
2430
- return __awaiter(this, void 0, void 0, function () {
2431
- var queryValues;
2432
- return __generator(this, function (_a) {
2433
- queryValues = {
2434
- serviceEndpointId: serviceEndpointId,
2435
- repository: repository
2436
- };
2437
- return [2 /*return*/, this.beginRequest({
2438
- apiVersion: "7.2-preview.1",
2439
- routeTemplate: "{project}/_apis/sourceProviders/{providerName}/webhooks",
2440
- routeValues: {
2441
- project: project,
2442
- providerName: providerName
2443
- },
2444
- queryParams: queryValues
2445
- })];
2446
- });
2447
- });
2448
- };
2449
- /**
2450
- * Gets the work items associated with a build. Only work items in the same project are returned.
2451
- *
2452
- * @param project - Project ID or project name
2453
- * @param buildId - The ID of the build.
2454
- * @param top - The maximum number of work items to return.
2455
- */
2456
- BuildRestClient.prototype.getBuildWorkItemsRefs = function (project, buildId, top) {
2457
- return __awaiter(this, void 0, void 0, function () {
2458
- var queryValues;
2459
- return __generator(this, function (_a) {
2460
- queryValues = {
2461
- '$top': top
2462
- };
2463
- return [2 /*return*/, this.beginRequest({
2464
- apiVersion: "7.2-preview.2",
2465
- routeTemplate: "{project}/_apis/build/builds/{buildId}/workitems",
2466
- routeValues: {
2467
- project: project,
2468
- buildId: buildId
2469
- },
2470
- queryParams: queryValues
2471
- })];
2472
- });
2473
- });
2474
- };
2475
- /**
2476
- * Gets the work items associated with a build, filtered to specific commits.
2477
- *
2478
- * @param commitIds - A comma-delimited list of commit IDs.
2479
- * @param project - Project ID or project name
2480
- * @param buildId - The ID of the build.
2481
- * @param top - The maximum number of work items to return, or the number of commits to consider if no commit IDs are specified.
2482
- */
2483
- BuildRestClient.prototype.getBuildWorkItemsRefsFromCommits = function (commitIds, project, buildId, top) {
2484
- return __awaiter(this, void 0, void 0, function () {
2485
- var queryValues;
2486
- return __generator(this, function (_a) {
2487
- queryValues = {
2488
- '$top': top
2489
- };
2490
- return [2 /*return*/, this.beginRequest({
2491
- apiVersion: "7.2-preview.2",
2492
- method: "POST",
2493
- routeTemplate: "{project}/_apis/build/builds/{buildId}/workitems",
2494
- routeValues: {
2495
- project: project,
2496
- buildId: buildId
2497
- },
2498
- queryParams: queryValues,
2499
- body: commitIds
2500
- })];
2501
- });
2502
- });
2503
- };
2504
- /**
2505
- * Gets all the work items between two builds.
2506
- *
2507
- * @param project - Project ID or project name
2508
- * @param fromBuildId - The ID of the first build.
2509
- * @param toBuildId - The ID of the last build.
2510
- * @param top - The maximum number of work items to return.
2511
- */
2512
- BuildRestClient.prototype.getWorkItemsBetweenBuilds = function (project, fromBuildId, toBuildId, top) {
2513
- return __awaiter(this, void 0, void 0, function () {
2514
- var queryValues;
2515
- return __generator(this, function (_a) {
2516
- queryValues = {
2517
- fromBuildId: fromBuildId,
2518
- toBuildId: toBuildId,
2519
- '$top': top
2520
- };
2521
- return [2 /*return*/, this.beginRequest({
2522
- apiVersion: "7.2-preview.2",
2523
- routeTemplate: "{project}/_apis/build/workitems",
2524
- routeValues: {
2525
- project: project
2526
- },
2527
- queryParams: queryValues
2528
- })];
2529
- });
2530
- });
2531
- };
2532
- /**
2533
- * Converts a definition to YAML, optionally at a specific revision.
2534
- *
2535
- * @param project - Project ID or project name
2536
- * @param definitionId - The ID of the definition.
2537
- * @param revision - The revision number to retrieve. If this is not specified, the latest version will be returned.
2538
- * @param minMetricsTime - If specified, indicates the date from which metrics should be included.
2539
- * @param propertyFilters - A comma-delimited list of properties to include in the results.
2540
- * @param includeLatestBuilds -
2541
- */
2542
- BuildRestClient.prototype.getDefinitionYaml = function (project, definitionId, revision, minMetricsTime, propertyFilters, includeLatestBuilds) {
2543
- return __awaiter(this, void 0, void 0, function () {
2544
- var queryValues;
2545
- return __generator(this, function (_a) {
2546
- queryValues = {
2547
- revision: revision,
2548
- minMetricsTime: minMetricsTime,
2549
- propertyFilters: propertyFilters && propertyFilters.join(","),
2550
- includeLatestBuilds: includeLatestBuilds
2551
- };
2552
- return [2 /*return*/, this.beginRequest({
2553
- apiVersion: "7.2-preview.1",
2554
- routeTemplate: "{project}/_apis/build/definitions/{definitionId}/yaml",
2555
- routeValues: {
2556
- project: project,
2557
- definitionId: definitionId
2558
- },
2559
- queryParams: queryValues
2560
- })];
2561
- });
2562
- });
2563
- };
2564
- BuildRestClient.RESOURCE_AREA_ID = "965220d5-5bb9-42cf-8d67-9b146df2a5a4";
2565
- return BuildRestClient;
2566
- }(RestClientBase_1.RestClientBase));
2567
- exports.BuildRestClient = BuildRestClient;
2568
- });
1
+ "use strict";
2
+ /*
3
+ * ---------------------------------------------------------
4
+ * Copyright(C) Microsoft Corporation. All rights reserved.
5
+ * ---------------------------------------------------------
6
+ */
7
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9
+ return new (P || (P = Promise))(function (resolve, reject) {
10
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
13
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
14
+ });
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.BuildRestClient = void 0;
18
+ const RestClientBase_1 = require("../Common/RestClientBase");
19
+ const Serialization_1 = require("../Common/Util/Serialization");
20
+ class BuildRestClient extends RestClientBase_1.RestClientBase {
21
+ constructor(options) {
22
+ super(options);
23
+ }
24
+ /**
25
+ * Associates an artifact with a build.
26
+ *
27
+ * @param artifact - The artifact.
28
+ * @param project - Project ID or project name
29
+ * @param buildId - The ID of the build.
30
+ */
31
+ createArtifact(artifact, project, buildId) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ return this.beginRequest({
34
+ apiVersion: "7.2-preview.5",
35
+ method: "POST",
36
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/artifacts/{artifactName}",
37
+ routeValues: {
38
+ project: project,
39
+ buildId: buildId
40
+ },
41
+ body: artifact
42
+ });
43
+ });
44
+ }
45
+ /**
46
+ * Gets a specific artifact for a build.
47
+ *
48
+ * @param project - Project ID or project name
49
+ * @param buildId - The ID of the build.
50
+ * @param artifactName - The name of the artifact.
51
+ */
52
+ getArtifact(project, buildId, artifactName) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ const queryValues = {
55
+ artifactName: artifactName
56
+ };
57
+ return this.beginRequest({
58
+ apiVersion: "7.2-preview.5",
59
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/artifacts/{artifactName}",
60
+ routeValues: {
61
+ project: project,
62
+ buildId: buildId
63
+ },
64
+ queryParams: queryValues
65
+ });
66
+ });
67
+ }
68
+ /**
69
+ * Gets a specific artifact for a build.
70
+ *
71
+ * @param project - Project ID or project name
72
+ * @param buildId - The ID of the build.
73
+ * @param artifactName - The name of the artifact.
74
+ */
75
+ getArtifactContentZip(project, buildId, artifactName) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ const queryValues = {
78
+ artifactName: artifactName
79
+ };
80
+ return this.beginRequest({
81
+ apiVersion: "7.2-preview.5",
82
+ httpResponseType: "application/zip",
83
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/artifacts/{artifactName}",
84
+ routeValues: {
85
+ project: project,
86
+ buildId: buildId
87
+ },
88
+ queryParams: queryValues
89
+ });
90
+ });
91
+ }
92
+ /**
93
+ * Gets all artifacts for a build.
94
+ *
95
+ * @param project - Project ID or project name
96
+ * @param buildId - The ID of the build.
97
+ */
98
+ getArtifacts(project, buildId) {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ return this.beginRequest({
101
+ apiVersion: "7.2-preview.5",
102
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/artifacts/{artifactName}",
103
+ routeValues: {
104
+ project: project,
105
+ buildId: buildId
106
+ }
107
+ });
108
+ });
109
+ }
110
+ /**
111
+ * Gets a file from the build.
112
+ *
113
+ * @param project - Project ID or project name
114
+ * @param buildId - The ID of the build.
115
+ * @param artifactName - The name of the artifact.
116
+ * @param fileId - The primary key for the file.
117
+ * @param fileName - The name that the file will be set to.
118
+ */
119
+ getFile(project, buildId, artifactName, fileId, fileName) {
120
+ return __awaiter(this, void 0, void 0, function* () {
121
+ const queryValues = {
122
+ artifactName: artifactName,
123
+ fileId: fileId,
124
+ fileName: fileName
125
+ };
126
+ return this.beginRequest({
127
+ apiVersion: "7.2-preview.5",
128
+ httpResponseType: "application/octet-stream",
129
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/artifacts/{artifactName}",
130
+ routeValues: {
131
+ project: project,
132
+ buildId: buildId
133
+ },
134
+ queryParams: queryValues
135
+ });
136
+ });
137
+ }
138
+ /**
139
+ * Gets the list of attachments of a specific type that are associated with a build.
140
+ *
141
+ * @param project - Project ID or project name
142
+ * @param buildId - The ID of the build.
143
+ * @param type - The type of attachment.
144
+ */
145
+ getAttachments(project, buildId, type) {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ return this.beginRequest({
148
+ apiVersion: "7.2-preview.2",
149
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/attachments/{type}",
150
+ routeValues: {
151
+ project: project,
152
+ buildId: buildId,
153
+ type: type
154
+ }
155
+ });
156
+ });
157
+ }
158
+ /**
159
+ * Gets a specific attachment.
160
+ *
161
+ * @param project - Project ID or project name
162
+ * @param buildId - The ID of the build.
163
+ * @param timelineId - The ID of the timeline.
164
+ * @param recordId - The ID of the timeline record.
165
+ * @param type - The type of the attachment.
166
+ * @param name - The name of the attachment.
167
+ */
168
+ getAttachment(project, buildId, timelineId, recordId, type, name) {
169
+ return __awaiter(this, void 0, void 0, function* () {
170
+ return this.beginRequest({
171
+ apiVersion: "7.2-preview.2",
172
+ httpResponseType: "application/octet-stream",
173
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/{timelineId}/{recordId}/attachments/{type}/{name}",
174
+ routeValues: {
175
+ project: project,
176
+ buildId: buildId,
177
+ timelineId: timelineId,
178
+ recordId: recordId,
179
+ type: type,
180
+ name: name
181
+ }
182
+ });
183
+ });
184
+ }
185
+ /**
186
+ * @param resources -
187
+ * @param project - Project ID or project name
188
+ */
189
+ authorizeProjectResources(resources, project) {
190
+ return __awaiter(this, void 0, void 0, function* () {
191
+ return this.beginRequest({
192
+ apiVersion: "7.2-preview.1",
193
+ method: "PATCH",
194
+ routeTemplate: "{project}/_apis/build/authorizedresources",
195
+ routeValues: {
196
+ project: project
197
+ },
198
+ body: resources
199
+ });
200
+ });
201
+ }
202
+ /**
203
+ * @param project - Project ID or project name
204
+ * @param type -
205
+ * @param id -
206
+ */
207
+ getProjectResources(project, type, id) {
208
+ return __awaiter(this, void 0, void 0, function* () {
209
+ const queryValues = {
210
+ type: type,
211
+ id: id
212
+ };
213
+ return this.beginRequest({
214
+ apiVersion: "7.2-preview.1",
215
+ routeTemplate: "{project}/_apis/build/authorizedresources",
216
+ routeValues: {
217
+ project: project
218
+ },
219
+ queryParams: queryValues
220
+ });
221
+ });
222
+ }
223
+ /**
224
+ * Gets a badge that indicates the status of the most recent build for a definition. Note that this API is deprecated. Prefer StatusBadgeController.GetStatusBadge.
225
+ *
226
+ * @param project - The project ID or name.
227
+ * @param definitionId - The ID of the definition.
228
+ * @param branchName - The name of the branch.
229
+ */
230
+ getBadge(project, definitionId, branchName) {
231
+ return __awaiter(this, void 0, void 0, function* () {
232
+ const queryValues = {
233
+ branchName: branchName
234
+ };
235
+ return this.beginRequest({
236
+ apiVersion: "7.2-preview.2",
237
+ routeTemplate: "_apis/public/build/definitions/{project}/{definitionId}/badge",
238
+ routeValues: {
239
+ project: project,
240
+ definitionId: definitionId
241
+ },
242
+ queryParams: queryValues
243
+ });
244
+ });
245
+ }
246
+ /**
247
+ * Gets a list of branches for the given source code repository.
248
+ *
249
+ * @param project - Project ID or project name
250
+ * @param providerName - The name of the source provider.
251
+ * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
252
+ * @param repository - The vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories.
253
+ * @param branchName - If supplied, the name of the branch to check for specifically.
254
+ */
255
+ listBranches(project, providerName, serviceEndpointId, repository, branchName) {
256
+ return __awaiter(this, void 0, void 0, function* () {
257
+ const queryValues = {
258
+ serviceEndpointId: serviceEndpointId,
259
+ repository: repository,
260
+ branchName: branchName
261
+ };
262
+ return this.beginRequest({
263
+ apiVersion: "7.2-preview.1",
264
+ routeTemplate: "{project}/_apis/sourceProviders/{providerName}/branches",
265
+ routeValues: {
266
+ project: project,
267
+ providerName: providerName
268
+ },
269
+ queryParams: queryValues
270
+ });
271
+ });
272
+ }
273
+ /**
274
+ * Gets a badge that indicates the status of the most recent build for the specified branch.
275
+ *
276
+ * @param project - Project ID or project name
277
+ * @param repoType - The repository type.
278
+ * @param repoId - The repository ID.
279
+ * @param branchName - The branch name.
280
+ */
281
+ getBuildBadge(project, repoType, repoId, branchName) {
282
+ return __awaiter(this, void 0, void 0, function* () {
283
+ const queryValues = {
284
+ repoId: repoId,
285
+ branchName: branchName
286
+ };
287
+ return this.beginRequest({
288
+ apiVersion: "7.2-preview.2",
289
+ routeTemplate: "{project}/_apis/build/repos/{repoType}/badge",
290
+ routeValues: {
291
+ project: project,
292
+ repoType: repoType
293
+ },
294
+ queryParams: queryValues
295
+ });
296
+ });
297
+ }
298
+ /**
299
+ * Gets a badge that indicates the status of the most recent build for the specified branch.
300
+ *
301
+ * @param project - Project ID or project name
302
+ * @param repoType - The repository type.
303
+ * @param repoId - The repository ID.
304
+ * @param branchName - The branch name.
305
+ */
306
+ getBuildBadgeData(project, repoType, repoId, branchName) {
307
+ return __awaiter(this, void 0, void 0, function* () {
308
+ const queryValues = {
309
+ repoId: repoId,
310
+ branchName: branchName
311
+ };
312
+ return this.beginRequest({
313
+ apiVersion: "7.2-preview.2",
314
+ routeTemplate: "{project}/_apis/build/repos/{repoType}/badge",
315
+ routeValues: {
316
+ project: project,
317
+ repoType: repoType
318
+ },
319
+ queryParams: queryValues
320
+ });
321
+ });
322
+ }
323
+ /**
324
+ * Gets all retention leases that apply to a specific build.
325
+ *
326
+ * @param project - Project ID or project name
327
+ * @param buildId - The ID of the build.
328
+ */
329
+ getRetentionLeasesForBuild(project, buildId) {
330
+ return __awaiter(this, void 0, void 0, function* () {
331
+ return this.beginRequest({
332
+ apiVersion: "7.2-preview.1",
333
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/leases",
334
+ routeValues: {
335
+ project: project,
336
+ buildId: buildId
337
+ }
338
+ });
339
+ });
340
+ }
341
+ /**
342
+ * Deletes a build.
343
+ *
344
+ * @param project - Project ID or project name
345
+ * @param buildId - The ID of the build.
346
+ */
347
+ deleteBuild(project, buildId) {
348
+ return __awaiter(this, void 0, void 0, function* () {
349
+ return this.beginRequest({
350
+ apiVersion: "7.2-preview.8",
351
+ method: "DELETE",
352
+ routeTemplate: "{project}/_apis/build/builds/{buildId}",
353
+ routeValues: {
354
+ project: project,
355
+ buildId: buildId
356
+ }
357
+ });
358
+ });
359
+ }
360
+ /**
361
+ * Gets a build
362
+ *
363
+ * @param project - Project ID or project name
364
+ * @param buildId -
365
+ * @param propertyFilters -
366
+ */
367
+ getBuild(project, buildId, propertyFilters) {
368
+ return __awaiter(this, void 0, void 0, function* () {
369
+ const queryValues = {
370
+ propertyFilters: propertyFilters
371
+ };
372
+ return this.beginRequest({
373
+ apiVersion: "7.2-preview.8",
374
+ routeTemplate: "{project}/_apis/build/builds/{buildId}",
375
+ routeValues: {
376
+ project: project,
377
+ buildId: buildId
378
+ },
379
+ queryParams: queryValues
380
+ });
381
+ });
382
+ }
383
+ /**
384
+ * Gets a list of builds.
385
+ *
386
+ * @param project - Project ID or project name
387
+ * @param definitions - A comma-delimited list of definition IDs. If specified, filters to builds for these definitions.
388
+ * @param queues - A comma-delimited list of queue IDs. If specified, filters to builds that ran against these queues.
389
+ * @param buildNumber - If specified, filters to builds that match this build number. Append * to do a prefix search.
390
+ * @param minTime - If specified, filters to builds that finished/started/queued after this date based on the queryOrder specified.
391
+ * @param maxTime - If specified, filters to builds that finished/started/queued before this date based on the queryOrder specified.
392
+ * @param requestedFor - If specified, filters to builds requested for the specified user.
393
+ * @param reasonFilter - If specified, filters to builds that match this reason.
394
+ * @param statusFilter - If specified, filters to builds that match this status.
395
+ * @param resultFilter - If specified, filters to builds that match this result.
396
+ * @param tagFilters - A comma-delimited list of tags. If specified, filters to builds that have the specified tags.
397
+ * @param properties - A comma-delimited list of properties to retrieve.
398
+ * @param top - The maximum number of builds to return.
399
+ * @param continuationToken - A continuation token, returned by a previous call to this method, that can be used to return the next set of builds.
400
+ * @param maxBuildsPerDefinition - The maximum number of builds to return per definition.
401
+ * @param deletedFilter - Indicates whether to exclude, include, or only return deleted builds.
402
+ * @param queryOrder - The order in which builds should be returned.
403
+ * @param branchName - If specified, filters to builds that built branches that built this branch.
404
+ * @param buildIds - A comma-delimited list that specifies the IDs of builds to retrieve.
405
+ * @param repositoryId - If specified, filters to builds that built from this repository.
406
+ * @param repositoryType - If specified, filters to builds that built from repositories of this type.
407
+ */
408
+ getBuilds(project, definitions, queues, buildNumber, minTime, maxTime, requestedFor, reasonFilter, statusFilter, resultFilter, tagFilters, properties, top, continuationToken, maxBuildsPerDefinition, deletedFilter, queryOrder, branchName, buildIds, repositoryId, repositoryType) {
409
+ return __awaiter(this, void 0, void 0, function* () {
410
+ const queryValues = {
411
+ definitions: definitions && definitions.join(","),
412
+ queues: queues && queues.join(","),
413
+ buildNumber: buildNumber,
414
+ minTime: minTime,
415
+ maxTime: maxTime,
416
+ requestedFor: requestedFor,
417
+ reasonFilter: reasonFilter,
418
+ statusFilter: statusFilter,
419
+ resultFilter: resultFilter,
420
+ tagFilters: tagFilters && tagFilters.join(","),
421
+ properties: properties && properties.join(","),
422
+ '$top': top,
423
+ continuationToken: continuationToken,
424
+ maxBuildsPerDefinition: maxBuildsPerDefinition,
425
+ deletedFilter: deletedFilter,
426
+ queryOrder: queryOrder,
427
+ branchName: branchName,
428
+ buildIds: buildIds && buildIds.join(","),
429
+ repositoryId: repositoryId,
430
+ repositoryType: repositoryType
431
+ };
432
+ return this.beginRequest({
433
+ apiVersion: "7.2-preview.8",
434
+ routeTemplate: "{project}/_apis/build/builds/{buildId}",
435
+ routeValues: {
436
+ project: project
437
+ },
438
+ queryParams: queryValues,
439
+ returnRawResponse: true
440
+ }).then((response) => __awaiter(this, void 0, void 0, function* () {
441
+ const body = yield response.text().then(Serialization_1.deserializeVssJsonObject);
442
+ body.continuationToken = response.headers.get("x-ms-continuationtoken");
443
+ return body;
444
+ }));
445
+ });
446
+ }
447
+ /**
448
+ * Queues a build
449
+ *
450
+ * @param build -
451
+ * @param project - Project ID or project name
452
+ * @param ignoreWarnings -
453
+ * @param checkInTicket -
454
+ * @param sourceBuildId -
455
+ * @param definitionId - Optional definition id to queue a build without a body. Ignored if there's a valid body
456
+ */
457
+ queueBuild(build, project, ignoreWarnings, checkInTicket, sourceBuildId, definitionId) {
458
+ return __awaiter(this, void 0, void 0, function* () {
459
+ const queryValues = {
460
+ ignoreWarnings: ignoreWarnings,
461
+ checkInTicket: checkInTicket,
462
+ sourceBuildId: sourceBuildId,
463
+ definitionId: definitionId
464
+ };
465
+ return this.beginRequest({
466
+ apiVersion: "7.2-preview.8",
467
+ method: "POST",
468
+ routeTemplate: "{project}/_apis/build/builds/{buildId}",
469
+ routeValues: {
470
+ project: project
471
+ },
472
+ queryParams: queryValues,
473
+ body: build
474
+ });
475
+ });
476
+ }
477
+ /**
478
+ * Updates a build.
479
+ *
480
+ * @param build - The build.
481
+ * @param project - Project ID or project name
482
+ * @param buildId - The ID of the build.
483
+ * @param retry -
484
+ */
485
+ updateBuild(build, project, buildId, retry) {
486
+ return __awaiter(this, void 0, void 0, function* () {
487
+ const queryValues = {
488
+ retry: retry
489
+ };
490
+ return this.beginRequest({
491
+ apiVersion: "7.2-preview.8",
492
+ method: "PATCH",
493
+ routeTemplate: "{project}/_apis/build/builds/{buildId}",
494
+ routeValues: {
495
+ project: project,
496
+ buildId: buildId
497
+ },
498
+ queryParams: queryValues,
499
+ body: build
500
+ });
501
+ });
502
+ }
503
+ /**
504
+ * Updates multiple builds.
505
+ *
506
+ * @param builds - The builds to update.
507
+ * @param project - Project ID or project name
508
+ */
509
+ updateBuilds(builds, project) {
510
+ return __awaiter(this, void 0, void 0, function* () {
511
+ return this.beginRequest({
512
+ apiVersion: "7.2-preview.8",
513
+ method: "PATCH",
514
+ routeTemplate: "{project}/_apis/build/builds/{buildId}",
515
+ routeValues: {
516
+ project: project
517
+ },
518
+ body: builds
519
+ });
520
+ });
521
+ }
522
+ /**
523
+ * Gets the changes associated with a build
524
+ *
525
+ * @param project - Project ID or project name
526
+ * @param buildId -
527
+ * @param continuationToken -
528
+ * @param top - The maximum number of changes to return
529
+ * @param includeSourceChange -
530
+ */
531
+ getBuildChanges(project, buildId, continuationToken, top, includeSourceChange) {
532
+ return __awaiter(this, void 0, void 0, function* () {
533
+ const queryValues = {
534
+ continuationToken: continuationToken,
535
+ '$top': top,
536
+ includeSourceChange: includeSourceChange
537
+ };
538
+ return this.beginRequest({
539
+ apiVersion: "7.2-preview.2",
540
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/changes",
541
+ routeValues: {
542
+ project: project,
543
+ buildId: buildId
544
+ },
545
+ queryParams: queryValues,
546
+ returnRawResponse: true
547
+ }).then((response) => __awaiter(this, void 0, void 0, function* () {
548
+ const body = yield response.text().then(Serialization_1.deserializeVssJsonObject);
549
+ body.continuationToken = response.headers.get("x-ms-continuationtoken");
550
+ return body;
551
+ }));
552
+ });
553
+ }
554
+ /**
555
+ * Gets the changes made to the repository between two given builds.
556
+ *
557
+ * @param project - Project ID or project name
558
+ * @param fromBuildId - The ID of the first build.
559
+ * @param toBuildId - The ID of the last build.
560
+ * @param top - The maximum number of changes to return.
561
+ */
562
+ getChangesBetweenBuilds(project, fromBuildId, toBuildId, top) {
563
+ return __awaiter(this, void 0, void 0, function* () {
564
+ const queryValues = {
565
+ fromBuildId: fromBuildId,
566
+ toBuildId: toBuildId,
567
+ '$top': top
568
+ };
569
+ return this.beginRequest({
570
+ apiVersion: "7.2-preview.2",
571
+ routeTemplate: "{project}/_apis/build/changes",
572
+ routeValues: {
573
+ project: project
574
+ },
575
+ queryParams: queryValues
576
+ });
577
+ });
578
+ }
579
+ /**
580
+ * Gets a controller
581
+ *
582
+ * @param controllerId -
583
+ */
584
+ getBuildController(controllerId) {
585
+ return __awaiter(this, void 0, void 0, function* () {
586
+ return this.beginRequest({
587
+ apiVersion: "7.2-preview.2",
588
+ routeTemplate: "_apis/build/Controllers/{controllerId}",
589
+ routeValues: {
590
+ controllerId: controllerId
591
+ }
592
+ });
593
+ });
594
+ }
595
+ /**
596
+ * Gets controller, optionally filtered by name
597
+ *
598
+ * @param name -
599
+ */
600
+ getBuildControllers(name) {
601
+ return __awaiter(this, void 0, void 0, function* () {
602
+ const queryValues = {
603
+ name: name
604
+ };
605
+ return this.beginRequest({
606
+ apiVersion: "7.2-preview.2",
607
+ routeTemplate: "_apis/build/Controllers/{controllerId}",
608
+ queryParams: queryValues
609
+ });
610
+ });
611
+ }
612
+ /**
613
+ * Creates a new definition.
614
+ *
615
+ * @param definition - The definition.
616
+ * @param project - Project ID or project name
617
+ * @param definitionToCloneId -
618
+ * @param definitionToCloneRevision -
619
+ */
620
+ createDefinition(definition, project, definitionToCloneId, definitionToCloneRevision) {
621
+ return __awaiter(this, void 0, void 0, function* () {
622
+ const queryValues = {
623
+ definitionToCloneId: definitionToCloneId,
624
+ definitionToCloneRevision: definitionToCloneRevision
625
+ };
626
+ return this.beginRequest({
627
+ apiVersion: "7.2-preview.8",
628
+ method: "POST",
629
+ routeTemplate: "{project}/_apis/build/definitions/{definitionId}",
630
+ routeValues: {
631
+ project: project
632
+ },
633
+ queryParams: queryValues,
634
+ body: definition
635
+ });
636
+ });
637
+ }
638
+ /**
639
+ * Deletes a definition and all associated builds.
640
+ *
641
+ * @param project - Project ID or project name
642
+ * @param definitionId - The ID of the definition.
643
+ */
644
+ deleteDefinition(project, definitionId) {
645
+ return __awaiter(this, void 0, void 0, function* () {
646
+ return this.beginRequest({
647
+ apiVersion: "7.2-preview.8",
648
+ method: "DELETE",
649
+ routeTemplate: "{project}/_apis/build/definitions/{definitionId}",
650
+ routeValues: {
651
+ project: project,
652
+ definitionId: definitionId
653
+ }
654
+ });
655
+ });
656
+ }
657
+ /**
658
+ * Gets a definition, optionally at a specific revision.
659
+ *
660
+ * @param project - Project ID or project name
661
+ * @param definitionId - The ID of the definition.
662
+ * @param revision - The revision number to retrieve. If this is not specified, the latest version will be returned.
663
+ * @param minMetricsTime - If specified, indicates the date from which metrics should be included.
664
+ * @param propertyFilters - A comma-delimited list of properties to include in the results.
665
+ * @param includeLatestBuilds -
666
+ */
667
+ getDefinition(project, definitionId, revision, minMetricsTime, propertyFilters, includeLatestBuilds) {
668
+ return __awaiter(this, void 0, void 0, function* () {
669
+ const queryValues = {
670
+ revision: revision,
671
+ minMetricsTime: minMetricsTime,
672
+ propertyFilters: propertyFilters && propertyFilters.join(","),
673
+ includeLatestBuilds: includeLatestBuilds
674
+ };
675
+ return this.beginRequest({
676
+ apiVersion: "7.2-preview.8",
677
+ routeTemplate: "{project}/_apis/build/definitions/{definitionId}",
678
+ routeValues: {
679
+ project: project,
680
+ definitionId: definitionId
681
+ },
682
+ queryParams: queryValues
683
+ });
684
+ });
685
+ }
686
+ /**
687
+ * Gets a list of definitions.
688
+ *
689
+ * @param project - Project ID or project name
690
+ * @param name - If specified, filters to definitions whose names match this pattern.
691
+ * @param repositoryId - A repository ID. If specified, filters to definitions that use this repository.
692
+ * @param repositoryType - If specified, filters to definitions that have a repository of this type.
693
+ * @param queryOrder - Indicates the order in which definitions should be returned.
694
+ * @param top - The maximum number of definitions to return.
695
+ * @param continuationToken - A continuation token, returned by a previous call to this method, that can be used to return the next set of definitions.
696
+ * @param minMetricsTime - If specified, indicates the date from which metrics should be included.
697
+ * @param definitionIds - A comma-delimited list that specifies the IDs of definitions to retrieve.
698
+ * @param path - If specified, filters to definitions under this folder.
699
+ * @param builtAfter - If specified, filters to definitions that have builds after this date.
700
+ * @param notBuiltAfter - If specified, filters to definitions that do not have builds after this date.
701
+ * @param includeAllProperties - Indicates whether the full definitions should be returned. By default, shallow representations of the definitions are returned.
702
+ * @param includeLatestBuilds - Indicates whether to return the latest and latest completed builds for this definition.
703
+ * @param taskIdFilter - If specified, filters to definitions that use the specified task.
704
+ * @param processType - If specified, filters to definitions with the given process type.
705
+ * @param yamlFilename - If specified, filters to YAML definitions that match the given filename. To use this filter includeAllProperties should be set to true
706
+ */
707
+ getDefinitions(project, name, repositoryId, repositoryType, queryOrder, top, continuationToken, minMetricsTime, definitionIds, path, builtAfter, notBuiltAfter, includeAllProperties, includeLatestBuilds, taskIdFilter, processType, yamlFilename) {
708
+ return __awaiter(this, void 0, void 0, function* () {
709
+ const queryValues = {
710
+ name: name,
711
+ repositoryId: repositoryId,
712
+ repositoryType: repositoryType,
713
+ queryOrder: queryOrder,
714
+ '$top': top,
715
+ continuationToken: continuationToken,
716
+ minMetricsTime: minMetricsTime,
717
+ definitionIds: definitionIds && definitionIds.join(","),
718
+ path: path,
719
+ builtAfter: builtAfter,
720
+ notBuiltAfter: notBuiltAfter,
721
+ includeAllProperties: includeAllProperties,
722
+ includeLatestBuilds: includeLatestBuilds,
723
+ taskIdFilter: taskIdFilter,
724
+ processType: processType,
725
+ yamlFilename: yamlFilename
726
+ };
727
+ return this.beginRequest({
728
+ apiVersion: "7.2-preview.8",
729
+ routeTemplate: "{project}/_apis/build/definitions/{definitionId}",
730
+ routeValues: {
731
+ project: project
732
+ },
733
+ queryParams: queryValues,
734
+ returnRawResponse: true
735
+ }).then((response) => __awaiter(this, void 0, void 0, function* () {
736
+ const body = yield response.text().then(Serialization_1.deserializeVssJsonObject);
737
+ body.continuationToken = response.headers.get("x-ms-continuationtoken");
738
+ return body;
739
+ }));
740
+ });
741
+ }
742
+ /**
743
+ * Restores a deleted definition
744
+ *
745
+ * @param project - Project ID or project name
746
+ * @param definitionId - The identifier of the definition to restore.
747
+ * @param deleted - When false, restores a deleted definition.
748
+ */
749
+ restoreDefinition(project, definitionId, deleted) {
750
+ return __awaiter(this, void 0, void 0, function* () {
751
+ const queryValues = {
752
+ deleted: deleted
753
+ };
754
+ return this.beginRequest({
755
+ apiVersion: "7.2-preview.8",
756
+ method: "PATCH",
757
+ routeTemplate: "{project}/_apis/build/definitions/{definitionId}",
758
+ routeValues: {
759
+ project: project,
760
+ definitionId: definitionId
761
+ },
762
+ queryParams: queryValues
763
+ });
764
+ });
765
+ }
766
+ /**
767
+ * Updates an existing build definition. In order for this operation to succeed, the value of the "Revision" property of the request body must match the existing build definition's. It is recommended that you obtain the existing build definition by using GET, modify the build definition as necessary, and then submit the modified definition with PUT.
768
+ *
769
+ * @param definition - The new version of the definition. Its "Revision" property must match the existing definition for the update to be accepted.
770
+ * @param project - Project ID or project name
771
+ * @param definitionId - The ID of the definition.
772
+ * @param secretsSourceDefinitionId - Optional ID of the definition to use as the source for secrets.
773
+ * @param secretsSourceDefinitionRevision - Optional revision of the secrets source definition.
774
+ * @param cancelPausedBuilds - If true, cancels paused builds when the pipeline is being enabled from a paused or disabled state.
775
+ */
776
+ updateDefinition(definition, project, definitionId, secretsSourceDefinitionId, secretsSourceDefinitionRevision, cancelPausedBuilds) {
777
+ return __awaiter(this, void 0, void 0, function* () {
778
+ const queryValues = {
779
+ secretsSourceDefinitionId: secretsSourceDefinitionId,
780
+ secretsSourceDefinitionRevision: secretsSourceDefinitionRevision,
781
+ cancelPausedBuilds: cancelPausedBuilds
782
+ };
783
+ return this.beginRequest({
784
+ apiVersion: "7.2-preview.8",
785
+ method: "PUT",
786
+ routeTemplate: "{project}/_apis/build/definitions/{definitionId}",
787
+ routeValues: {
788
+ project: project,
789
+ definitionId: definitionId
790
+ },
791
+ queryParams: queryValues,
792
+ body: definition
793
+ });
794
+ });
795
+ }
796
+ /**
797
+ * Gets the contents of a file in the given source code repository.
798
+ *
799
+ * @param project - Project ID or project name
800
+ * @param providerName - The name of the source provider.
801
+ * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
802
+ * @param repository - If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories.
803
+ * @param commitOrBranch - The identifier of the commit or branch from which a file's contents are retrieved.
804
+ * @param path - The path to the file to retrieve, relative to the root of the repository.
805
+ */
806
+ getFileContents(project, providerName, serviceEndpointId, repository, commitOrBranch, path) {
807
+ return __awaiter(this, void 0, void 0, function* () {
808
+ const queryValues = {
809
+ serviceEndpointId: serviceEndpointId,
810
+ repository: repository,
811
+ commitOrBranch: commitOrBranch,
812
+ path: path
813
+ };
814
+ return this.beginRequest({
815
+ apiVersion: "7.2-preview.1",
816
+ httpResponseType: "text/plain",
817
+ routeTemplate: "{project}/_apis/sourceProviders/{providerName}/fileContents",
818
+ routeValues: {
819
+ project: project,
820
+ providerName: providerName
821
+ },
822
+ queryParams: queryValues
823
+ });
824
+ });
825
+ }
826
+ /**
827
+ * Creates a new folder.
828
+ *
829
+ * @param folder - The folder.
830
+ * @param project - Project ID or project name
831
+ * @param path - The full path of the folder.
832
+ */
833
+ createFolder(folder, project, path) {
834
+ return __awaiter(this, void 0, void 0, function* () {
835
+ const queryValues = {
836
+ path: path
837
+ };
838
+ return this.beginRequest({
839
+ apiVersion: "7.2-preview.2",
840
+ method: "PUT",
841
+ routeTemplate: "{project}/_apis/build/folders/{*path}",
842
+ routeValues: {
843
+ project: project
844
+ },
845
+ queryParams: queryValues,
846
+ body: folder
847
+ });
848
+ });
849
+ }
850
+ /**
851
+ * Deletes a definition folder. Definitions and their corresponding builds will also be deleted.
852
+ *
853
+ * @param project - Project ID or project name
854
+ * @param path - The full path to the folder.
855
+ */
856
+ deleteFolder(project, path) {
857
+ return __awaiter(this, void 0, void 0, function* () {
858
+ const queryValues = {
859
+ path: path
860
+ };
861
+ return this.beginRequest({
862
+ apiVersion: "7.2-preview.2",
863
+ method: "DELETE",
864
+ routeTemplate: "{project}/_apis/build/folders/{*path}",
865
+ routeValues: {
866
+ project: project
867
+ },
868
+ queryParams: queryValues
869
+ });
870
+ });
871
+ }
872
+ /**
873
+ * Gets a list of build definition folders.
874
+ *
875
+ * @param project - Project ID or project name
876
+ * @param path - The path to start with.
877
+ * @param queryOrder - The order in which folders should be returned.
878
+ */
879
+ getFolders(project, path, queryOrder) {
880
+ return __awaiter(this, void 0, void 0, function* () {
881
+ const queryValues = {
882
+ queryOrder: queryOrder
883
+ };
884
+ return this.beginRequest({
885
+ apiVersion: "7.2-preview.2",
886
+ routeTemplate: "{project}/_apis/build/folders/{*path}",
887
+ routeValues: {
888
+ project: project,
889
+ path: path
890
+ },
891
+ queryParams: queryValues
892
+ });
893
+ });
894
+ }
895
+ /**
896
+ * Updates an existing folder at given existing path
897
+ *
898
+ * @param folder - The new version of the folder.
899
+ * @param project - Project ID or project name
900
+ * @param path - The full path to the folder.
901
+ */
902
+ updateFolder(folder, project, path) {
903
+ return __awaiter(this, void 0, void 0, function* () {
904
+ const queryValues = {
905
+ path: path
906
+ };
907
+ return this.beginRequest({
908
+ apiVersion: "7.2-preview.2",
909
+ method: "POST",
910
+ routeTemplate: "{project}/_apis/build/folders/{*path}",
911
+ routeValues: {
912
+ project: project
913
+ },
914
+ queryParams: queryValues,
915
+ body: folder
916
+ });
917
+ });
918
+ }
919
+ /**
920
+ * Gets pipeline general settings.
921
+ *
922
+ * @param project - Project ID or project name
923
+ */
924
+ getBuildGeneralSettings(project) {
925
+ return __awaiter(this, void 0, void 0, function* () {
926
+ return this.beginRequest({
927
+ apiVersion: "7.2-preview.1",
928
+ routeTemplate: "{project}/_apis/build/generalSettings",
929
+ routeValues: {
930
+ project: project
931
+ }
932
+ });
933
+ });
934
+ }
935
+ /**
936
+ * Updates pipeline general settings.
937
+ *
938
+ * @param newSettings -
939
+ * @param project - Project ID or project name
940
+ */
941
+ updateBuildGeneralSettings(newSettings, project) {
942
+ return __awaiter(this, void 0, void 0, function* () {
943
+ return this.beginRequest({
944
+ apiVersion: "7.2-preview.1",
945
+ method: "PATCH",
946
+ routeTemplate: "{project}/_apis/build/generalSettings",
947
+ routeValues: {
948
+ project: project
949
+ },
950
+ body: newSettings
951
+ });
952
+ });
953
+ }
954
+ /**
955
+ * Returns the retention history for the project collection. This includes pipelines that have custom retention rules that may prevent the retention job from cleaning them up, runs per pipeline with retention type, files associated with pipelines owned by the collection with retention type, and the number of files per pipeline.
956
+ *
957
+ * @param daysToLookback -
958
+ */
959
+ getRetentionHistory(daysToLookback) {
960
+ return __awaiter(this, void 0, void 0, function* () {
961
+ const queryValues = {
962
+ daysToLookback: daysToLookback
963
+ };
964
+ return this.beginRequest({
965
+ apiVersion: "7.2-preview.1",
966
+ routeTemplate: "_apis/build/retention/history",
967
+ queryParams: queryValues
968
+ });
969
+ });
970
+ }
971
+ /**
972
+ * Gets the latest build for a definition, optionally scoped to a specific branch.
973
+ *
974
+ * @param project - Project ID or project name
975
+ * @param definition - definition name with optional leading folder path, or the definition id
976
+ * @param branchName - optional parameter that indicates the specific branch to use. If not specified, the default branch is used.
977
+ */
978
+ getLatestBuild(project, definition, branchName) {
979
+ return __awaiter(this, void 0, void 0, function* () {
980
+ const queryValues = {
981
+ branchName: branchName
982
+ };
983
+ return this.beginRequest({
984
+ apiVersion: "7.2-preview.2",
985
+ routeTemplate: "{project}/_apis/build/latest/{*definition}",
986
+ routeValues: {
987
+ project: project,
988
+ definition: definition
989
+ },
990
+ queryParams: queryValues
991
+ });
992
+ });
993
+ }
994
+ /**
995
+ * Adds new leases for pipeline runs.
996
+ *
997
+ * @param newLeases -
998
+ * @param project - Project ID or project name
999
+ */
1000
+ addRetentionLeases(newLeases, project) {
1001
+ return __awaiter(this, void 0, void 0, function* () {
1002
+ return this.beginRequest({
1003
+ apiVersion: "7.2-preview.2",
1004
+ method: "POST",
1005
+ routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1006
+ routeValues: {
1007
+ project: project
1008
+ },
1009
+ body: newLeases
1010
+ });
1011
+ });
1012
+ }
1013
+ /**
1014
+ * Removes specific retention leases.
1015
+ *
1016
+ * @param project - Project ID or project name
1017
+ * @param ids -
1018
+ */
1019
+ deleteRetentionLeasesById(project, ids) {
1020
+ return __awaiter(this, void 0, void 0, function* () {
1021
+ const queryValues = {
1022
+ ids: ids && ids.join(",")
1023
+ };
1024
+ return this.beginRequest({
1025
+ apiVersion: "7.2-preview.2",
1026
+ method: "DELETE",
1027
+ routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1028
+ routeValues: {
1029
+ project: project
1030
+ },
1031
+ queryParams: queryValues
1032
+ });
1033
+ });
1034
+ }
1035
+ /**
1036
+ * Returns the details of the retention lease given a lease id.
1037
+ *
1038
+ * @param project - Project ID or project name
1039
+ * @param leaseId -
1040
+ */
1041
+ getRetentionLease(project, leaseId) {
1042
+ return __awaiter(this, void 0, void 0, function* () {
1043
+ return this.beginRequest({
1044
+ apiVersion: "7.2-preview.2",
1045
+ routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1046
+ routeValues: {
1047
+ project: project,
1048
+ leaseId: leaseId
1049
+ }
1050
+ });
1051
+ });
1052
+ }
1053
+ /**
1054
+ * Returns any leases matching the specified MinimalRetentionLeases
1055
+ *
1056
+ * @param project - Project ID or project name
1057
+ * @param leasesToFetch - List of JSON-serialized MinimalRetentionLeases separated by '|'
1058
+ */
1059
+ getRetentionLeasesByMinimalRetentionLeases(project, leasesToFetch) {
1060
+ return __awaiter(this, void 0, void 0, function* () {
1061
+ const queryValues = {
1062
+ leasesToFetch: leasesToFetch && leasesToFetch.join("|")
1063
+ };
1064
+ return this.beginRequest({
1065
+ apiVersion: "7.2-preview.2",
1066
+ routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1067
+ routeValues: {
1068
+ project: project
1069
+ },
1070
+ queryParams: queryValues
1071
+ });
1072
+ });
1073
+ }
1074
+ /**
1075
+ * Returns any leases owned by the specified entity, optionally scoped to a single pipeline definition and run.
1076
+ *
1077
+ * @param project - Project ID or project name
1078
+ * @param ownerId -
1079
+ * @param definitionId - An optional parameter to limit the search to a specific pipeline definition.
1080
+ * @param runId - An optional parameter to limit the search to a single pipeline run. Requires definitionId.
1081
+ */
1082
+ getRetentionLeasesByOwnerId(project, ownerId, definitionId, runId) {
1083
+ return __awaiter(this, void 0, void 0, function* () {
1084
+ const queryValues = {
1085
+ ownerId: ownerId,
1086
+ definitionId: definitionId,
1087
+ runId: runId
1088
+ };
1089
+ return this.beginRequest({
1090
+ apiVersion: "7.2-preview.2",
1091
+ routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1092
+ routeValues: {
1093
+ project: project
1094
+ },
1095
+ queryParams: queryValues
1096
+ });
1097
+ });
1098
+ }
1099
+ /**
1100
+ * Returns any leases owned by the specified user, optionally scoped to a single pipeline definition and run.
1101
+ *
1102
+ * @param project - Project ID or project name
1103
+ * @param userOwnerId - The user id to search for.
1104
+ * @param definitionId - An optional parameter to limit the search to a specific pipeline definition.
1105
+ * @param runId - An optional parameter to limit the search to a single pipeline run. Requires definitionId.
1106
+ */
1107
+ getRetentionLeasesByUserId(project, userOwnerId, definitionId, runId) {
1108
+ return __awaiter(this, void 0, void 0, function* () {
1109
+ const queryValues = {
1110
+ userOwnerId: userOwnerId,
1111
+ definitionId: definitionId,
1112
+ runId: runId
1113
+ };
1114
+ return this.beginRequest({
1115
+ apiVersion: "7.2-preview.2",
1116
+ routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1117
+ routeValues: {
1118
+ project: project
1119
+ },
1120
+ queryParams: queryValues
1121
+ });
1122
+ });
1123
+ }
1124
+ /**
1125
+ * Updates the duration or pipeline protection status of a retention lease.
1126
+ *
1127
+ * @param leaseUpdate - The new data for the retention lease.
1128
+ * @param project - Project ID or project name
1129
+ * @param leaseId - The ID of the lease to update.
1130
+ */
1131
+ updateRetentionLease(leaseUpdate, project, leaseId) {
1132
+ return __awaiter(this, void 0, void 0, function* () {
1133
+ return this.beginRequest({
1134
+ apiVersion: "7.2-preview.2",
1135
+ method: "PATCH",
1136
+ routeTemplate: "{project}/_apis/build/retention/leases/{*leaseId}",
1137
+ routeValues: {
1138
+ project: project,
1139
+ leaseId: leaseId
1140
+ },
1141
+ body: leaseUpdate
1142
+ });
1143
+ });
1144
+ }
1145
+ /**
1146
+ * Gets an individual log file for a build.
1147
+ *
1148
+ * @param project - Project ID or project name
1149
+ * @param buildId - The ID of the build.
1150
+ * @param logId - The ID of the log file.
1151
+ * @param startLine - The start line.
1152
+ * @param endLine - The end line.
1153
+ */
1154
+ getBuildLog(project, buildId, logId, startLine, endLine) {
1155
+ return __awaiter(this, void 0, void 0, function* () {
1156
+ const queryValues = {
1157
+ startLine: startLine,
1158
+ endLine: endLine
1159
+ };
1160
+ return this.beginRequest({
1161
+ apiVersion: "7.2-preview.2",
1162
+ httpResponseType: "text/plain",
1163
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/logs/{logId}",
1164
+ routeValues: {
1165
+ project: project,
1166
+ buildId: buildId,
1167
+ logId: logId
1168
+ },
1169
+ queryParams: queryValues
1170
+ });
1171
+ });
1172
+ }
1173
+ /**
1174
+ * Gets an individual log file for a build.
1175
+ *
1176
+ * @param project - Project ID or project name
1177
+ * @param buildId - The ID of the build.
1178
+ * @param logId - The ID of the log file.
1179
+ * @param startLine - The start line.
1180
+ * @param endLine - The end line.
1181
+ */
1182
+ getBuildLogLines(project, buildId, logId, startLine, endLine) {
1183
+ return __awaiter(this, void 0, void 0, function* () {
1184
+ const queryValues = {
1185
+ startLine: startLine,
1186
+ endLine: endLine
1187
+ };
1188
+ return this.beginRequest({
1189
+ apiVersion: "7.2-preview.2",
1190
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/logs/{logId}",
1191
+ routeValues: {
1192
+ project: project,
1193
+ buildId: buildId,
1194
+ logId: logId
1195
+ },
1196
+ queryParams: queryValues
1197
+ });
1198
+ });
1199
+ }
1200
+ /**
1201
+ * Gets the logs for a build.
1202
+ *
1203
+ * @param project - Project ID or project name
1204
+ * @param buildId - The ID of the build.
1205
+ */
1206
+ getBuildLogs(project, buildId) {
1207
+ return __awaiter(this, void 0, void 0, function* () {
1208
+ return this.beginRequest({
1209
+ apiVersion: "7.2-preview.2",
1210
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/logs/{logId}",
1211
+ routeValues: {
1212
+ project: project,
1213
+ buildId: buildId
1214
+ }
1215
+ });
1216
+ });
1217
+ }
1218
+ /**
1219
+ * Gets the logs for a build.
1220
+ *
1221
+ * @param project - Project ID or project name
1222
+ * @param buildId - The ID of the build.
1223
+ */
1224
+ getBuildLogsZip(project, buildId) {
1225
+ return __awaiter(this, void 0, void 0, function* () {
1226
+ return this.beginRequest({
1227
+ apiVersion: "7.2-preview.2",
1228
+ httpResponseType: "application/zip",
1229
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/logs/{logId}",
1230
+ routeValues: {
1231
+ project: project,
1232
+ buildId: buildId
1233
+ }
1234
+ });
1235
+ });
1236
+ }
1237
+ /**
1238
+ * Gets an individual log file for a build.
1239
+ *
1240
+ * @param project - Project ID or project name
1241
+ * @param buildId - The ID of the build.
1242
+ * @param logId - The ID of the log file.
1243
+ * @param startLine - The start line.
1244
+ * @param endLine - The end line.
1245
+ */
1246
+ getBuildLogZip(project, buildId, logId, startLine, endLine) {
1247
+ return __awaiter(this, void 0, void 0, function* () {
1248
+ const queryValues = {
1249
+ startLine: startLine,
1250
+ endLine: endLine
1251
+ };
1252
+ return this.beginRequest({
1253
+ apiVersion: "7.2-preview.2",
1254
+ httpResponseType: "application/zip",
1255
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/logs/{logId}",
1256
+ routeValues: {
1257
+ project: project,
1258
+ buildId: buildId,
1259
+ logId: logId
1260
+ },
1261
+ queryParams: queryValues
1262
+ });
1263
+ });
1264
+ }
1265
+ /**
1266
+ * Gets build metrics for a project.
1267
+ *
1268
+ * @param project - Project ID or project name
1269
+ * @param metricAggregationType - The aggregation type to use (hourly, daily).
1270
+ * @param minMetricsTime - The date from which to calculate metrics.
1271
+ */
1272
+ getProjectMetrics(project, metricAggregationType, minMetricsTime) {
1273
+ return __awaiter(this, void 0, void 0, function* () {
1274
+ const queryValues = {
1275
+ minMetricsTime: minMetricsTime
1276
+ };
1277
+ return this.beginRequest({
1278
+ apiVersion: "7.2-preview.1",
1279
+ routeTemplate: "{project}/_apis/build/Metrics/{metricAggregationType}",
1280
+ routeValues: {
1281
+ project: project,
1282
+ metricAggregationType: metricAggregationType
1283
+ },
1284
+ queryParams: queryValues
1285
+ });
1286
+ });
1287
+ }
1288
+ /**
1289
+ * Gets build metrics for a definition.
1290
+ *
1291
+ * @param project - Project ID or project name
1292
+ * @param definitionId - The ID of the definition.
1293
+ * @param minMetricsTime - The date from which to calculate metrics.
1294
+ */
1295
+ getDefinitionMetrics(project, definitionId, minMetricsTime) {
1296
+ return __awaiter(this, void 0, void 0, function* () {
1297
+ const queryValues = {
1298
+ minMetricsTime: minMetricsTime
1299
+ };
1300
+ return this.beginRequest({
1301
+ apiVersion: "7.2-preview.1",
1302
+ routeTemplate: "{project}/_apis/build/definitions/{definitionId}/Metrics",
1303
+ routeValues: {
1304
+ project: project,
1305
+ definitionId: definitionId
1306
+ },
1307
+ queryParams: queryValues
1308
+ });
1309
+ });
1310
+ }
1311
+ /**
1312
+ * Gets all build definition options supported by the system.
1313
+ *
1314
+ * @param project - Project ID or project name
1315
+ */
1316
+ getBuildOptionDefinitions(project) {
1317
+ return __awaiter(this, void 0, void 0, function* () {
1318
+ return this.beginRequest({
1319
+ apiVersion: "7.2-preview.2",
1320
+ routeTemplate: "{project}/_apis/build/options",
1321
+ routeValues: {
1322
+ project: project
1323
+ }
1324
+ });
1325
+ });
1326
+ }
1327
+ /**
1328
+ * Gets the contents of a directory in the given source code repository.
1329
+ *
1330
+ * @param project - Project ID or project name
1331
+ * @param providerName - The name of the source provider.
1332
+ * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
1333
+ * @param repository - If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories.
1334
+ * @param commitOrBranch - The identifier of the commit or branch from which a file's contents are retrieved.
1335
+ * @param path - The path contents to list, relative to the root of the repository.
1336
+ */
1337
+ getPathContents(project, providerName, serviceEndpointId, repository, commitOrBranch, path) {
1338
+ return __awaiter(this, void 0, void 0, function* () {
1339
+ const queryValues = {
1340
+ serviceEndpointId: serviceEndpointId,
1341
+ repository: repository,
1342
+ commitOrBranch: commitOrBranch,
1343
+ path: path
1344
+ };
1345
+ return this.beginRequest({
1346
+ apiVersion: "7.2-preview.1",
1347
+ routeTemplate: "{project}/_apis/sourceProviders/{providerName}/pathContents",
1348
+ routeValues: {
1349
+ project: project,
1350
+ providerName: providerName
1351
+ },
1352
+ queryParams: queryValues
1353
+ });
1354
+ });
1355
+ }
1356
+ /**
1357
+ * Gets properties for a build.
1358
+ *
1359
+ * @param project - Project ID or project name
1360
+ * @param buildId - The ID of the build.
1361
+ * @param filter - A comma-delimited list of properties. If specified, filters to these specific properties.
1362
+ */
1363
+ getBuildProperties(project, buildId, filter) {
1364
+ return __awaiter(this, void 0, void 0, function* () {
1365
+ const queryValues = {
1366
+ filter: filter && filter.join(",")
1367
+ };
1368
+ return this.beginRequest({
1369
+ apiVersion: "7.2-preview.1",
1370
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/properties",
1371
+ routeValues: {
1372
+ project: project,
1373
+ buildId: buildId
1374
+ },
1375
+ queryParams: queryValues
1376
+ });
1377
+ });
1378
+ }
1379
+ /**
1380
+ * Updates properties for a build.
1381
+ *
1382
+ * @param document - A json-patch document describing the properties to update.
1383
+ * @param project - Project ID or project name
1384
+ * @param buildId - The ID of the build.
1385
+ */
1386
+ updateBuildProperties(document, project, buildId) {
1387
+ return __awaiter(this, void 0, void 0, function* () {
1388
+ return this.beginRequest({
1389
+ apiVersion: "7.2-preview.1",
1390
+ method: "PATCH",
1391
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/properties",
1392
+ routeValues: {
1393
+ project: project,
1394
+ buildId: buildId
1395
+ },
1396
+ customHeaders: {
1397
+ "Content-Type": "application/json-patch+json",
1398
+ },
1399
+ body: document
1400
+ });
1401
+ });
1402
+ }
1403
+ /**
1404
+ * Gets properties for a definition.
1405
+ *
1406
+ * @param project - Project ID or project name
1407
+ * @param definitionId - The ID of the definition.
1408
+ * @param filter - A comma-delimited list of properties. If specified, filters to these specific properties.
1409
+ */
1410
+ getDefinitionProperties(project, definitionId, filter) {
1411
+ return __awaiter(this, void 0, void 0, function* () {
1412
+ const queryValues = {
1413
+ filter: filter && filter.join(",")
1414
+ };
1415
+ return this.beginRequest({
1416
+ apiVersion: "7.2-preview.1",
1417
+ routeTemplate: "{project}/_apis/build/definitions/{definitionId}/properties",
1418
+ routeValues: {
1419
+ project: project,
1420
+ definitionId: definitionId
1421
+ },
1422
+ queryParams: queryValues
1423
+ });
1424
+ });
1425
+ }
1426
+ /**
1427
+ * Updates properties for a definition.
1428
+ *
1429
+ * @param document - A json-patch document describing the properties to update.
1430
+ * @param project - Project ID or project name
1431
+ * @param definitionId - The ID of the definition.
1432
+ */
1433
+ updateDefinitionProperties(document, project, definitionId) {
1434
+ return __awaiter(this, void 0, void 0, function* () {
1435
+ return this.beginRequest({
1436
+ apiVersion: "7.2-preview.1",
1437
+ method: "PATCH",
1438
+ routeTemplate: "{project}/_apis/build/definitions/{definitionId}/properties",
1439
+ routeValues: {
1440
+ project: project,
1441
+ definitionId: definitionId
1442
+ },
1443
+ customHeaders: {
1444
+ "Content-Type": "application/json-patch+json",
1445
+ },
1446
+ body: document
1447
+ });
1448
+ });
1449
+ }
1450
+ /**
1451
+ * Gets a pull request object from source provider.
1452
+ *
1453
+ * @param project - Project ID or project name
1454
+ * @param providerName - The name of the source provider.
1455
+ * @param pullRequestId - Vendor-specific id of the pull request.
1456
+ * @param repositoryId - Vendor-specific identifier or the name of the repository that contains the pull request.
1457
+ * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
1458
+ */
1459
+ getPullRequest(project, providerName, pullRequestId, repositoryId, serviceEndpointId) {
1460
+ return __awaiter(this, void 0, void 0, function* () {
1461
+ const queryValues = {
1462
+ repositoryId: repositoryId,
1463
+ serviceEndpointId: serviceEndpointId
1464
+ };
1465
+ return this.beginRequest({
1466
+ apiVersion: "7.2-preview.1",
1467
+ routeTemplate: "{project}/_apis/sourceProviders/{providerName}/pullRequests/{pullRequestId}",
1468
+ routeValues: {
1469
+ project: project,
1470
+ providerName: providerName,
1471
+ pullRequestId: pullRequestId
1472
+ },
1473
+ queryParams: queryValues
1474
+ });
1475
+ });
1476
+ }
1477
+ /**
1478
+ * Gets a build report.
1479
+ *
1480
+ * @param project - Project ID or project name
1481
+ * @param buildId - The ID of the build.
1482
+ * @param type -
1483
+ */
1484
+ getBuildReport(project, buildId, type) {
1485
+ return __awaiter(this, void 0, void 0, function* () {
1486
+ const queryValues = {
1487
+ type: type
1488
+ };
1489
+ return this.beginRequest({
1490
+ apiVersion: "7.2-preview.2",
1491
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/report",
1492
+ routeValues: {
1493
+ project: project,
1494
+ buildId: buildId
1495
+ },
1496
+ queryParams: queryValues
1497
+ });
1498
+ });
1499
+ }
1500
+ /**
1501
+ * Gets a build report.
1502
+ *
1503
+ * @param project - Project ID or project name
1504
+ * @param buildId - The ID of the build.
1505
+ * @param type -
1506
+ */
1507
+ getBuildReportHtmlContent(project, buildId, type) {
1508
+ return __awaiter(this, void 0, void 0, function* () {
1509
+ const queryValues = {
1510
+ type: type
1511
+ };
1512
+ return this.beginRequest({
1513
+ apiVersion: "7.2-preview.2",
1514
+ httpResponseType: "text/html",
1515
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/report",
1516
+ routeValues: {
1517
+ project: project,
1518
+ buildId: buildId
1519
+ },
1520
+ queryParams: queryValues
1521
+ });
1522
+ });
1523
+ }
1524
+ /**
1525
+ * Gets a list of source code repositories.
1526
+ *
1527
+ * @param project - Project ID or project name
1528
+ * @param providerName - The name of the source provider.
1529
+ * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
1530
+ * @param repository - If specified, the vendor-specific identifier or the name of a single repository to get.
1531
+ * @param resultSet - 'top' for the repositories most relevant for the endpoint. If not set, all repositories are returned. Ignored if 'repository' is set.
1532
+ * @param pageResults - If set to true, this will limit the set of results and will return a continuation token to continue the query.
1533
+ * @param continuationToken - When paging results, this is a continuation token, returned by a previous call to this method, that can be used to return the next set of repositories.
1534
+ */
1535
+ listRepositories(project, providerName, serviceEndpointId, repository, resultSet, pageResults, continuationToken) {
1536
+ return __awaiter(this, void 0, void 0, function* () {
1537
+ const queryValues = {
1538
+ serviceEndpointId: serviceEndpointId,
1539
+ repository: repository,
1540
+ resultSet: resultSet,
1541
+ pageResults: pageResults,
1542
+ continuationToken: continuationToken
1543
+ };
1544
+ return this.beginRequest({
1545
+ apiVersion: "7.2-preview.1",
1546
+ routeTemplate: "{project}/_apis/sourceProviders/{providerName}/repositories",
1547
+ routeValues: {
1548
+ project: project,
1549
+ providerName: providerName
1550
+ },
1551
+ queryParams: queryValues
1552
+ });
1553
+ });
1554
+ }
1555
+ /**
1556
+ * @param resources -
1557
+ * @param project - Project ID or project name
1558
+ * @param definitionId -
1559
+ */
1560
+ authorizeDefinitionResources(resources, project, definitionId) {
1561
+ return __awaiter(this, void 0, void 0, function* () {
1562
+ return this.beginRequest({
1563
+ apiVersion: "7.2-preview.1",
1564
+ method: "PATCH",
1565
+ routeTemplate: "{project}/_apis/build/definitions/{definitionId}/resources",
1566
+ routeValues: {
1567
+ project: project,
1568
+ definitionId: definitionId
1569
+ },
1570
+ body: resources
1571
+ });
1572
+ });
1573
+ }
1574
+ /**
1575
+ * @param project - Project ID or project name
1576
+ * @param definitionId -
1577
+ */
1578
+ getDefinitionResources(project, definitionId) {
1579
+ return __awaiter(this, void 0, void 0, function* () {
1580
+ return this.beginRequest({
1581
+ apiVersion: "7.2-preview.1",
1582
+ routeTemplate: "{project}/_apis/build/definitions/{definitionId}/resources",
1583
+ routeValues: {
1584
+ project: project,
1585
+ definitionId: definitionId
1586
+ }
1587
+ });
1588
+ });
1589
+ }
1590
+ /**
1591
+ * Gets information about build resources in the system.
1592
+ *
1593
+ */
1594
+ getResourceUsage() {
1595
+ return __awaiter(this, void 0, void 0, function* () {
1596
+ return this.beginRequest({
1597
+ apiVersion: "7.2-preview.2",
1598
+ routeTemplate: "_apis/build/ResourceUsage"
1599
+ });
1600
+ });
1601
+ }
1602
+ /**
1603
+ * Gets the project's retention settings.
1604
+ *
1605
+ * @param project - Project ID or project name
1606
+ */
1607
+ getRetentionSettings(project) {
1608
+ return __awaiter(this, void 0, void 0, function* () {
1609
+ return this.beginRequest({
1610
+ apiVersion: "7.2-preview.1",
1611
+ routeTemplate: "{project}/_apis/build/retention",
1612
+ routeValues: {
1613
+ project: project
1614
+ }
1615
+ });
1616
+ });
1617
+ }
1618
+ /**
1619
+ * Updates the project's retention settings.
1620
+ *
1621
+ * @param updateModel -
1622
+ * @param project - Project ID or project name
1623
+ */
1624
+ updateRetentionSettings(updateModel, project) {
1625
+ return __awaiter(this, void 0, void 0, function* () {
1626
+ return this.beginRequest({
1627
+ apiVersion: "7.2-preview.1",
1628
+ method: "PATCH",
1629
+ routeTemplate: "{project}/_apis/build/retention",
1630
+ routeValues: {
1631
+ project: project
1632
+ },
1633
+ body: updateModel
1634
+ });
1635
+ });
1636
+ }
1637
+ /**
1638
+ * Gets all revisions of a definition.
1639
+ *
1640
+ * @param project - Project ID or project name
1641
+ * @param definitionId - The ID of the definition.
1642
+ */
1643
+ getDefinitionRevisions(project, definitionId) {
1644
+ return __awaiter(this, void 0, void 0, function* () {
1645
+ return this.beginRequest({
1646
+ apiVersion: "7.2-preview.3",
1647
+ routeTemplate: "{project}/_apis/build/definitions/{definitionId}/revisions",
1648
+ routeValues: {
1649
+ project: project,
1650
+ definitionId: definitionId
1651
+ }
1652
+ });
1653
+ });
1654
+ }
1655
+ /**
1656
+ * Gets the build settings.
1657
+ *
1658
+ * @param project - Project ID or project name
1659
+ */
1660
+ getBuildSettings(project) {
1661
+ return __awaiter(this, void 0, void 0, function* () {
1662
+ return this.beginRequest({
1663
+ apiVersion: "7.2-preview.1",
1664
+ routeTemplate: "{project}/_apis/build/settings",
1665
+ routeValues: {
1666
+ project: project
1667
+ }
1668
+ });
1669
+ });
1670
+ }
1671
+ /**
1672
+ * Updates the build settings.
1673
+ *
1674
+ * @param settings - The new settings.
1675
+ * @param project - Project ID or project name
1676
+ */
1677
+ updateBuildSettings(settings, project) {
1678
+ return __awaiter(this, void 0, void 0, function* () {
1679
+ return this.beginRequest({
1680
+ apiVersion: "7.2-preview.1",
1681
+ method: "PATCH",
1682
+ routeTemplate: "{project}/_apis/build/settings",
1683
+ routeValues: {
1684
+ project: project
1685
+ },
1686
+ body: settings
1687
+ });
1688
+ });
1689
+ }
1690
+ /**
1691
+ * Get a list of source providers and their capabilities.
1692
+ *
1693
+ * @param project - Project ID or project name
1694
+ */
1695
+ listSourceProviders(project) {
1696
+ return __awaiter(this, void 0, void 0, function* () {
1697
+ return this.beginRequest({
1698
+ apiVersion: "7.2-preview.1",
1699
+ routeTemplate: "{project}/_apis/sourceProviders",
1700
+ routeValues: {
1701
+ project: project
1702
+ }
1703
+ });
1704
+ });
1705
+ }
1706
+ /**
1707
+ * Update a build stage
1708
+ *
1709
+ * @param updateParameters -
1710
+ * @param buildId -
1711
+ * @param stageRefName -
1712
+ * @param project - Project ID or project name
1713
+ */
1714
+ updateStage(updateParameters, buildId, stageRefName, project) {
1715
+ return __awaiter(this, void 0, void 0, function* () {
1716
+ return this.beginRequest({
1717
+ apiVersion: "7.2-preview.1",
1718
+ method: "PATCH",
1719
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/stages/{stageRefName}",
1720
+ routeValues: {
1721
+ project: project,
1722
+ buildId: buildId,
1723
+ stageRefName: stageRefName
1724
+ },
1725
+ body: updateParameters
1726
+ });
1727
+ });
1728
+ }
1729
+ /**
1730
+ * Gets the latest timeline for a build filtered to a specific stage.
1731
+ *
1732
+ * @param project - Project ID or project name
1733
+ * @param buildId - The ID of the build.
1734
+ * @param stageName - The name of the stage to filter by.
1735
+ * @param changeId - The change ID to filter by.
1736
+ * @param planId - The ID of the plan.
1737
+ */
1738
+ getBuildStageLatestTimeline(project, buildId, stageName, changeId, planId) {
1739
+ return __awaiter(this, void 0, void 0, function* () {
1740
+ const queryValues = {
1741
+ changeId: changeId,
1742
+ planId: planId
1743
+ };
1744
+ return this.beginRequest({
1745
+ apiVersion: "7.2-preview.1",
1746
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/Timeline/stages/{stageName}",
1747
+ routeValues: {
1748
+ project: project,
1749
+ buildId: buildId,
1750
+ stageName: stageName
1751
+ },
1752
+ queryParams: queryValues
1753
+ });
1754
+ });
1755
+ }
1756
+ /**
1757
+ * Gets the timeline for a build filtered to a specific stage.
1758
+ *
1759
+ * @param project - Project ID or project name
1760
+ * @param buildId - The ID of the build.
1761
+ * @param timelineId - The ID of the timeline.
1762
+ * @param stageName - The name of the stage to filter by.
1763
+ * @param changeId - The change ID to filter by.
1764
+ * @param planId - The ID of the plan.
1765
+ */
1766
+ getBuildStageTimeline(project, buildId, timelineId, stageName, changeId, planId) {
1767
+ return __awaiter(this, void 0, void 0, function* () {
1768
+ const queryValues = {
1769
+ changeId: changeId,
1770
+ planId: planId
1771
+ };
1772
+ return this.beginRequest({
1773
+ apiVersion: "7.2-preview.1",
1774
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/Timeline/{timelineId}/stages/{stageName}",
1775
+ routeValues: {
1776
+ project: project,
1777
+ buildId: buildId,
1778
+ timelineId: timelineId,
1779
+ stageName: stageName
1780
+ },
1781
+ queryParams: queryValues
1782
+ });
1783
+ });
1784
+ }
1785
+ /**
1786
+ * \<p\>Gets the build status for a definition, optionally scoped to a specific branch, stage, job, and configuration.\</p\> \<p\>If there are more than one, then it is required to pass in a stageName value when specifying a jobName, and the same rule then applies for both if passing a configuration parameter.\</p\>
1787
+ *
1788
+ * @param project - Project ID or project name
1789
+ * @param definition - Either the definition name with optional leading folder path, or the definition id.
1790
+ * @param branchName - Only consider the most recent build for this branch. If not specified, the default branch is used.
1791
+ * @param stageName - Use this stage within the pipeline to render the status.
1792
+ * @param jobName - Use this job within a stage of the pipeline to render the status.
1793
+ * @param configuration - Use this job configuration to render the status
1794
+ * @param label - Replaces the default text on the left side of the badge.
1795
+ */
1796
+ getStatusBadge(project, definition, branchName, stageName, jobName, configuration, label) {
1797
+ return __awaiter(this, void 0, void 0, function* () {
1798
+ const queryValues = {
1799
+ branchName: branchName,
1800
+ stageName: stageName,
1801
+ jobName: jobName,
1802
+ configuration: configuration,
1803
+ label: label
1804
+ };
1805
+ return this.beginRequest({
1806
+ apiVersion: "7.2-preview.1",
1807
+ routeTemplate: "{project}/_apis/build/status/{*definition}",
1808
+ routeValues: {
1809
+ project: project,
1810
+ definition: definition
1811
+ },
1812
+ queryParams: queryValues
1813
+ });
1814
+ });
1815
+ }
1816
+ /**
1817
+ * Adds a tag to a build.
1818
+ *
1819
+ * @param project - Project ID or project name
1820
+ * @param buildId - The ID of the build.
1821
+ * @param tag - The tag to add.
1822
+ */
1823
+ addBuildTag(project, buildId, tag) {
1824
+ return __awaiter(this, void 0, void 0, function* () {
1825
+ return this.beginRequest({
1826
+ apiVersion: "7.2-preview.3",
1827
+ method: "PUT",
1828
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/tags/{*tag}",
1829
+ routeValues: {
1830
+ project: project,
1831
+ buildId: buildId,
1832
+ tag: tag
1833
+ }
1834
+ });
1835
+ });
1836
+ }
1837
+ /**
1838
+ * Adds tags to a build.
1839
+ *
1840
+ * @param tags - The tags to add. Request body is composed directly from listed tags.
1841
+ * @param project - Project ID or project name
1842
+ * @param buildId - The ID of the build.
1843
+ */
1844
+ addBuildTags(tags, project, buildId) {
1845
+ return __awaiter(this, void 0, void 0, function* () {
1846
+ return this.beginRequest({
1847
+ apiVersion: "7.2-preview.3",
1848
+ method: "POST",
1849
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/tags/{*tag}",
1850
+ routeValues: {
1851
+ project: project,
1852
+ buildId: buildId
1853
+ },
1854
+ body: tags
1855
+ });
1856
+ });
1857
+ }
1858
+ /**
1859
+ * Removes a tag from a build. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+)
1860
+ *
1861
+ * @param project - Project ID or project name
1862
+ * @param buildId - The ID of the build.
1863
+ * @param tag - The tag to remove.
1864
+ */
1865
+ deleteBuildTag(project, buildId, tag) {
1866
+ return __awaiter(this, void 0, void 0, function* () {
1867
+ return this.beginRequest({
1868
+ apiVersion: "7.2-preview.3",
1869
+ method: "DELETE",
1870
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/tags/{*tag}",
1871
+ routeValues: {
1872
+ project: project,
1873
+ buildId: buildId,
1874
+ tag: tag
1875
+ }
1876
+ });
1877
+ });
1878
+ }
1879
+ /**
1880
+ * Gets the tags for a build.
1881
+ *
1882
+ * @param project - Project ID or project name
1883
+ * @param buildId - The ID of the build.
1884
+ */
1885
+ getBuildTags(project, buildId) {
1886
+ return __awaiter(this, void 0, void 0, function* () {
1887
+ return this.beginRequest({
1888
+ apiVersion: "7.2-preview.3",
1889
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/tags/{*tag}",
1890
+ routeValues: {
1891
+ project: project,
1892
+ buildId: buildId
1893
+ }
1894
+ });
1895
+ });
1896
+ }
1897
+ /**
1898
+ * Adds/Removes tags from a build.
1899
+ *
1900
+ * @param updateParameters - The tags to add/remove.
1901
+ * @param project - Project ID or project name
1902
+ * @param buildId - The ID of the build.
1903
+ */
1904
+ updateBuildTags(updateParameters, project, buildId) {
1905
+ return __awaiter(this, void 0, void 0, function* () {
1906
+ return this.beginRequest({
1907
+ apiVersion: "7.2-preview.3",
1908
+ method: "PATCH",
1909
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/tags/{*tag}",
1910
+ routeValues: {
1911
+ project: project,
1912
+ buildId: buildId
1913
+ },
1914
+ body: updateParameters
1915
+ });
1916
+ });
1917
+ }
1918
+ /**
1919
+ * Adds a tag to a definition
1920
+ *
1921
+ * @param project - Project ID or project name
1922
+ * @param definitionId - The ID of the definition.
1923
+ * @param tag - The tag to add.
1924
+ */
1925
+ addDefinitionTag(project, definitionId, tag) {
1926
+ return __awaiter(this, void 0, void 0, function* () {
1927
+ return this.beginRequest({
1928
+ apiVersion: "7.2-preview.3",
1929
+ method: "PUT",
1930
+ routeTemplate: "{project}/_apis/build/definitions/{DefinitionId}/tags/{*tag}",
1931
+ routeValues: {
1932
+ project: project,
1933
+ definitionId: definitionId,
1934
+ tag: tag
1935
+ }
1936
+ });
1937
+ });
1938
+ }
1939
+ /**
1940
+ * Adds multiple tags to a definition.
1941
+ *
1942
+ * @param tags - The tags to add.
1943
+ * @param project - Project ID or project name
1944
+ * @param definitionId - The ID of the definition.
1945
+ */
1946
+ addDefinitionTags(tags, project, definitionId) {
1947
+ return __awaiter(this, void 0, void 0, function* () {
1948
+ return this.beginRequest({
1949
+ apiVersion: "7.2-preview.3",
1950
+ method: "POST",
1951
+ routeTemplate: "{project}/_apis/build/definitions/{DefinitionId}/tags/{*tag}",
1952
+ routeValues: {
1953
+ project: project,
1954
+ definitionId: definitionId
1955
+ },
1956
+ body: tags
1957
+ });
1958
+ });
1959
+ }
1960
+ /**
1961
+ * Removes a tag from a definition. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+)
1962
+ *
1963
+ * @param project - Project ID or project name
1964
+ * @param definitionId - The ID of the definition.
1965
+ * @param tag - The tag to remove.
1966
+ */
1967
+ deleteDefinitionTag(project, definitionId, tag) {
1968
+ return __awaiter(this, void 0, void 0, function* () {
1969
+ return this.beginRequest({
1970
+ apiVersion: "7.2-preview.3",
1971
+ method: "DELETE",
1972
+ routeTemplate: "{project}/_apis/build/definitions/{DefinitionId}/tags/{*tag}",
1973
+ routeValues: {
1974
+ project: project,
1975
+ definitionId: definitionId,
1976
+ tag: tag
1977
+ }
1978
+ });
1979
+ });
1980
+ }
1981
+ /**
1982
+ * Gets the tags for a definition.
1983
+ *
1984
+ * @param project - Project ID or project name
1985
+ * @param definitionId - The ID of the definition.
1986
+ * @param revision - The definition revision number. If not specified, uses the latest revision of the definition.
1987
+ */
1988
+ getDefinitionTags(project, definitionId, revision) {
1989
+ return __awaiter(this, void 0, void 0, function* () {
1990
+ const queryValues = {
1991
+ revision: revision
1992
+ };
1993
+ return this.beginRequest({
1994
+ apiVersion: "7.2-preview.3",
1995
+ routeTemplate: "{project}/_apis/build/definitions/{DefinitionId}/tags/{*tag}",
1996
+ routeValues: {
1997
+ project: project,
1998
+ definitionId: definitionId
1999
+ },
2000
+ queryParams: queryValues
2001
+ });
2002
+ });
2003
+ }
2004
+ /**
2005
+ * Adds/Removes tags from a definition.
2006
+ *
2007
+ * @param updateParameters - The tags to add/remove.
2008
+ * @param project - Project ID or project name
2009
+ * @param definitionId - The ID of the definition.
2010
+ */
2011
+ updateDefinitionTags(updateParameters, project, definitionId) {
2012
+ return __awaiter(this, void 0, void 0, function* () {
2013
+ return this.beginRequest({
2014
+ apiVersion: "7.2-preview.3",
2015
+ method: "PATCH",
2016
+ routeTemplate: "{project}/_apis/build/definitions/{DefinitionId}/tags/{*tag}",
2017
+ routeValues: {
2018
+ project: project,
2019
+ definitionId: definitionId
2020
+ },
2021
+ body: updateParameters
2022
+ });
2023
+ });
2024
+ }
2025
+ /**
2026
+ * Removes a tag from builds, definitions, and from the tag store
2027
+ *
2028
+ * @param project - Project ID or project name
2029
+ * @param tag - The tag to remove.
2030
+ */
2031
+ deleteTag(project, tag) {
2032
+ return __awaiter(this, void 0, void 0, function* () {
2033
+ return this.beginRequest({
2034
+ apiVersion: "7.2-preview.3",
2035
+ method: "DELETE",
2036
+ routeTemplate: "{project}/_apis/build/tags/{*tag}",
2037
+ routeValues: {
2038
+ project: project,
2039
+ tag: tag
2040
+ }
2041
+ });
2042
+ });
2043
+ }
2044
+ /**
2045
+ * Gets a list of all build tags in the project.
2046
+ *
2047
+ * @param project - Project ID or project name
2048
+ */
2049
+ getTags(project) {
2050
+ return __awaiter(this, void 0, void 0, function* () {
2051
+ return this.beginRequest({
2052
+ apiVersion: "7.2-preview.3",
2053
+ routeTemplate: "{project}/_apis/build/tags/{*tag}",
2054
+ routeValues: {
2055
+ project: project
2056
+ }
2057
+ });
2058
+ });
2059
+ }
2060
+ /**
2061
+ * Deletes a build definition template.
2062
+ *
2063
+ * @param project - Project ID or project name
2064
+ * @param templateId - The ID of the template.
2065
+ */
2066
+ deleteTemplate(project, templateId) {
2067
+ return __awaiter(this, void 0, void 0, function* () {
2068
+ return this.beginRequest({
2069
+ apiVersion: "7.2-preview.3",
2070
+ method: "DELETE",
2071
+ routeTemplate: "{project}/_apis/build/definitions/templates/{templateId}",
2072
+ routeValues: {
2073
+ project: project,
2074
+ templateId: templateId
2075
+ }
2076
+ });
2077
+ });
2078
+ }
2079
+ /**
2080
+ * Gets a specific build definition template.
2081
+ *
2082
+ * @param project - Project ID or project name
2083
+ * @param templateId - The ID of the requested template.
2084
+ */
2085
+ getTemplate(project, templateId) {
2086
+ return __awaiter(this, void 0, void 0, function* () {
2087
+ return this.beginRequest({
2088
+ apiVersion: "7.2-preview.3",
2089
+ routeTemplate: "{project}/_apis/build/definitions/templates/{templateId}",
2090
+ routeValues: {
2091
+ project: project,
2092
+ templateId: templateId
2093
+ }
2094
+ });
2095
+ });
2096
+ }
2097
+ /**
2098
+ * Gets all definition templates.
2099
+ *
2100
+ * @param project - Project ID or project name
2101
+ */
2102
+ getTemplates(project) {
2103
+ return __awaiter(this, void 0, void 0, function* () {
2104
+ return this.beginRequest({
2105
+ apiVersion: "7.2-preview.3",
2106
+ routeTemplate: "{project}/_apis/build/definitions/templates/{templateId}",
2107
+ routeValues: {
2108
+ project: project
2109
+ }
2110
+ });
2111
+ });
2112
+ }
2113
+ /**
2114
+ * Updates an existing build definition template.
2115
+ *
2116
+ * @param template - The new version of the template.
2117
+ * @param project - Project ID or project name
2118
+ * @param templateId - The ID of the template.
2119
+ */
2120
+ saveTemplate(template, project, templateId) {
2121
+ return __awaiter(this, void 0, void 0, function* () {
2122
+ return this.beginRequest({
2123
+ apiVersion: "7.2-preview.3",
2124
+ method: "PUT",
2125
+ routeTemplate: "{project}/_apis/build/definitions/templates/{templateId}",
2126
+ routeValues: {
2127
+ project: project,
2128
+ templateId: templateId
2129
+ },
2130
+ body: template
2131
+ });
2132
+ });
2133
+ }
2134
+ /**
2135
+ * Gets details for a build
2136
+ *
2137
+ * @param project - Project ID or project name
2138
+ * @param buildId -
2139
+ * @param timelineId -
2140
+ * @param changeId -
2141
+ * @param planId -
2142
+ */
2143
+ getBuildTimeline(project, buildId, timelineId, changeId, planId) {
2144
+ return __awaiter(this, void 0, void 0, function* () {
2145
+ const queryValues = {
2146
+ changeId: changeId,
2147
+ planId: planId
2148
+ };
2149
+ return this.beginRequest({
2150
+ apiVersion: "7.2-preview.3",
2151
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/Timeline/{timelineId}",
2152
+ routeValues: {
2153
+ project: project,
2154
+ buildId: buildId,
2155
+ timelineId: timelineId
2156
+ },
2157
+ queryParams: queryValues
2158
+ });
2159
+ });
2160
+ }
2161
+ /**
2162
+ * Recreates the webhooks for the specified triggers in the given source code repository.
2163
+ *
2164
+ * @param triggerTypes - The types of triggers to restore webhooks for.
2165
+ * @param project - Project ID or project name
2166
+ * @param providerName - The name of the source provider.
2167
+ * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
2168
+ * @param repository - If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories.
2169
+ */
2170
+ restoreWebhooks(triggerTypes, project, providerName, serviceEndpointId, repository) {
2171
+ return __awaiter(this, void 0, void 0, function* () {
2172
+ const queryValues = {
2173
+ serviceEndpointId: serviceEndpointId,
2174
+ repository: repository
2175
+ };
2176
+ return this.beginRequest({
2177
+ apiVersion: "7.2-preview.1",
2178
+ method: "POST",
2179
+ routeTemplate: "{project}/_apis/sourceProviders/{providerName}/webhooks",
2180
+ routeValues: {
2181
+ project: project,
2182
+ providerName: providerName
2183
+ },
2184
+ queryParams: queryValues,
2185
+ body: triggerTypes
2186
+ });
2187
+ });
2188
+ }
2189
+ /**
2190
+ * Gets a list of webhooks installed in the given source code repository.
2191
+ *
2192
+ * @param project - Project ID or project name
2193
+ * @param providerName - The name of the source provider.
2194
+ * @param serviceEndpointId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.
2195
+ * @param repository - If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories.
2196
+ */
2197
+ listWebhooks(project, providerName, serviceEndpointId, repository) {
2198
+ return __awaiter(this, void 0, void 0, function* () {
2199
+ const queryValues = {
2200
+ serviceEndpointId: serviceEndpointId,
2201
+ repository: repository
2202
+ };
2203
+ return this.beginRequest({
2204
+ apiVersion: "7.2-preview.1",
2205
+ routeTemplate: "{project}/_apis/sourceProviders/{providerName}/webhooks",
2206
+ routeValues: {
2207
+ project: project,
2208
+ providerName: providerName
2209
+ },
2210
+ queryParams: queryValues
2211
+ });
2212
+ });
2213
+ }
2214
+ /**
2215
+ * Gets the work items associated with a build. Only work items in the same project are returned.
2216
+ *
2217
+ * @param project - Project ID or project name
2218
+ * @param buildId - The ID of the build.
2219
+ * @param top - The maximum number of work items to return.
2220
+ */
2221
+ getBuildWorkItemsRefs(project, buildId, top) {
2222
+ return __awaiter(this, void 0, void 0, function* () {
2223
+ const queryValues = {
2224
+ '$top': top
2225
+ };
2226
+ return this.beginRequest({
2227
+ apiVersion: "7.2-preview.2",
2228
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/workitems",
2229
+ routeValues: {
2230
+ project: project,
2231
+ buildId: buildId
2232
+ },
2233
+ queryParams: queryValues
2234
+ });
2235
+ });
2236
+ }
2237
+ /**
2238
+ * Gets the work items associated with a build, filtered to specific commits.
2239
+ *
2240
+ * @param commitIds - A comma-delimited list of commit IDs.
2241
+ * @param project - Project ID or project name
2242
+ * @param buildId - The ID of the build.
2243
+ * @param top - The maximum number of work items to return, or the number of commits to consider if no commit IDs are specified.
2244
+ */
2245
+ getBuildWorkItemsRefsFromCommits(commitIds, project, buildId, top) {
2246
+ return __awaiter(this, void 0, void 0, function* () {
2247
+ const queryValues = {
2248
+ '$top': top
2249
+ };
2250
+ return this.beginRequest({
2251
+ apiVersion: "7.2-preview.2",
2252
+ method: "POST",
2253
+ routeTemplate: "{project}/_apis/build/builds/{buildId}/workitems",
2254
+ routeValues: {
2255
+ project: project,
2256
+ buildId: buildId
2257
+ },
2258
+ queryParams: queryValues,
2259
+ body: commitIds
2260
+ });
2261
+ });
2262
+ }
2263
+ /**
2264
+ * Gets all the work items between two builds.
2265
+ *
2266
+ * @param project - Project ID or project name
2267
+ * @param fromBuildId - The ID of the first build.
2268
+ * @param toBuildId - The ID of the last build.
2269
+ * @param top - The maximum number of work items to return.
2270
+ */
2271
+ getWorkItemsBetweenBuilds(project, fromBuildId, toBuildId, top) {
2272
+ return __awaiter(this, void 0, void 0, function* () {
2273
+ const queryValues = {
2274
+ fromBuildId: fromBuildId,
2275
+ toBuildId: toBuildId,
2276
+ '$top': top
2277
+ };
2278
+ return this.beginRequest({
2279
+ apiVersion: "7.2-preview.2",
2280
+ routeTemplate: "{project}/_apis/build/workitems",
2281
+ routeValues: {
2282
+ project: project
2283
+ },
2284
+ queryParams: queryValues
2285
+ });
2286
+ });
2287
+ }
2288
+ /**
2289
+ * Converts a definition to YAML, optionally at a specific revision.
2290
+ *
2291
+ * @param project - Project ID or project name
2292
+ * @param definitionId - The ID of the definition.
2293
+ * @param revision - The revision number to retrieve. If this is not specified, the latest version will be returned.
2294
+ * @param minMetricsTime - If specified, indicates the date from which metrics should be included.
2295
+ * @param propertyFilters - A comma-delimited list of properties to include in the results.
2296
+ * @param includeLatestBuilds -
2297
+ */
2298
+ getDefinitionYaml(project, definitionId, revision, minMetricsTime, propertyFilters, includeLatestBuilds) {
2299
+ return __awaiter(this, void 0, void 0, function* () {
2300
+ const queryValues = {
2301
+ revision: revision,
2302
+ minMetricsTime: minMetricsTime,
2303
+ propertyFilters: propertyFilters && propertyFilters.join(","),
2304
+ includeLatestBuilds: includeLatestBuilds
2305
+ };
2306
+ return this.beginRequest({
2307
+ apiVersion: "7.2-preview.1",
2308
+ routeTemplate: "{project}/_apis/build/definitions/{definitionId}/yaml",
2309
+ routeValues: {
2310
+ project: project,
2311
+ definitionId: definitionId
2312
+ },
2313
+ queryParams: queryValues
2314
+ });
2315
+ });
2316
+ }
2317
+ }
2318
+ exports.BuildRestClient = BuildRestClient;
2319
+ BuildRestClient.RESOURCE_AREA_ID = "965220d5-5bb9-42cf-8d67-9b146df2a5a4";