Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/shared/schemas/qdrant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,3 @@ export const QdrantHealthResultSchema = z.object({
latencyMs: z.number(),
error: z.string().optional(),
});

export type QdrantSettings = z.infer<typeof QdrantSettingsSchema>;
export type QdrantSettingsUpdate = z.infer<typeof QdrantSettingsUpdateSchema>;
export type QdrantSearch = z.infer<typeof QdrantSearchSchema>;
export type QdrantHealthResult = z.infer<typeof QdrantHealthResultSchema>;
35 changes: 35 additions & 0 deletions tests/unit/qdrant-schemas.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import test from "node:test";
import assert from "node:assert/strict";

import {
QdrantHealthResultSchema,
QdrantSearchSchema,
QdrantSettingsSchema,
QdrantSettingsUpdateSchema,
} from "../../src/shared/schemas/qdrant.ts";

test("qdrant schema module keeps runtime request and response schemas exported", () => {
assert.equal(typeof QdrantSettingsSchema.safeParse, "function");
assert.equal(typeof QdrantSettingsUpdateSchema.safeParse, "function");
assert.equal(typeof QdrantSearchSchema.safeParse, "function");
assert.equal(typeof QdrantHealthResultSchema.safeParse, "function");
});

test("QdrantSettingsUpdateSchema validates partial updates", () => {
const result = QdrantSettingsUpdateSchema.safeParse({
enabled: true,
host: "qdrant.local",
port: 6334,
});

assert.equal(result.success, true);
});

test("QdrantSearchSchema applies the default topK", () => {
const result = QdrantSearchSchema.safeParse({ query: "semantic search" });

assert.equal(result.success, true);
if (result.success) {
assert.equal(result.data.topK, 5);
}
});
Loading