AdGuardHome/client2/src/lib/apis/safebrowsing.ts

40 lines
1.2 KiB
TypeScript

// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class SafebrowsingApi {
static async safebrowsingDisable(): Promise<number | Error> {
return await fetch(`/control/safebrowsing/disable`, {
method: 'POST',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async safebrowsingEnable(): Promise<number | Error> {
return await fetch(`/control/safebrowsing/enable`, {
method: 'POST',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async safebrowsingStatus(): Promise<any | Error> {
return await fetch(`/control/safebrowsing/status`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
}