mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-04 14:22:09 +03:00
chore: drop unused validation schema exports (#5322)
Verified dead-code removal: merged result passes typecheck:core + 194 affected unit tests + ESLint clean. Integrated into release/v3.8.41. Thanks @JxnLexn for the cleanup!
This commit is contained in:
@@ -37,5 +37,3 @@ export const ScrapeResultSchema = z.object({
|
||||
screenshot_url: z.string().nullable(),
|
||||
});
|
||||
export type ScrapeResult = z.infer<typeof ScrapeResultSchema>;
|
||||
|
||||
export const SearchProviderCatalogResponseSchemaFull = SearchProviderCatalogResponseSchema;
|
||||
|
||||
@@ -407,10 +407,3 @@ export const databaseSettingsSchema = z
|
||||
// Skip location and stats as they're read-only
|
||||
})
|
||||
.strict();
|
||||
|
||||
export type DatabaseSettingsSchema = z.infer<typeof databaseSettingsSchema>;
|
||||
|
||||
export const featureFlagUpdateSchema = z.object({
|
||||
key: z.string().min(1),
|
||||
value: z.string().optional(),
|
||||
});
|
||||
|
||||
@@ -418,3 +418,12 @@ describe("featureFlagUpdateSchema validation", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("settings schema public surface", () => {
|
||||
it("uses databaseSettingsSchema as the canonical database settings export", async () => {
|
||||
const settingsSchemas = await import("../../src/shared/validation/settingsSchemas.ts");
|
||||
assert.equal("DatabaseSettingsSchema" in settingsSchemas, false);
|
||||
assert.equal("featureFlagUpdateSchema" in settingsSchemas, false);
|
||||
assert.equal(typeof settingsSchemas.databaseSettingsSchema.safeParse, "function");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@ import { ZodError } from "zod";
|
||||
|
||||
const { SearchProviderCatalogItemSchema, SearchProviderCatalogResponseSchema, ScrapeResultSchema } =
|
||||
await import("../../src/shared/schemas/searchTools.ts");
|
||||
const searchToolsModule = await import("../../src/shared/schemas/searchTools.ts");
|
||||
|
||||
// ── SearchProviderCatalogItemSchema ───────────────────────────────────────────
|
||||
|
||||
@@ -160,6 +161,11 @@ test("SearchProviderCatalogResponseSchema: invalid — providers not array", ()
|
||||
assert.ok(!result.success, "non-array providers should fail");
|
||||
});
|
||||
|
||||
test("SearchProviderCatalogResponseSchemaFull alias is not exported", () => {
|
||||
assert.equal("SearchProviderCatalogResponseSchemaFull" in searchToolsModule, false);
|
||||
assert.equal(typeof searchToolsModule.SearchProviderCatalogResponseSchema.safeParse, "function");
|
||||
});
|
||||
|
||||
// ── ScrapeResultSchema ────────────────────────────────────────────────────────
|
||||
|
||||
test("ScrapeResultSchema: valid scrape result parses", () => {
|
||||
|
||||
Reference in New Issue
Block a user