mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-04 14:33:41 +01:00
34 lines
630 B
JavaScript
34 lines
630 B
JavaScript
import genericProxyHandler from "utils/proxy/handlers/generic";
|
|
import { asJson } from "utils/proxy/api-helpers";
|
|
|
|
const widget = {
|
|
api: "{url}/api/v3/{endpoint}?apikey={key}",
|
|
proxyHandler: genericProxyHandler,
|
|
|
|
mappings: {
|
|
series: {
|
|
endpoint: "series",
|
|
map: (data) => ({
|
|
total: asJson(data).length,
|
|
}),
|
|
validate: [
|
|
"total"
|
|
]
|
|
},
|
|
queue: {
|
|
endpoint: "queue",
|
|
validate: [
|
|
"totalRecords"
|
|
]
|
|
},
|
|
"wanted/missing": {
|
|
endpoint: "wanted/missing",
|
|
validate: [
|
|
"totalRecords"
|
|
]
|
|
},
|
|
},
|
|
};
|
|
|
|
export default widget;
|