mirror of
https://github.com/gethomepage/homepage.git
synced 2026-10-15 15:09:56 -07:00
Docker CI / Docker Build & Push (push) Waiting to run
Lint / Linting Checks (push) Waiting to run
Release Drafter / Update Release Draft (push) Waiting to run
Release Drafter / Auto Label PR (push) Waiting to run
Tests / vitest (1) (push) Waiting to run
Tests / vitest (2) (push) Waiting to run
Tests / vitest (3) (push) Waiting to run
Tests / vitest (4) (push) Waiting to run
34 lines
813 B
JavaScript
34 lines
813 B
JavaScript
import credentialedProxyHandler from "utils/proxy/handlers/credentialed";
|
|
|
|
// Get total from header to avoid pagination limit
|
|
export function totalCount(data, headers) {
|
|
const count = parseInt(headers?.["x-total-count"], 10);
|
|
return { count: Number.isNaN(count) ? null : count };
|
|
}
|
|
|
|
const widget = {
|
|
api: "{url}/api/v1/{endpoint}",
|
|
proxyHandler: credentialedProxyHandler,
|
|
|
|
mappings: {
|
|
notifications: {
|
|
endpoint: "notifications?limit=1",
|
|
map: totalCount,
|
|
},
|
|
issues: {
|
|
endpoint: "repos/issues/search?type=issues&limit=1",
|
|
map: totalCount,
|
|
},
|
|
pulls: {
|
|
endpoint: "repos/issues/search?type=pulls&limit=1",
|
|
map: totalCount,
|
|
},
|
|
repositories: {
|
|
endpoint: "repos/search?limit=1",
|
|
map: totalCount,
|
|
},
|
|
},
|
|
};
|
|
|
|
export default widget;
|