mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-19 13:42:09 +03:00
chore(release): v3.7.5 — integrate remaining PRs and finalize stability
This commit is contained in:
35
patch2.js
Normal file
35
patch2.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const fs = require("fs");
|
||||
let file = fs.readFileSync("tests/unit/reasoning-cache.test.ts", "utf8");
|
||||
|
||||
// Replace the before/after blocks
|
||||
file = file.replace(
|
||||
/describe\("Reasoning Replay Cache — API Route", \(\) => {[\s\S]*?(?= it\("should return stats)/m,
|
||||
`describe("Reasoning Replay Cache — API Route", () => {
|
||||
before(() => {
|
||||
clearReasoningCacheAll();
|
||||
try {
|
||||
getDbInstance().prepare(
|
||||
"INSERT OR IGNORE INTO api_keys (key, name, role, is_active) VALUES ('test-admin-key', 'test', 'admin', 1)"
|
||||
).run();
|
||||
} catch (e) {}
|
||||
});
|
||||
|
||||
after(() => {
|
||||
clearReasoningCacheAll();
|
||||
try {
|
||||
getDbInstance().prepare("DELETE FROM api_keys WHERE key = 'test-admin-key'").run();
|
||||
} catch (e) {}
|
||||
});\n\n`
|
||||
);
|
||||
|
||||
// Add Headers
|
||||
file = file.replace(
|
||||
/new Request\("http:\/\/localhost\/api\/cache\/reasoning\?provider=deepseek"\)/g,
|
||||
'new Request("http://localhost/api/cache/reasoning?provider=deepseek", { headers: { Authorization: "Bearer test-admin-key" } })'
|
||||
);
|
||||
file = file.replace(
|
||||
/new Request\("http:\/\/localhost\/api\/cache\/reasoning\?toolCallId=call_api_delete_1"\)/g,
|
||||
'new Request("http://localhost/api/cache/reasoning?toolCallId=call_api_delete_1", { headers: { Authorization: "Bearer test-admin-key" } })'
|
||||
);
|
||||
|
||||
fs.writeFileSync("tests/unit/reasoning-cache.test.ts", file);
|
||||
Reference in New Issue
Block a user