18 lines
669 B
TypeScript
18 lines
669 B
TypeScript
import type { IntegrationKindByCategory } from "@homarr/definitions";
|
|
import { createIntegrationAsync } from "@homarr/integrations/factory";
|
|
import type { UpsSummary } from "@homarr/integrations/types";
|
|
|
|
import { createIntegrationRequestHandler } from "./lib/integration-request-handler";
|
|
|
|
export const upsSummariesRequestHandler = createIntegrationRequestHandler<
|
|
UpsSummary[],
|
|
IntegrationKindByCategory<"ups">,
|
|
Record<string, never>
|
|
>({
|
|
cacheNamespace: "ups:summaries",
|
|
async requestAsync(integration, _input) {
|
|
const integrationInstance = await createIntegrationAsync(integration);
|
|
return await integrationInstance.getUpsSummariesAsync();
|
|
},
|
|
});
|