mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-03 05:45:04 +03:00
chore: remove unused provider types (#5393)
Integrated into release/v3.8.42
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user