mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
fix(xiaomi-tokenplan): region selector, key validation, multi-connection (#2251)
- Add top-level regions array so Add/Edit modals render region <Select> - EditConnectionModal: load/persist region generically for region-aware providers - validate: accept 403 for xiaomi-tokenplan valid keys, add 8s fetch timeout - Remove single-connection guard for compatible/embedding nodes Co-authored-by: MiQieR <122154116+MiQieR@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
decolua
co-authored by
Cursor
parent
ce6120ce7b
commit
9102c4c6d8
@@ -145,26 +145,25 @@ describe("compatible provider connections API", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("returns 400 for a duplicate connection on the same compatible node", async () => {
|
||||
it("allows multiple connections on the same compatible node", async () => {
|
||||
const ctx = await setupTestContext({
|
||||
id: "openai-compatible-duplicate-test",
|
||||
id: "openai-compatible-multiple-test",
|
||||
type: "openai-compatible",
|
||||
name: "Duplicate Guard Node",
|
||||
prefix: "dup",
|
||||
name: "Multiple Connections Node",
|
||||
prefix: "mul",
|
||||
apiType: "chat",
|
||||
baseUrl: "https://duplicate-guard.test/v1",
|
||||
baseUrl: "https://multiple-connections.test/v1",
|
||||
});
|
||||
cleanup = ctx.cleanup;
|
||||
|
||||
const firstResponse = await ctx.POST(makeRequest(ctx.node.id));
|
||||
const secondResponse = await ctx.POST(makeRequest(ctx.node.id));
|
||||
const secondBody = await secondResponse.json();
|
||||
const storedConnections = await ctx.getProviderConnections({ provider: ctx.node.id });
|
||||
|
||||
expect(firstResponse.status).toBe(201);
|
||||
expect(secondResponse.status).toBe(400);
|
||||
expect(secondBody.error).toContain("Only one connection is allowed");
|
||||
expect(storedConnections).toHaveLength(1);
|
||||
expect(secondResponse.status).toBe(201);
|
||||
expect(storedConnections).toHaveLength(2);
|
||||
expectCompatibleConnection(storedConnections[0], ctx.node, { apiType: "chat" });
|
||||
expectCompatibleConnection(storedConnections[1], ctx.node, { apiType: "chat" });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user