azure-devops-extension-api 4.270.0 → 5.271.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 +1265 -1265
  17. package/Alert/Alert.js +425 -426
  18. package/Alert/Alert.min.js +1 -1
  19. package/Alert/AlertClient.d.ts +184 -159
  20. package/Alert/AlertClient.js +512 -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 +613 -603
  162. package/Gallery/GalleryClient.js +1884 -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 +116 -105
  216. package/Management/ManagementClient.js +349 -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 +341 -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 +758 -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 +730 -730
  340. package/Tfvc/Tfvc.js +106 -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/ESRPClientLogs0504231512019.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 +457 -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 +1701 -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 +302 -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 +103 -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,626 +1,605 @@
1
- /*
2
- * ---------------------------------------------------------
3
- * Copyright(C) Microsoft Corporation. All rights reserved.
4
- * ---------------------------------------------------------
5
- */
6
- define(["require", "exports"], function (require, exports) {
7
- "use strict";
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- /**
10
- * Key constants used by route parsing.
11
- */
12
- var KeyCodes;
13
- (function (KeyCodes) {
14
- KeyCodes[KeyCodes["asterisk"] = 42] = "asterisk";
15
- KeyCodes[KeyCodes["endCurlyBrace"] = 125] = "endCurlyBrace";
16
- KeyCodes[KeyCodes["startCurlyBrace"] = 123] = "startCurlyBrace";
17
- })(KeyCodes || (KeyCodes = {}));
18
- function prepareForComparison(value, upperCase) {
19
- return value ? (upperCase ? value.toLocaleUpperCase() : value) : "";
20
- }
21
- function stringEquals(str1, str2, ignoreCase) {
22
- if (str1 === str2) {
23
- return true;
24
- }
25
- return prepareForComparison(str1, ignoreCase).localeCompare(prepareForComparison(str2, ignoreCase)) === 0;
26
- }
27
- /**
28
- * Class that represents a Uri and allows parsing/getting and setting of individual parts
29
- */
30
- var Uri = /** @class */ (function () {
31
- /**
32
- * Create a new Uri.
33
- *
34
- * @param uri Optional uri string to populate values with
35
- * @param options Options for parsing the uri string
36
- */
37
- function Uri(uri, options) {
38
- /**
39
- * The uri scheme such as http or https
40
- */
41
- this.scheme = "";
42
- /**
43
- * If true, do not emit the "//" separator after the scheme:
44
- * Set to true for schemes like mailto (e.g. mailto:foo@bar)
45
- */
46
- this.noSchemeSeparator = false;
47
- /**
48
- * The uri hostname (does not include port or scheme)
49
- */
50
- this.host = "";
51
- /**
52
- * The port number of the uri as supplied in the url. 0 if left out in the url (e.g. the default port for the scheme).
53
- */
54
- this.port = 0;
55
- /**
56
- * The relative path of the uri
57
- */
58
- this.path = "";
59
- /**
60
- * The array of query parameters in the uri
61
- */
62
- this.queryParameters = [];
63
- /**
64
- * The hash string of the uri
65
- */
66
- this.hashString = "";
67
- if (uri) {
68
- this._setFromUriString(uri, options);
69
- }
70
- }
71
- Uri.prototype._setFromUriString = function (uriString, options) {
72
- var uri = uriString;
73
- // Parse out the hash string
74
- var hashSplit = this._singleSplit(uri, "#");
75
- if (hashSplit) {
76
- uri = hashSplit.part1;
77
- this.hashString = this._decodeUriComponent(hashSplit.part2);
78
- }
79
- else {
80
- this.hashString = "";
81
- }
82
- // Parse the query parameters
83
- var querySplit = this._singleSplit(uri, "?");
84
- if (querySplit) {
85
- uri = querySplit.part1;
86
- this.queryString = querySplit.part2;
87
- }
88
- else {
89
- this.queryParameters = [];
90
- }
91
- this.scheme = "";
92
- this.host = "";
93
- this.port = 0;
94
- this.path = "";
95
- // Parse out the scheme components of the uri
96
- this.noSchemeSeparator = false;
97
- var schemeSplit = this._singleSplit(uri, ":");
98
- if (schemeSplit) {
99
- this.scheme = schemeSplit.part1;
100
- uri = schemeSplit.part2;
101
- if (uri.substr(0, 2) === "//") {
102
- uri = uri.substr(2);
103
- // Parse out the path part of the uri
104
- var pathSplit = this._singleSplit(uri, "/");
105
- if (pathSplit) {
106
- uri = pathSplit.part1;
107
- this.path = pathSplit.part2;
108
- }
109
- else {
110
- this.path = "";
111
- }
112
- // Parse out the port number
113
- var portSplit = this._singleSplit(uri, ":");
114
- if (portSplit) {
115
- this.host = portSplit.part1;
116
- this.port = parseInt(portSplit.part2);
117
- if (isNaN(this.port)) {
118
- // Segment after : was not a port, consider it part of the path
119
- this.host += ":";
120
- this.path = portSplit.part2 + "/" + this.path;
121
- }
122
- }
123
- else {
124
- this.host = uri;
125
- }
126
- }
127
- else {
128
- // No host for schemes like mailto: just use path
129
- this.noSchemeSeparator = true;
130
- this.path = uri;
131
- }
132
- }
133
- else {
134
- // Relative Url was given
135
- this.path = uri;
136
- }
137
- if (options && options.absoluteUriRequired && !this.scheme) {
138
- throw new Error("The uri string \"" + uriString + "\" does not represent a valid absolute uri.");
139
- }
140
- };
141
- Uri.prototype._singleSplit = function (value, separator) {
142
- var matchIndex = value.indexOf(separator);
143
- if (matchIndex >= 0) {
144
- return {
145
- part1: value.substr(0, matchIndex),
146
- part2: value.substr(matchIndex + 1)
147
- };
148
- }
149
- else {
150
- return undefined;
151
- }
152
- };
153
- Uri.prototype._decodeUriComponent = function (value) {
154
- if (value) {
155
- // Replace "+" character with %20.
156
- value = value.replace(/\+/g, "%20");
157
- value = decodeURIComponent(value);
158
- }
159
- return value;
160
- };
161
- Object.defineProperty(Uri.prototype, "absoluteUri", {
162
- /**
163
- * Get the absolute uri string for this Uri
164
- */
165
- get: function () {
166
- var uri = "";
167
- if (this.scheme) {
168
- uri = encodeURI(decodeURI(this.scheme)) + ":";
169
- if (!this.noSchemeSeparator) {
170
- uri += "//";
171
- }
172
- }
173
- if (this.host) {
174
- uri += encodeURI(decodeURI(this.host));
175
- if (this.port) {
176
- uri += ":" + this.port;
177
- }
178
- if (!this.noSchemeSeparator || this.path) {
179
- uri += "/";
180
- }
181
- }
182
- if (this.path) {
183
- var encodedPath = void 0;
184
- if (this.noSchemeSeparator) {
185
- // Only do simple encoding for schemes like mailto: or blob: where
186
- // we can't determine host versus path
187
- encodedPath = encodeURI(decodeURI(this.path));
188
- }
189
- else {
190
- var parts = this.path.split('/');
191
- encodedPath = parts.map(function (p) { return encodeURIComponent(decodeURIComponent(p)); }).join("/");
192
- }
193
- if (this.host) {
194
- uri = combineUrlPaths(uri, encodedPath);
195
- }
196
- else {
197
- uri = uri + encodedPath;
198
- }
199
- }
200
- var queryString = this.queryString;
201
- if (queryString) {
202
- uri += "?" + queryString;
203
- }
204
- if (this.hashString) {
205
- var params = this._splitStringIntoParams(this.hashString);
206
- var encodedString = this._getParamsAsString(params);
207
- uri += "#" + encodedString;
208
- }
209
- return uri;
210
- },
211
- /**
212
- * Set the absolute uri string for this Uri. Replaces all existing values
213
- */
214
- set: function (uri) {
215
- this._setFromUriString(uri || "");
216
- },
217
- enumerable: true,
218
- configurable: true
219
- });
220
- /**
221
- * Gets the effective port number, returning the default port number if omitted for the given scheme.
222
- */
223
- Uri.prototype.getEffectivePort = function () {
224
- if (this.port) {
225
- return this.port;
226
- }
227
- else {
228
- if (stringEquals(this.scheme, "http", true)) {
229
- return 80;
230
- }
231
- else if (stringEquals(this.scheme, "https", true)) {
232
- return 443;
233
- }
234
- else {
235
- return 0;
236
- }
237
- }
238
- };
239
- /**
240
- * Builds an encoded key/value pair string
241
- * like query string or hash strings
242
- */
243
- Uri.prototype._getParamsAsString = function (params) {
244
- if (params && params.length) {
245
- return params.map(function (param) {
246
- if (param.value !== null) {
247
- return encodeURIComponent(param.name) + "=" + encodeURIComponent(param.value);
248
- }
249
- else {
250
- return encodeURIComponent(param.name);
251
- }
252
- }).join("&");
253
- }
254
- else {
255
- return "";
256
- }
257
- };
258
- Object.defineProperty(Uri.prototype, "queryString", {
259
- /**
260
- * Get the query string for this Uri.
261
- */
262
- get: function () {
263
- return this._getParamsAsString(this.queryParameters);
264
- },
265
- /**
266
- * Set the query string for this Uri. Replaces existing value
267
- */
268
- set: function (queryString) {
269
- this.queryParameters = this._splitStringIntoParams(queryString);
270
- },
271
- enumerable: true,
272
- configurable: true
273
- });
274
- /**
275
- * Coverts a key/value pair string into parameters array
276
- * @param paramString String such as a=b&c=d
277
- */
278
- Uri.prototype._splitStringIntoParams = function (paramString) {
279
- var _this = this;
280
- var params = [];
281
- paramString.split('&').forEach(function (pair) {
282
- if (pair) {
283
- var valueSplit = _this._singleSplit(pair, "=");
284
- if (valueSplit) {
285
- params.push({
286
- name: _this._decodeUriComponent(valueSplit.part1),
287
- value: _this._decodeUriComponent(valueSplit.part2)
288
- });
289
- }
290
- else {
291
- params.push({
292
- name: _this._decodeUriComponent(pair),
293
- value: null
294
- });
295
- }
296
- }
297
- });
298
- return params;
299
- };
300
- /**
301
- * Get the value of the query parameter with the given key
302
- *
303
- * @param name Query parameter name
304
- */
305
- Uri.prototype.getQueryParam = function (name) {
306
- var value;
307
- if (this.queryParameters) {
308
- var matchingPairs = this.queryParameters.filter(function (p) { return stringEquals(p.name, name, true); });
309
- if (matchingPairs.length > 0) {
310
- value = matchingPairs[0].value;
311
- }
312
- }
313
- return value;
314
- };
315
- /**
316
- * Adds a query string parameter to the current uri
317
- *
318
- * @param name The Query parameter name
319
- * @param value The Query parameter value
320
- * @param replaceExisting If true, replace all existing parameters with the same name
321
- */
322
- Uri.prototype.addQueryParam = function (name, value, replaceExisting) {
323
- if (replaceExisting) {
324
- this.removeQueryParam(name);
325
- }
326
- if (!this.queryParameters) {
327
- this.queryParameters = [];
328
- }
329
- this.queryParameters.push({ name: name, value: value });
330
- };
331
- /**
332
- * Adds query string parameters to the current uri
333
- *
334
- * @param parameters Query parameters to add
335
- * @param replaceExisting If true, replace all existing parameters with the same name
336
- * @param keyPrefix If specified, a value to prepend to all query parameter keys
337
- */
338
- Uri.prototype.addQueryParams = function (parameters, replaceExisting, keyPrefix) {
339
- var _this = this;
340
- var _loop_1 = function (key) {
341
- var value = parameters[key];
342
- if (value !== null && value !== undefined) {
343
- var keyWithPrefix_1 = (keyPrefix || "") + key;
344
- if (value instanceof Date) {
345
- this_1.addQueryParam(keyWithPrefix_1, value.toJSON(), replaceExisting);
346
- }
347
- else if (Array.isArray(value)) {
348
- value.forEach(function (v) { return _this.addQueryParam(keyWithPrefix_1, "" + v, replaceExisting); });
349
- }
350
- else if (typeof value === "object") {
351
- this_1.addQueryParams(value, replaceExisting, keyWithPrefix_1 + ".");
352
- }
353
- else {
354
- this_1.addQueryParam(keyWithPrefix_1, "" + value, replaceExisting);
355
- }
356
- }
357
- };
358
- var this_1 = this;
359
- for (var key in parameters) {
360
- _loop_1(key);
361
- }
362
- };
363
- /**
364
- * Removes a query string parameter
365
- *
366
- * @param name The Query parameter name
367
- */
368
- Uri.prototype.removeQueryParam = function (name) {
369
- if (this.queryParameters) {
370
- this.queryParameters = this.queryParameters.filter(function (p) { return !stringEquals(p.name, name, true); });
371
- }
372
- };
373
- return Uri;
374
- }());
375
- exports.Uri = Uri;
376
- /**
377
- * Take url segments and join them with a single slash character. Takes care of path segements that start and/or end
378
- * with a slash to ensure that the resulting URL does not have double-slashes
379
- *
380
- * @param paths Path segments to concatenate
381
- */
382
- function combineUrlPaths() {
383
- var paths = [];
384
- for (var _i = 0; _i < arguments.length; _i++) {
385
- paths[_i] = arguments[_i];
386
- }
387
- var segmentsToJoin = [];
388
- // Trim leading and trailing slash in each segment
389
- for (var i = 0, last = paths.length - 1; i <= last; i++) {
390
- var path = paths[i];
391
- if (path) {
392
- if (path === "/" && (i === 0 || i === last)) {
393
- // For a "/" segment at the beginning or end of the list, insert an empty entry to force
394
- // a leading or trailing slash in the resulting URL
395
- segmentsToJoin.push("");
396
- }
397
- else {
398
- if (i > 0 && path[0] === "/") {
399
- // Trim leading slash in any segment except the first one
400
- path = path.substr(1);
401
- }
402
- if (i < last && path[path.length - 1] === "/") {
403
- // Trim trailing slash in any segment except the last one
404
- path = path.substr(0, path.length - 1);
405
- }
406
- if (path) {
407
- segmentsToJoin.push(path);
408
- }
409
- }
410
- }
411
- }
412
- if (segmentsToJoin.length === 1 && segmentsToJoin[0] === "") {
413
- return "/";
414
- }
415
- // Join segments by slash
416
- return segmentsToJoin.join("/");
417
- }
418
- exports.combineUrlPaths = combineUrlPaths;
419
- /**
420
- * Parse a route template into a structure that can be used to quickly do route replacements
421
- *
422
- * @param routeTemplate MVC route template string (like "/foo/{id}/{*params}")
423
- */
424
- function parseRouteTemplate(routeTemplate) {
425
- var parsedRoute = {
426
- segments: []
427
- };
428
- var paramStartIndex = -1;
429
- var segmentStartIndex = -1;
430
- var segmentPrefix = "";
431
- for (var charIndex = 0, routeTemplateLen = routeTemplate.length; charIndex < routeTemplateLen; charIndex++) {
432
- var c = routeTemplate.charCodeAt(charIndex);
433
- if (paramStartIndex >= 0) {
434
- if (c === 125 /* endCurlyBrace */) {
435
- var paramName = routeTemplate.substring(paramStartIndex, charIndex);
436
- var isWildCardParam = false;
437
- if (paramName.charCodeAt(0) === 42 /* asterisk */) {
438
- paramName = paramName.substr(1);
439
- isWildCardParam = true;
440
- }
441
- parsedRoute.segments.push({
442
- paramName: paramName,
443
- isWildCardParam: isWildCardParam
444
- });
445
- paramStartIndex = -1;
446
- }
447
- }
448
- else {
449
- if (c === 123 /* startCurlyBrace */ && routeTemplate.charCodeAt(charIndex + 1) !== 123 /* startCurlyBrace */) {
450
- // Start of a parameter
451
- if (segmentPrefix || segmentStartIndex >= 0) {
452
- // Store the previous segment
453
- var segmentText = segmentPrefix;
454
- if (segmentStartIndex >= 0) {
455
- segmentText += routeTemplate.substring(segmentStartIndex, charIndex);
456
- }
457
- if (segmentText) {
458
- parsedRoute.segments.push({
459
- text: segmentText
460
- });
461
- }
462
- // Reset the segment tracking info
463
- segmentStartIndex = -1;
464
- segmentPrefix = "";
465
- }
466
- paramStartIndex = charIndex + 1;
467
- }
468
- else {
469
- // Handle double {{ or double }} as an escape sequence. This is rare. For simplicity we will
470
- if ((c === 123 /* startCurlyBrace */ && routeTemplate.charCodeAt(charIndex + 1) === 123 /* startCurlyBrace */) ||
471
- (c === 125 /* endCurlyBrace */ && routeTemplate.charCodeAt(charIndex + 1) === 125 /* endCurlyBrace */)) {
472
- segmentPrefix = segmentPrefix + routeTemplate.substring(segmentStartIndex >= 0 ? segmentStartIndex : charIndex, charIndex + 1);
473
- segmentStartIndex = -1;
474
- charIndex++;
475
- }
476
- if (segmentStartIndex < 0) {
477
- segmentStartIndex = charIndex;
478
- }
479
- }
480
- }
481
- }
482
- // Store any pending segment
483
- if (segmentStartIndex >= 0 || paramStartIndex >= 0) {
484
- var segmentText = segmentPrefix + routeTemplate.substring(segmentStartIndex >= 0 ? segmentStartIndex : paramStartIndex);
485
- if (segmentText) {
486
- parsedRoute.segments.push({
487
- text: segmentText
488
- });
489
- }
490
- }
491
- // Mark any param as required if it has a text segment (other than just "/") after it
492
- var required = false;
493
- for (var i = parsedRoute.segments.length - 1; i >= 0; i--) {
494
- var segment = parsedRoute.segments[i];
495
- if (segment.text && segment.text !== "/") {
496
- required = true;
497
- }
498
- else if (required && segment.paramName) {
499
- segment.isRequiredParam = true;
500
- }
501
- }
502
- return parsedRoute;
503
- }
504
- exports.parseRouteTemplate = parseRouteTemplate;
505
- /**
506
- * Take a set of routes and route values and form a url using the best match. The best match
507
- * is the route with the highest number of replacements (of the given routeValues dictionary).
508
- * In the event of a tie (same number of replacements) the route that came first wins.
509
- *
510
- * @param routeCollection Array of parsed routes
511
- * @param routeValues Replacement values
512
- */
513
- function routeUrl(routeCollection, routeValues) {
514
- var bestMatch = getBestRouteMatch(routeCollection, routeValues);
515
- if (!bestMatch) {
516
- return "";
517
- }
518
- var uri = new Uri(bestMatch.url);
519
- for (var routeValueKey in routeValues) {
520
- if (!bestMatch.matchedParameters[routeValueKey]) {
521
- uri.addQueryParam(routeValueKey, routeValues[routeValueKey]);
522
- }
523
- }
524
- return uri.absoluteUri;
525
- }
526
- exports.routeUrl = routeUrl;
527
- /**
528
- * Take a set of routes and find the best match. The best match is the route with the highest number of replacements
529
- * (of the given routeValues dictionary). In the event of a tie (same number of replacements) the route that came first wins.
530
- *
531
- * @param routeCollection Array of parsed routes
532
- * @param routeValues Replacement values
533
- */
534
- function getBestRouteMatch(routeCollection, routeValues) {
535
- var bestMatch;
536
- var totalRouteValues = Object.keys(routeValues).length;
537
- for (var _i = 0, routeCollection_1 = routeCollection; _i < routeCollection_1.length; _i++) {
538
- var route = routeCollection_1[_i];
539
- var match = replaceParsedRouteValues(route, routeValues, false);
540
- if (match && (!bestMatch || match.matchedParametersCount > bestMatch.matchedParametersCount)) {
541
- bestMatch = match;
542
- if (match.matchedParametersCount === totalRouteValues) {
543
- // This route matched all route values. Return its url directly (no need to even add query params)
544
- return bestMatch;
545
- }
546
- }
547
- }
548
- return bestMatch;
549
- }
550
- exports.getBestRouteMatch = getBestRouteMatch;
551
- /**
552
- * Replace route values for a specific parsed route
553
- *
554
- * @param parsedRoute The route to evaluate
555
- * @param routeValues Dictionary of route replacement parameters
556
- * @param continueOnUnmatchedSegements If true, continue with replacements even after a miss. By default (false), stop replacements once a parameter is not present.
557
- */
558
- function replaceParsedRouteValues(parsedRoute, routeValues, continueOnUnmatchedSegements) {
559
- var urlParts = [];
560
- var matchedParameters = {};
561
- var matchedParametersCount = 0;
562
- for (var segmentIndex = 0, l = parsedRoute.segments.length; segmentIndex < l; segmentIndex++) {
563
- var segment = parsedRoute.segments[segmentIndex];
564
- if (segment.text) {
565
- var segmentText = segment.text;
566
- if (continueOnUnmatchedSegements) {
567
- // Make sure we don't have consecutive slash (/) characters in the case of missing segments
568
- if (segmentIndex > 0 && segmentText.charAt(0) === "/") {
569
- if (urlParts.length === 0) {
570
- // First text segment after one or more missing parameter segments. Remove the leading slash.
571
- segmentText = segmentText.substr(1);
572
- }
573
- }
574
- }
575
- if (segmentText) {
576
- urlParts.push(segmentText);
577
- }
578
- }
579
- else {
580
- var value = routeValues[segment.paramName];
581
- if (!value && value !== 0) {
582
- // The route value was not supplied
583
- if (!continueOnUnmatchedSegements) {
584
- if (segment.isRequiredParam) {
585
- // This is a required parameter. Return undefined since this route was not a match.
586
- return undefined;
587
- }
588
- else {
589
- // This is an omitted optional parameter. Return what we've computed so far.
590
- break;
591
- }
592
- }
593
- else if (urlParts.length) {
594
- // Unmatched segment being omitted. Remove any previously trailing slash
595
- var lastSegment = urlParts[urlParts.length - 1];
596
- if (lastSegment[lastSegment.length - 1] === "/") {
597
- urlParts[urlParts.length - 1] = lastSegment.substr(0, lastSegment.length - 1);
598
- }
599
- }
600
- }
601
- else {
602
- urlParts.push(segment.isWildCardParam ? encodeURI("" + value) : encodeURIComponent("" + value));
603
- matchedParameters[segment.paramName] = true;
604
- matchedParametersCount++;
605
- }
606
- }
607
- }
608
- return {
609
- url: urlParts.join(""),
610
- matchedParameters: matchedParameters,
611
- matchedParametersCount: matchedParametersCount
612
- };
613
- }
614
- exports.replaceParsedRouteValues = replaceParsedRouteValues;
615
- /**
616
- * Take an MVC route template (like "/foo/{id}/{*params}") and replace the templated parts with values from the given dictionary
617
- *
618
- * @param routeTemplate MVC route template (like "/foo/{id}/{*params}")
619
- * @param routeValues Route value replacements
620
- */
621
- function replaceRouteValues(routeTemplate, routeValues) {
622
- var parsedRoute = parseRouteTemplate(routeTemplate);
623
- return replaceParsedRouteValues(parsedRoute, routeValues, true).url;
624
- }
625
- exports.replaceRouteValues = replaceRouteValues;
626
- });
1
+ "use strict";
2
+ /*
3
+ * ---------------------------------------------------------
4
+ * Copyright(C) Microsoft Corporation. All rights reserved.
5
+ * ---------------------------------------------------------
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.Uri = void 0;
9
+ exports.combineUrlPaths = combineUrlPaths;
10
+ exports.parseRouteTemplate = parseRouteTemplate;
11
+ exports.routeUrl = routeUrl;
12
+ exports.getBestRouteMatch = getBestRouteMatch;
13
+ exports.replaceParsedRouteValues = replaceParsedRouteValues;
14
+ exports.replaceRouteValues = replaceRouteValues;
15
+ /**
16
+ * Key constants used by route parsing.
17
+ */
18
+ var KeyCodes;
19
+ (function (KeyCodes) {
20
+ KeyCodes[KeyCodes["asterisk"] = 42] = "asterisk";
21
+ KeyCodes[KeyCodes["endCurlyBrace"] = 125] = "endCurlyBrace";
22
+ KeyCodes[KeyCodes["startCurlyBrace"] = 123] = "startCurlyBrace";
23
+ })(KeyCodes || (KeyCodes = {}));
24
+ function prepareForComparison(value, upperCase) {
25
+ return value ? (upperCase ? value.toLocaleUpperCase() : value) : "";
26
+ }
27
+ function stringEquals(str1, str2, ignoreCase) {
28
+ if (str1 === str2) {
29
+ return true;
30
+ }
31
+ return prepareForComparison(str1, ignoreCase).localeCompare(prepareForComparison(str2, ignoreCase)) === 0;
32
+ }
33
+ /**
34
+ * Class that represents a Uri and allows parsing/getting and setting of individual parts
35
+ */
36
+ class Uri {
37
+ /**
38
+ * Create a new Uri.
39
+ *
40
+ * @param uri Optional uri string to populate values with
41
+ * @param options Options for parsing the uri string
42
+ */
43
+ constructor(uri, options) {
44
+ /**
45
+ * The uri scheme such as http or https
46
+ */
47
+ this.scheme = "";
48
+ /**
49
+ * If true, do not emit the "//" separator after the scheme:
50
+ * Set to true for schemes like mailto (e.g. mailto:foo@bar)
51
+ */
52
+ this.noSchemeSeparator = false;
53
+ /**
54
+ * The uri hostname (does not include port or scheme)
55
+ */
56
+ this.host = "";
57
+ /**
58
+ * The port number of the uri as supplied in the url. 0 if left out in the url (e.g. the default port for the scheme).
59
+ */
60
+ this.port = 0;
61
+ /**
62
+ * The relative path of the uri
63
+ */
64
+ this.path = "";
65
+ /**
66
+ * The array of query parameters in the uri
67
+ */
68
+ this.queryParameters = [];
69
+ /**
70
+ * The hash string of the uri
71
+ */
72
+ this.hashString = "";
73
+ if (uri) {
74
+ this._setFromUriString(uri, options);
75
+ }
76
+ }
77
+ _setFromUriString(uriString, options) {
78
+ let uri = uriString;
79
+ // Parse out the hash string
80
+ let hashSplit = this._singleSplit(uri, "#");
81
+ if (hashSplit) {
82
+ uri = hashSplit.part1;
83
+ this.hashString = this._decodeUriComponent(hashSplit.part2);
84
+ }
85
+ else {
86
+ this.hashString = "";
87
+ }
88
+ // Parse the query parameters
89
+ let querySplit = this._singleSplit(uri, "?");
90
+ if (querySplit) {
91
+ uri = querySplit.part1;
92
+ this.queryString = querySplit.part2;
93
+ }
94
+ else {
95
+ this.queryParameters = [];
96
+ }
97
+ this.scheme = "";
98
+ this.host = "";
99
+ this.port = 0;
100
+ this.path = "";
101
+ // Parse out the scheme components of the uri
102
+ this.noSchemeSeparator = false;
103
+ const schemeSplit = this._singleSplit(uri, ":");
104
+ if (schemeSplit) {
105
+ this.scheme = schemeSplit.part1;
106
+ uri = schemeSplit.part2;
107
+ if (uri.substr(0, 2) === "//") {
108
+ uri = uri.substr(2);
109
+ // Parse out the path part of the uri
110
+ const pathSplit = this._singleSplit(uri, "/");
111
+ if (pathSplit) {
112
+ uri = pathSplit.part1;
113
+ this.path = pathSplit.part2;
114
+ }
115
+ else {
116
+ this.path = "";
117
+ }
118
+ // Parse out the port number
119
+ const portSplit = this._singleSplit(uri, ":");
120
+ if (portSplit) {
121
+ this.host = portSplit.part1;
122
+ this.port = parseInt(portSplit.part2);
123
+ if (isNaN(this.port)) {
124
+ // Segment after : was not a port, consider it part of the path
125
+ this.host += ":";
126
+ this.path = portSplit.part2 + "/" + this.path;
127
+ }
128
+ }
129
+ else {
130
+ this.host = uri;
131
+ }
132
+ }
133
+ else {
134
+ // No host for schemes like mailto: just use path
135
+ this.noSchemeSeparator = true;
136
+ this.path = uri;
137
+ }
138
+ }
139
+ else {
140
+ // Relative Url was given
141
+ this.path = uri;
142
+ }
143
+ if (options && options.absoluteUriRequired && !this.scheme) {
144
+ throw new Error(`The uri string "${uriString}" does not represent a valid absolute uri.`);
145
+ }
146
+ }
147
+ _singleSplit(value, separator) {
148
+ const matchIndex = value.indexOf(separator);
149
+ if (matchIndex >= 0) {
150
+ return {
151
+ part1: value.substr(0, matchIndex),
152
+ part2: value.substr(matchIndex + 1)
153
+ };
154
+ }
155
+ else {
156
+ return undefined;
157
+ }
158
+ }
159
+ _decodeUriComponent(value) {
160
+ if (value) {
161
+ // Replace "+" character with %20.
162
+ value = value.replace(/\+/g, "%20");
163
+ value = decodeURIComponent(value);
164
+ }
165
+ return value;
166
+ }
167
+ /**
168
+ * Get the absolute uri string for this Uri
169
+ */
170
+ get absoluteUri() {
171
+ let uri = "";
172
+ if (this.scheme) {
173
+ uri = encodeURI(decodeURI(this.scheme)) + ":";
174
+ if (!this.noSchemeSeparator) {
175
+ uri += "//";
176
+ }
177
+ }
178
+ if (this.host) {
179
+ uri += encodeURI(decodeURI(this.host));
180
+ if (this.port) {
181
+ uri += ":" + this.port;
182
+ }
183
+ if (!this.noSchemeSeparator || this.path) {
184
+ uri += "/";
185
+ }
186
+ }
187
+ if (this.path) {
188
+ let encodedPath;
189
+ if (this.noSchemeSeparator) {
190
+ // Only do simple encoding for schemes like mailto: or blob: where
191
+ // we can't determine host versus path
192
+ encodedPath = encodeURI(decodeURI(this.path));
193
+ }
194
+ else {
195
+ const parts = this.path.split('/');
196
+ encodedPath = parts.map(p => encodeURIComponent(decodeURIComponent(p))).join("/");
197
+ }
198
+ if (this.host) {
199
+ uri = combineUrlPaths(uri, encodedPath);
200
+ }
201
+ else {
202
+ uri = uri + encodedPath;
203
+ }
204
+ }
205
+ const queryString = this.queryString;
206
+ if (queryString) {
207
+ uri += "?" + queryString;
208
+ }
209
+ if (this.hashString) {
210
+ const params = this._splitStringIntoParams(this.hashString);
211
+ const encodedString = this._getParamsAsString(params);
212
+ uri += "#" + encodedString;
213
+ }
214
+ return uri;
215
+ }
216
+ /**
217
+ * Set the absolute uri string for this Uri. Replaces all existing values
218
+ */
219
+ set absoluteUri(uri) {
220
+ this._setFromUriString(uri || "");
221
+ }
222
+ /**
223
+ * Gets the effective port number, returning the default port number if omitted for the given scheme.
224
+ */
225
+ getEffectivePort() {
226
+ if (this.port) {
227
+ return this.port;
228
+ }
229
+ else {
230
+ if (stringEquals(this.scheme, "http", true)) {
231
+ return 80;
232
+ }
233
+ else if (stringEquals(this.scheme, "https", true)) {
234
+ return 443;
235
+ }
236
+ else {
237
+ return 0;
238
+ }
239
+ }
240
+ }
241
+ /**
242
+ * Builds an encoded key/value pair string
243
+ * like query string or hash strings
244
+ */
245
+ _getParamsAsString(params) {
246
+ if (params && params.length) {
247
+ return params.map((param) => {
248
+ if (param.value !== null) {
249
+ return encodeURIComponent(param.name) + "=" + encodeURIComponent(param.value);
250
+ }
251
+ else {
252
+ return encodeURIComponent(param.name);
253
+ }
254
+ }).join("&");
255
+ }
256
+ else {
257
+ return "";
258
+ }
259
+ }
260
+ /**
261
+ * Get the query string for this Uri.
262
+ */
263
+ get queryString() {
264
+ return this._getParamsAsString(this.queryParameters);
265
+ }
266
+ /**
267
+ * Set the query string for this Uri. Replaces existing value
268
+ */
269
+ set queryString(queryString) {
270
+ this.queryParameters = this._splitStringIntoParams(queryString);
271
+ }
272
+ /**
273
+ * Coverts a key/value pair string into parameters array
274
+ * @param paramString String such as a=b&c=d
275
+ */
276
+ _splitStringIntoParams(paramString) {
277
+ let params = [];
278
+ paramString.split('&').forEach((pair) => {
279
+ if (pair) {
280
+ const valueSplit = this._singleSplit(pair, "=");
281
+ if (valueSplit) {
282
+ params.push({
283
+ name: this._decodeUriComponent(valueSplit.part1),
284
+ value: this._decodeUriComponent(valueSplit.part2)
285
+ });
286
+ }
287
+ else {
288
+ params.push({
289
+ name: this._decodeUriComponent(pair),
290
+ value: null
291
+ });
292
+ }
293
+ }
294
+ });
295
+ return params;
296
+ }
297
+ /**
298
+ * Get the value of the query parameter with the given key
299
+ *
300
+ * @param name Query parameter name
301
+ */
302
+ getQueryParam(name) {
303
+ let value;
304
+ if (this.queryParameters) {
305
+ let matchingPairs = this.queryParameters.filter(p => stringEquals(p.name, name, true));
306
+ if (matchingPairs.length > 0) {
307
+ value = matchingPairs[0].value;
308
+ }
309
+ }
310
+ return value;
311
+ }
312
+ /**
313
+ * Adds a query string parameter to the current uri
314
+ *
315
+ * @param name The Query parameter name
316
+ * @param value The Query parameter value
317
+ * @param replaceExisting If true, replace all existing parameters with the same name
318
+ */
319
+ addQueryParam(name, value, replaceExisting) {
320
+ if (replaceExisting) {
321
+ this.removeQueryParam(name);
322
+ }
323
+ if (!this.queryParameters) {
324
+ this.queryParameters = [];
325
+ }
326
+ this.queryParameters.push({ name: name, value: value });
327
+ }
328
+ /**
329
+ * Adds query string parameters to the current uri
330
+ *
331
+ * @param parameters Query parameters to add
332
+ * @param replaceExisting If true, replace all existing parameters with the same name
333
+ * @param keyPrefix If specified, a value to prepend to all query parameter keys
334
+ */
335
+ addQueryParams(parameters, replaceExisting, keyPrefix) {
336
+ for (const key in parameters) {
337
+ const value = parameters[key];
338
+ if (value !== null && value !== undefined) {
339
+ const keyWithPrefix = (keyPrefix || "") + key;
340
+ if (value instanceof Date) {
341
+ this.addQueryParam(keyWithPrefix, value.toJSON(), replaceExisting);
342
+ }
343
+ else if (Array.isArray(value)) {
344
+ value.forEach(v => this.addQueryParam(keyWithPrefix, "" + v, replaceExisting));
345
+ }
346
+ else if (typeof value === "object") {
347
+ this.addQueryParams(value, replaceExisting, keyWithPrefix + ".");
348
+ }
349
+ else {
350
+ this.addQueryParam(keyWithPrefix, "" + value, replaceExisting);
351
+ }
352
+ }
353
+ }
354
+ }
355
+ /**
356
+ * Removes a query string parameter
357
+ *
358
+ * @param name The Query parameter name
359
+ */
360
+ removeQueryParam(name) {
361
+ if (this.queryParameters) {
362
+ this.queryParameters = this.queryParameters.filter(p => !stringEquals(p.name, name, true));
363
+ }
364
+ }
365
+ }
366
+ exports.Uri = Uri;
367
+ /**
368
+ * Take url segments and join them with a single slash character. Takes care of path segements that start and/or end
369
+ * with a slash to ensure that the resulting URL does not have double-slashes
370
+ *
371
+ * @param paths Path segments to concatenate
372
+ */
373
+ function combineUrlPaths(...paths) {
374
+ let segmentsToJoin = [];
375
+ // Trim leading and trailing slash in each segment
376
+ for (let i = 0, last = paths.length - 1; i <= last; i++) {
377
+ let path = paths[i];
378
+ if (path) {
379
+ if (path === "/" && (i === 0 || i === last)) {
380
+ // For a "/" segment at the beginning or end of the list, insert an empty entry to force
381
+ // a leading or trailing slash in the resulting URL
382
+ segmentsToJoin.push("");
383
+ }
384
+ else {
385
+ if (i > 0 && path[0] === "/") {
386
+ // Trim leading slash in any segment except the first one
387
+ path = path.substr(1);
388
+ }
389
+ if (i < last && path[path.length - 1] === "/") {
390
+ // Trim trailing slash in any segment except the last one
391
+ path = path.substr(0, path.length - 1);
392
+ }
393
+ if (path) {
394
+ segmentsToJoin.push(path);
395
+ }
396
+ }
397
+ }
398
+ }
399
+ if (segmentsToJoin.length === 1 && segmentsToJoin[0] === "") {
400
+ return "/";
401
+ }
402
+ // Join segments by slash
403
+ return segmentsToJoin.join("/");
404
+ }
405
+ /**
406
+ * Parse a route template into a structure that can be used to quickly do route replacements
407
+ *
408
+ * @param routeTemplate MVC route template string (like "/foo/{id}/{*params}")
409
+ */
410
+ function parseRouteTemplate(routeTemplate) {
411
+ const parsedRoute = {
412
+ segments: []
413
+ };
414
+ let paramStartIndex = -1;
415
+ let segmentStartIndex = -1;
416
+ let segmentPrefix = "";
417
+ for (let charIndex = 0, routeTemplateLen = routeTemplate.length; charIndex < routeTemplateLen; charIndex++) {
418
+ let c = routeTemplate.charCodeAt(charIndex);
419
+ if (paramStartIndex >= 0) {
420
+ if (c === 125 /* KeyCodes.endCurlyBrace */) {
421
+ let paramName = routeTemplate.substring(paramStartIndex, charIndex);
422
+ let isWildCardParam = false;
423
+ if (paramName.charCodeAt(0) === 42 /* KeyCodes.asterisk */) {
424
+ paramName = paramName.substr(1);
425
+ isWildCardParam = true;
426
+ }
427
+ parsedRoute.segments.push({
428
+ paramName,
429
+ isWildCardParam
430
+ });
431
+ paramStartIndex = -1;
432
+ }
433
+ }
434
+ else {
435
+ if (c === 123 /* KeyCodes.startCurlyBrace */ && routeTemplate.charCodeAt(charIndex + 1) !== 123 /* KeyCodes.startCurlyBrace */) {
436
+ // Start of a parameter
437
+ if (segmentPrefix || segmentStartIndex >= 0) {
438
+ // Store the previous segment
439
+ let segmentText = segmentPrefix;
440
+ if (segmentStartIndex >= 0) {
441
+ segmentText += routeTemplate.substring(segmentStartIndex, charIndex);
442
+ }
443
+ if (segmentText) {
444
+ parsedRoute.segments.push({
445
+ text: segmentText
446
+ });
447
+ }
448
+ // Reset the segment tracking info
449
+ segmentStartIndex = -1;
450
+ segmentPrefix = "";
451
+ }
452
+ paramStartIndex = charIndex + 1;
453
+ }
454
+ else {
455
+ // Handle double {{ or double }} as an escape sequence. This is rare. For simplicity we will
456
+ if ((c === 123 /* KeyCodes.startCurlyBrace */ && routeTemplate.charCodeAt(charIndex + 1) === 123 /* KeyCodes.startCurlyBrace */) ||
457
+ (c === 125 /* KeyCodes.endCurlyBrace */ && routeTemplate.charCodeAt(charIndex + 1) === 125 /* KeyCodes.endCurlyBrace */)) {
458
+ segmentPrefix = segmentPrefix + routeTemplate.substring(segmentStartIndex >= 0 ? segmentStartIndex : charIndex, charIndex + 1);
459
+ segmentStartIndex = -1;
460
+ charIndex++;
461
+ }
462
+ if (segmentStartIndex < 0) {
463
+ segmentStartIndex = charIndex;
464
+ }
465
+ }
466
+ }
467
+ }
468
+ // Store any pending segment
469
+ if (segmentStartIndex >= 0 || paramStartIndex >= 0) {
470
+ const segmentText = segmentPrefix + routeTemplate.substring(segmentStartIndex >= 0 ? segmentStartIndex : paramStartIndex);
471
+ if (segmentText) {
472
+ parsedRoute.segments.push({
473
+ text: segmentText
474
+ });
475
+ }
476
+ }
477
+ // Mark any param as required if it has a text segment (other than just "/") after it
478
+ let required = false;
479
+ for (let i = parsedRoute.segments.length - 1; i >= 0; i--) {
480
+ let segment = parsedRoute.segments[i];
481
+ if (segment.text && segment.text !== "/") {
482
+ required = true;
483
+ }
484
+ else if (required && segment.paramName) {
485
+ segment.isRequiredParam = true;
486
+ }
487
+ }
488
+ return parsedRoute;
489
+ }
490
+ /**
491
+ * Take a set of routes and route values and form a url using the best match. The best match
492
+ * is the route with the highest number of replacements (of the given routeValues dictionary).
493
+ * In the event of a tie (same number of replacements) the route that came first wins.
494
+ *
495
+ * @param routeCollection Array of parsed routes
496
+ * @param routeValues Replacement values
497
+ */
498
+ function routeUrl(routeCollection, routeValues) {
499
+ let bestMatch = getBestRouteMatch(routeCollection, routeValues);
500
+ if (!bestMatch) {
501
+ return "";
502
+ }
503
+ let uri = new Uri(bestMatch.url);
504
+ for (let routeValueKey in routeValues) {
505
+ if (!bestMatch.matchedParameters[routeValueKey]) {
506
+ uri.addQueryParam(routeValueKey, routeValues[routeValueKey]);
507
+ }
508
+ }
509
+ return uri.absoluteUri;
510
+ }
511
+ /**
512
+ * Take a set of routes and find the best match. The best match is the route with the highest number of replacements
513
+ * (of the given routeValues dictionary). In the event of a tie (same number of replacements) the route that came first wins.
514
+ *
515
+ * @param routeCollection Array of parsed routes
516
+ * @param routeValues Replacement values
517
+ */
518
+ function getBestRouteMatch(routeCollection, routeValues) {
519
+ let bestMatch;
520
+ let totalRouteValues = Object.keys(routeValues).length;
521
+ for (let route of routeCollection) {
522
+ let match = replaceParsedRouteValues(route, routeValues, false);
523
+ if (match && (!bestMatch || match.matchedParametersCount > bestMatch.matchedParametersCount)) {
524
+ bestMatch = match;
525
+ if (match.matchedParametersCount === totalRouteValues) {
526
+ // This route matched all route values. Return its url directly (no need to even add query params)
527
+ return bestMatch;
528
+ }
529
+ }
530
+ }
531
+ return bestMatch;
532
+ }
533
+ /**
534
+ * Replace route values for a specific parsed route
535
+ *
536
+ * @param parsedRoute The route to evaluate
537
+ * @param routeValues Dictionary of route replacement parameters
538
+ * @param continueOnUnmatchedSegements If true, continue with replacements even after a miss. By default (false), stop replacements once a parameter is not present.
539
+ */
540
+ function replaceParsedRouteValues(parsedRoute, routeValues, continueOnUnmatchedSegements) {
541
+ let urlParts = [];
542
+ let matchedParameters = {};
543
+ let matchedParametersCount = 0;
544
+ for (let segmentIndex = 0, l = parsedRoute.segments.length; segmentIndex < l; segmentIndex++) {
545
+ const segment = parsedRoute.segments[segmentIndex];
546
+ if (segment.text) {
547
+ let segmentText = segment.text;
548
+ if (continueOnUnmatchedSegements) {
549
+ // Make sure we don't have consecutive slash (/) characters in the case of missing segments
550
+ if (segmentIndex > 0 && segmentText.charAt(0) === "/") {
551
+ if (urlParts.length === 0) {
552
+ // First text segment after one or more missing parameter segments. Remove the leading slash.
553
+ segmentText = segmentText.substr(1);
554
+ }
555
+ }
556
+ }
557
+ if (segmentText) {
558
+ urlParts.push(segmentText);
559
+ }
560
+ }
561
+ else {
562
+ const value = routeValues[segment.paramName];
563
+ if (!value && value !== 0) {
564
+ // The route value was not supplied
565
+ if (!continueOnUnmatchedSegements) {
566
+ if (segment.isRequiredParam) {
567
+ // This is a required parameter. Return undefined since this route was not a match.
568
+ return undefined;
569
+ }
570
+ else {
571
+ // This is an omitted optional parameter. Return what we've computed so far.
572
+ break;
573
+ }
574
+ }
575
+ else if (urlParts.length) {
576
+ // Unmatched segment being omitted. Remove any previously trailing slash
577
+ let lastSegment = urlParts[urlParts.length - 1];
578
+ if (lastSegment[lastSegment.length - 1] === "/") {
579
+ urlParts[urlParts.length - 1] = lastSegment.substr(0, lastSegment.length - 1);
580
+ }
581
+ }
582
+ }
583
+ else {
584
+ urlParts.push(segment.isWildCardParam ? encodeURI("" + value) : encodeURIComponent("" + value));
585
+ matchedParameters[segment.paramName] = true;
586
+ matchedParametersCount++;
587
+ }
588
+ }
589
+ }
590
+ return {
591
+ url: urlParts.join(""),
592
+ matchedParameters,
593
+ matchedParametersCount
594
+ };
595
+ }
596
+ /**
597
+ * Take an MVC route template (like "/foo/{id}/{*params}") and replace the templated parts with values from the given dictionary
598
+ *
599
+ * @param routeTemplate MVC route template (like "/foo/{id}/{*params}")
600
+ * @param routeValues Route value replacements
601
+ */
602
+ function replaceRouteValues(routeTemplate, routeValues) {
603
+ let parsedRoute = parseRouteTemplate(routeTemplate);
604
+ return replaceParsedRouteValues(parsedRoute, routeValues, true).url;
605
+ }