()
| 60 | } |
| 61 | |
| 62 | export async function getLatestRelease() { |
| 63 | return fetch("/api/latestRelease", { |
| 64 | method: "GET", |
| 65 | mode: "same-origin", |
| 66 | cache: "no-cache", |
| 67 | redirect: "error", |
| 68 | }) |
| 69 | .then(processJsonResponse) |
| 70 | .then((updateInfo) => { |
| 71 | ["version", "kind", "data"].forEach((field) => { |
| 72 | if (!Object.hasOwn(updateInfo, field)) { |
| 73 | throw new ControllerError(`Missing expected ${field} field`); |
| 74 | } |
| 75 | }); |
| 76 | return updateInfo; |
| 77 | }); |
| 78 | } |
| 79 | |
| 80 | export async function getVersion() { |
| 81 | return fetch("/api/version", { |
nothing calls this directly
no outgoing calls
no test coverage detected