chore: remove unused provider types (#5393)

Integrated into release/v3.8.42
This commit is contained in:
Jan Leon
2026-06-30 00:14:30 +02:00
committed by GitHub
parent 34510fb8d4
commit 44757af4cb
3 changed files with 11 additions and 32 deletions

View File

@@ -5,7 +5,7 @@
* Import from "@/types" in any file.
*/
export type { ProviderConnection, ProviderNode, ModelCooldownErrorPayload } from "./provider";
export type { ModelCooldownErrorPayload } from "./provider";
export type { ApiKey } from "./apiKey";
export type { UsageEntry, UsageStats, ProviderUsageStats, ModelUsageStats, CallLog } from "./usage";
export type { DatabaseSettings } from "./databaseSettings";

View File

@@ -1,34 +1,3 @@
/**
* Provider connection — a configured cloud AI provider account.
*/
export interface ProviderConnection {
id: string;
provider: string;
label: string;
url: string;
apiKey?: string;
oauthToken?: string;
oauthRefreshToken?: string;
oauthExpiresAt?: string;
isActive: boolean;
priority: number;
createdAt: string;
updatedAt: string;
}
/**
* Provider node — a specific endpoint within a provider.
*/
export interface ProviderNode {
id: string;
connectionId: string;
provider: string;
model: string;
baseUrl: string;
isActive: boolean;
priority: number;
}
export interface ModelCooldownErrorPayload {
error: {
message: string;

View File

@@ -18,6 +18,9 @@ const mappingsRoute = await import("../../src/app/api/model-combo-mappings/route
const mappingsIdRoute = await import("../../src/app/api/model-combo-mappings/[id]/route.ts");
const syncTokens = await import("../../src/lib/sync/tokens.ts");
const repoRoot = path.resolve(import.meta.dirname, "../..");
const read = (relPath: string) => fs.readFileSync(path.join(repoRoot, relPath), "utf8");
function makeRequest(url: string, options: { method?: string; body?: unknown } = {}) {
const { method = "GET", body } = options;
return new Request(url, {
@@ -240,6 +243,13 @@ test("buildErrorBody never exposes stack traces in its message", async () => {
assert.ok(!body.error.message.includes("at /opt"));
});
test("types barrel keeps the model cooldown payload export only", async () => {
const src = await read("src/types/index.ts");
assert.match(src, /ModelCooldownErrorPayload/);
assert.doesNotMatch(src, /ProviderConnection/);
assert.doesNotMatch(src, /ProviderNode/);
});
// ── sanitizeUpstreamDetails ──────────────────────────────────────────────────
test("sanitizeUpstreamDetails — basic pass-through for safe fields", async () => {