fix space indentation

This commit is contained in:
Arif Hasanic
2025-07-25 11:27:09 +02:00
parent b2e9c1f056
commit 53da0f740c
21 changed files with 452 additions and 441 deletions

View File

@@ -1,48 +1,50 @@
class Flatastic {
private apikey: string;
private apikey: string;
constructor(apikey: string) {
this.apikey = apikey;
}
constructor(apikey: string) {
this.apikey = apikey;
}
async request(url: stringany) {
const headers = {
accept: "application/json, text/plain, */*",
"accept-language":
"de-CH,de;q=0.9,en-US;q=0.8,en-CH;q=0.7,en;q=0.6,ar-JO;q=0.5,ar;q=0.4,de-DE;q=0.3",
// "cache-control": "no-cache",
// "pragma": "no-cache",
// "sec-fetch-dest": "empty",
// "sec-fetch-mode": "cors",
// "sec-fetch-site": "same-site",
"x-api-key": this.apikey,
"x-api-version": "2.0.0",
"x-client-version": "2.3.20",
};
const response = await fetch(url, {
headers: {
...headers,
},
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return await response.json();
}
async request(url: stringany) {
const headers = {
accept: "application/json, text/plain, */*",
"accept-language":
"de-CH,de;q=0.9,en-US;q=0.8,en-CH;q=0.7,en;q=0.6,ar-JO;q=0.5,ar;q=0.4,de-DE;q=0.3",
// "cache-control": "no-cache",
// "pragma": "no-cache",
// "sec-fetch-dest": "empty",
// "sec-fetch-mode": "cors",
// "sec-fetch-site": "same-site",
"x-api-key": this.apikey,
"x-api-version": "2.0.0",
"x-client-version": "2.3.20",
};
const response = await fetch(url, {
headers: {
...headers,
},
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return await response.json();
}
getShoppingList() {
return this.request(
"https://api.flatastic-app.com/index.php/api/shoppinglist",
);
}
getShoppingList() {
return this.request(
"https://api.flatastic-app.com/index.php/api/shoppinglist",
);
}
getTaskList() {
return this.request("https://api.flatastic-app.com/index.php/api/chores");
}
getTaskList() {
return this.request(
"https://api.flatastic-app.com/index.php/api/chores",
);
}
getInformation() {
return this.request("https://api.flatastic-app.com/index.php/api/wg");
}
getInformation() {
return this.request("https://api.flatastic-app.com/index.php/api/wg");
}
}
export { Flatastic };

View File

@@ -1,13 +1,13 @@
async function fetchKvvDepartures(stopId: number) {
const API_URL = `https://projekte.kvv-efa.de/sl3-alone/XSLT_DM_REQUEST?outputFormat=JSON&coordOutputFormat=WGS84[dd.ddddd]&depType=stopEvents&locationServerActive=1&mode=direct&name_dm=${stopId}&type_dm=stop&useOnlyStops=1&useRealtime=1&limit=6&line=kvv:22301:E:H:s25&line=kvv:21012:E:H:s25&line=kvv:21012:E:R:s25&line=kvv:22305:E:H:s25`;
const API_URL = `https://projekte.kvv-efa.de/sl3-alone/XSLT_DM_REQUEST?outputFormat=JSON&coordOutputFormat=WGS84[dd.ddddd]&depType=stopEvents&locationServerActive=1&mode=direct&name_dm=${stopId}&type_dm=stop&useOnlyStops=1&useRealtime=1&limit=6&line=kvv:22301:E:H:s25&line=kvv:21012:E:H:s25&line=kvv:21012:E:R:s25&line=kvv:22305:E:H:s25`;
const data = await fetch(API_URL, {
method: "GET",
});
if (!data.ok) {
throw new Error(`HTTP error! status: ${data.status}`);
}
return data;
const data = await fetch(API_URL, {
method: "GET",
});
if (!data.ok) {
throw new Error(`HTTP error! status: ${data.status}`);
}
return data;
}
export { fetchKvvDepartures };