mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-21 22:52:19 +03:00
chore: remove unused settings fallback schema (#5368)
Integrated into release/v3.8.41 — dead-code removal (typecheck:core EXIT 0, 70 affected tests green, fabricated-docs clean). Thanks @JxnLexn.
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import {
|
||||
ACCOUNT_FALLBACK_STRATEGY_VALUES,
|
||||
ROUTING_STRATEGY_VALUES,
|
||||
} from "@/shared/constants/routingStrategies";
|
||||
import { ROUTING_STRATEGY_VALUES } from "@/shared/constants/routingStrategies";
|
||||
import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints";
|
||||
import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize";
|
||||
import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode";
|
||||
@@ -15,11 +12,6 @@ import {
|
||||
} from "@/shared/constants/upstreamHeaders";
|
||||
import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts";
|
||||
|
||||
// ──── Settings Schemas ────
|
||||
// FASE-01: Removed .passthrough() — only explicitly listed fields are accepted
|
||||
|
||||
export const settingsFallbackStrategySchema = z.enum(ACCOUNT_FALLBACK_STRATEGY_VALUES);
|
||||
|
||||
// Single source of truth: ../settingsSchemas (the schema the runtime settings route validates
|
||||
// against). Re-exported here so this modular barrel stays in exact lockstep — a divergent local
|
||||
// copy (introduced by the #3988 lossy modularization) silently dropped 40 fields while gaining a
|
||||
|
||||
@@ -2,6 +2,7 @@ import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { SETTINGS_FALLBACK_STRATEGY_VALUES } from "@/shared/constants/routingStrategies";
|
||||
import { updateSettingsSchema as settingsRouteSchema } from "@/shared/validation/settingsSchemas";
|
||||
import * as sharedSchemaModule from "@/shared/validation/schemas";
|
||||
import { updateSettingsSchema as sharedSettingsSchema } from "@/shared/validation/schemas";
|
||||
|
||||
for (const strategy of SETTINGS_FALLBACK_STRATEGY_VALUES) {
|
||||
@@ -23,6 +24,10 @@ test("settings schemas reject combo-only strategies as account fallback strategi
|
||||
}
|
||||
});
|
||||
|
||||
test("shared settings schema module omits the unused fallback strategy sub-schema export", () => {
|
||||
assert.equal("settingsFallbackStrategySchema" in sharedSchemaModule, false);
|
||||
});
|
||||
|
||||
test("settings schemas accept cooldown-aware retry knobs", () => {
|
||||
const payload = {
|
||||
requestRetry: 3,
|
||||
|
||||
Reference in New Issue
Block a user