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:
Jan Leon
2026-06-29 15:06:37 +02:00
committed by GitHub
parent e0bfd509cf
commit 8d56238685
4 changed files with 15 additions and 9 deletions

View File

@@ -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;

View File

@@ -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(),
});

View File

@@ -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");
});
});

View File

@@ -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", () => {