2017-11-30 17:23:13 +01:00
|
|
|
import { parseFetch } from '../utils.js';
|
2015-07-15 15:06:18 +02:00
|
|
|
|
2016-04-21 15:44:20 +02:00
|
|
|
export default class Update {
|
2016-04-21 15:52:23 +02:00
|
|
|
constructor(api) {
|
|
|
|
this.api = api;
|
|
|
|
}
|
|
|
|
status() {
|
2017-11-30 17:23:13 +01:00
|
|
|
return fetch(`${this.api}update/status`, { method: 'GET' }).then(parseFetch);
|
2016-04-21 15:52:23 +02:00
|
|
|
}
|
|
|
|
download() {
|
|
|
|
//not tested
|
2018-01-25 17:29:51 +01:00
|
|
|
const body = new URLSearchParams();
|
|
|
|
|
|
|
|
return fetch(`${this.api}update/download`, { method: 'POST', body }).then(parseFetch);
|
2016-04-21 15:52:23 +02:00
|
|
|
}
|
|
|
|
install() {
|
|
|
|
//not tested
|
2018-01-25 17:29:51 +01:00
|
|
|
const body = new URLSearchParams();
|
|
|
|
|
|
|
|
return fetch(`${this.api}update/install`, { method: 'POST', body }).then(parseFetch);
|
2016-04-21 15:52:23 +02:00
|
|
|
}
|
|
|
|
clear() {
|
|
|
|
//not tested
|
2018-01-25 17:29:51 +01:00
|
|
|
const body = new URLSearchParams();
|
|
|
|
|
|
|
|
return fetch(`${this.api}update/clear`, { method: 'POST', body }).then(parseFetch);
|
2016-04-21 15:52:23 +02:00
|
|
|
}
|
2015-10-12 12:33:33 +02:00
|
|
|
}
|