refactor(domain): own digest and prefixed identifier shapes in one module (#547)

This commit is contained in:
morluto
2026-10-05 17:29:20 +08:00
committed by GitHub
parent 828395d510
commit ea58834940
56 changed files with 314 additions and 162 deletions
+3 -2
View File
@@ -26,8 +26,9 @@ import {
jsonValueSchema,
type JsonValue,
} from "./jsonValue.js";
import { digestSchema } from "./../domain/digests.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
const digestSchema = z.string().regex(/^[a-f0-9]{64}$/u);
const architectureSchema = z.enum(["x86", "x86_64", "arm", "arm64"]);
const formatSchema = z.enum([
"analysis-database",
@@ -86,7 +87,7 @@ const bindingSchema = z
});
});
const entrySchema = z.object({
query_id: z.string().regex(/^query_[a-f0-9]{64}$/u),
query_id: prefixedDigestSchema("query"),
operation: z.string().min(1),
parameters: jsonObjectSchema,
execution: z.object({