Fetch all available Edge browser versions for a platform from enterprise API.
(platform)
| 183 | |
| 184 | |
| 185 | def get_edge_versions(platform): |
| 186 | """Fetch all available Edge browser versions for a platform from enterprise API.""" |
| 187 | r = http.request("GET", "https://edgeupdates.microsoft.com/api/products?view=enterprise") |
| 188 | all_data = case_insensitive_json_loads(r.data) |
| 189 | |
| 190 | platform_name = "MacOS" if platform == "mac" else "Linux" |
| 191 | artifact_name = "pkg" if platform == "mac" else "deb" |
| 192 | |
| 193 | versions = [] |
| 194 | for data in all_data: |
| 195 | if data.get("product") != "Stable": |
| 196 | continue |
| 197 | for release in data["releases"]: |
| 198 | if release.get("platform") != platform_name: |
| 199 | continue |
| 200 | for artifact in release["artifacts"]: |
| 201 | if artifact["artifactname"] == artifact_name: |
| 202 | versions.append( |
| 203 | { |
| 204 | "url": artifact["location"], |
| 205 | "hash": artifact["hash"], |
| 206 | "version": release["productversion"], |
| 207 | } |
| 208 | ) |
| 209 | return versions |
| 210 | |
| 211 | |
| 212 | def get_edgedriver_version(major, platform): |
no test coverage detected