fix: resolve type errors from dev merge
- Fix URL/RequestInfo/RequestInit type conflicts with Node 24.18 - Fix optional repository.id type mismatch in releases router
This commit is contained in:
3 files changed
+7
-6
No files matched your search
@@ -78,10 +78,11 @@ export const releasesRouter = createTRPCRouter({
|
|||||||
return await Promise.all(
|
return await Promise.all(
|
||||||
input.repositories.map(async (repository) => {
|
input.repositories.map(async (repository) => {
|
||||||
try {
|
try {
|
||||||
const useToken = allowedRepoIds === null || allowedRepoIds.has(repository.id);
|
const repoId = repository.id ?? repository.identifier;
|
||||||
|
const useToken = allowedRepoIds === null || allowedRepoIds.has(repoId);
|
||||||
const response = await releasesRequestHandler
|
const response = await releasesRequestHandler
|
||||||
.handler({
|
.handler({
|
||||||
id: repository.id,
|
id: repoId,
|
||||||
provider: repository.provider,
|
provider: repository.provider,
|
||||||
identifier: repository.identifier,
|
identifier: repository.identifier,
|
||||||
versionRegex: formatVersionFilterRegex(repository.versionFilter),
|
versionRegex: formatVersionFilterRegex(repository.versionFilter),
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import { createLogger } from "@homarr/core/infrastructure/logs";
|
|||||||
const logger = createLogger({ module: "releaseProviders" });
|
const logger = createLogger({ module: "releaseProviders" });
|
||||||
|
|
||||||
const PROVIDER_TIMEOUT_MS = 10_000;
|
const PROVIDER_TIMEOUT_MS = 10_000;
|
||||||
const fetchProvider = (url: URL | RequestInfo, options?: RequestInit & { timeout?: number }) =>
|
const fetchProvider = (url: string, options?: RequestInit & { timeout?: number }) =>
|
||||||
fetchWithTrustedCertificatesAsync(url, { timeout: PROVIDER_TIMEOUT_MS, ...options });
|
fetchWithTrustedCertificatesAsync(url, { timeout: PROVIDER_TIMEOUT_MS, ...options } as Parameters<typeof fetchWithTrustedCertificatesAsync>[1]);
|
||||||
|
|
||||||
export interface ReleasesRepositoryRequest extends Record<string, unknown> {
|
export interface ReleasesRepositoryRequest extends Record<string, unknown> {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -127,7 +127,7 @@ const parseOwnerPackageName = (identifier: string) => {
|
|||||||
|
|
||||||
const removeTrailingSlash = (url: string) => url.replace(/\/$/, "");
|
const removeTrailingSlash = (url: string) => url.replace(/\/$/, "");
|
||||||
|
|
||||||
const buildUrl = (baseUrl: string, path: `/${string}`) => new URL(`${baseUrl}${path}`);
|
const buildUrl = (baseUrl: string, path: `/${string}`) => new URL(`${baseUrl}${path}`).toString();
|
||||||
|
|
||||||
const getGithubApi = (baseUrl: string, userAgent: string, token?: string) =>
|
const getGithubApi = (baseUrl: string, userAgent: string, token?: string) =>
|
||||||
new Octokit({
|
new Octokit({
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ const buildUrl = (baseUrl: string, path: `/${string}`, queryParams: Record<strin
|
|||||||
for (const [key, value] of Object.entries(queryParams)) {
|
for (const [key, value] of Object.entries(queryParams)) {
|
||||||
url.searchParams.set(key, value.toString());
|
url.searchParams.set(key, value.toString());
|
||||||
}
|
}
|
||||||
return url;
|
return url.toString();
|
||||||
};
|
};
|
||||||
|
|
||||||
const searchStationsAsync = async (baseUrl: string, query: string): Promise<Station[]> => {
|
const searchStationsAsync = async (baseUrl: string, query: string): Promise<Station[]> => {
|
||||||
|
|||||||
Reference in new issue
Block a user