mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-05-22 11:27:45 +00:00
21 lines
558 B
TypeScript
21 lines
558 B
TypeScript
import { validateProviderApiKey } from "./src/lib/providers/validation.ts";
|
|
|
|
globalThis.fetch = async () =>
|
|
new Response(JSON.stringify({ error: "Unauthorized" }), {
|
|
status: 401,
|
|
headers: { "content-type": "application/json" },
|
|
});
|
|
|
|
validateProviderApiKey({
|
|
provider: "bailian-coding-plan",
|
|
apiKey: "invalid-key",
|
|
providerSpecificData: {
|
|
baseUrl: "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic/v1",
|
|
},
|
|
})
|
|
.then((res) => {
|
|
console.log("Result:", res);
|
|
})
|
|
.catch((err) => {
|
|
console.error("Error:", err);
|
|
});
|