2022-09-26 12:04:37 +03:00
|
|
|
import genericProxyHandler from "utils/proxy/handlers/generic";
|
|
|
|
import { asJson } from "utils/proxy/api-helpers";
|
2022-09-25 10:13:31 -07:00
|
|
|
|
|
|
|
const widget = {
|
|
|
|
api: "{url}/api/v3/{endpoint}?apikey={key}",
|
|
|
|
proxyHandler: genericProxyHandler,
|
|
|
|
|
|
|
|
mappings: {
|
2022-09-26 00:35:54 +03:00
|
|
|
series: {
|
2022-09-25 10:13:31 -07:00
|
|
|
endpoint: "series",
|
|
|
|
map: (data) => ({
|
|
|
|
total: asJson(data).length,
|
|
|
|
}),
|
2022-10-22 23:11:08 -07:00
|
|
|
validate: [
|
|
|
|
"total"
|
|
|
|
]
|
2022-09-25 10:13:31 -07:00
|
|
|
},
|
2022-09-26 00:35:54 +03:00
|
|
|
queue: {
|
2022-09-25 10:13:31 -07:00
|
|
|
endpoint: "queue",
|
2022-10-22 23:11:08 -07:00
|
|
|
validate: [
|
|
|
|
"totalRecords"
|
|
|
|
]
|
2022-09-25 10:13:31 -07:00
|
|
|
},
|
|
|
|
"wanted/missing": {
|
2022-09-26 00:35:54 +03:00
|
|
|
endpoint: "wanted/missing",
|
2022-10-22 23:11:08 -07:00
|
|
|
validate: [
|
|
|
|
"totalRecords"
|
|
|
|
]
|
2022-09-25 10:13:31 -07:00
|
|
|
},
|
2022-09-26 00:35:54 +03:00
|
|
|
},
|
2022-09-25 10:13:31 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
export default widget;
|