feat: Tracearr integration (#5060)

This commit is contained in:
StrandedTurtle authored and GitHub committed 2026-03-13 19:19:43 +01:00
1 parent d3c2ad134f
commit f68600150a
22 files changed
+1095 -3

No files matched your search

@@ -41,6 +41,7 @@ import { ProwlarrIntegration } from "../prowlarr/prowlarr-integration";
import { ProxmoxIntegration } from "../proxmox/proxmox-integration";
import { QuayIntegration } from "../quay/quay-integration";
import { SeerrIntegration } from "../seerr/seerr-integration";
import { TracearrIntegration } from "../tracearr/tracearr-integration";
import { TrueNasIntegration } from "../truenas/truenas-integration";
import { UnifiControllerIntegration } from "../unifi-controller/unifi-controller-integration";
import { UnraidIntegration } from "../unraid/unraid-integration";
@@ -111,6 +112,7 @@ export const integrationCreators = {
truenas: TrueNasIntegration,
unraid: UnraidIntegration,
coolify: CoolifyIntegration,
tracearr: TracearrIntegration,
glances: GlancesIntegration,
immich: ImmichIntegration,
} satisfies Record<IntegrationKind, IntegrationInstance | [(input: IntegrationInput) => Promise<Integration>]>;
@@ -58,24 +58,30 @@ export abstract class Integration {
private createUrl(
inputUrl: string,
path: `/${string}`,
queryParams?: Record<string, string | Date | number | boolean>,
queryParams?: Record<string, string | Date | number | boolean | null | undefined>,
) {
const baseUrl = removeTrailingSlash(inputUrl);
const url = new URL(`${baseUrl}${path}`);
if (queryParams) {
for (const [key, value] of Object.entries(queryParams)) {
if (value === null || value === undefined) {
continue;
}
url.searchParams.set(key, value instanceof Date ? value.toISOString() : value.toString());
}
}
return url;
}
protected url(path: `/${string}`, queryParams?: Record<string, string | Date | number | boolean>) {
protected url(path: `/${string}`, queryParams?: Record<string, string | Date | number | boolean | null | undefined>) {
return this.createUrl(this.integration.url, path, queryParams);
}
protected externalUrl(path: `/${string}`, queryParams?: Record<string, string | Date | number | boolean>) {
protected externalUrl(
path: `/${string}`,
queryParams?: Record<string, string | Date | number | boolean | null | undefined>,
) {
return this.createUrl(this.integration.externalUrl ?? this.integration.url, path, queryParams);
}