mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 00:53:28 +00:00
refactor(config): share install record schema shape
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import path from "node:path";
|
||||
import { z } from "zod";
|
||||
import { InstallRecordShape } from "./zod-schema.installs.js";
|
||||
import { sensitive } from "./zod-schema.sensitive.js";
|
||||
|
||||
function isSafeRelativeModulePath(raw: string): boolean {
|
||||
@@ -96,12 +97,7 @@ const HookConfigSchema = z
|
||||
|
||||
const HookInstallRecordSchema = z
|
||||
.object({
|
||||
source: z.union([z.literal("npm"), z.literal("archive"), z.literal("path")]),
|
||||
spec: z.string().optional(),
|
||||
sourcePath: z.string().optional(),
|
||||
installPath: z.string().optional(),
|
||||
version: z.string().optional(),
|
||||
installedAt: z.string().optional(),
|
||||
...InstallRecordShape,
|
||||
hooks: z.array(z.string()).optional(),
|
||||
})
|
||||
.strict();
|
||||
|
||||
Reference in New Issue
Block a user