feat(api): expose unifiSiteManager overview query
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bfbba5782a
commit
3fb2f2dc1f
5 files changed
+65
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { createIntegrationAsync } from "@homarr/integrations";
|
||||
import type { UnifiSiteManagerOverview } from "@homarr/integrations/types";
|
||||
|
||||
import { createIntegrationRequestHandler } from "./lib/integration-request-handler";
|
||||
|
||||
export const unifiSiteManagerRequestHandler = createIntegrationRequestHandler<
|
||||
UnifiSiteManagerOverview,
|
||||
"unifiSiteManager",
|
||||
Record<string, never>
|
||||
>({
|
||||
async requestAsync(integration, _input) {
|
||||
const integrationInstance = await createIntegrationAsync(integration);
|
||||
return await integrationInstance.getSiteOverviewAsync();
|
||||
},
|
||||
// Les compteurs cloud n'évoluent pas plus vite ; interroger davantage expose
|
||||
// à une limitation de débit sans rien gagner. Aligné sur l'intervalle du widget.
|
||||
cacheTtlMs: 5 * 60 * 1000,
|
||||
fallbackToStaleOnError: true,
|
||||
staleIfErrorTtlMs: 30 * 60 * 1000,
|
||||
});
|
||||
Reference in new issue
Block a user