2022-11-18 15:24:07 -08:00

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;