mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
fix: use z.union instead of z.intersection for health check schema
This commit is contained in:
@@ -10,6 +10,11 @@ const matchJsProcedure = z.object({
|
|||||||
const matchProcedure = z.union([matchDockerProcedure, matchJsProcedure])
|
const matchProcedure = z.union([matchDockerProcedure, matchJsProcedure])
|
||||||
export type Procedure = z.infer<typeof matchProcedure>
|
export type Procedure = z.infer<typeof matchProcedure>
|
||||||
|
|
||||||
|
const healthCheckFields = {
|
||||||
|
name: z.string(),
|
||||||
|
"success-message": z.string().nullable().optional(),
|
||||||
|
}
|
||||||
|
|
||||||
const matchAction = z.object({
|
const matchAction = z.object({
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
description: z.string(),
|
description: z.string(),
|
||||||
@@ -32,13 +37,10 @@ export const matchManifest = z.object({
|
|||||||
.optional(),
|
.optional(),
|
||||||
"health-checks": z.record(
|
"health-checks": z.record(
|
||||||
z.string(),
|
z.string(),
|
||||||
z.intersection(
|
z.union([
|
||||||
matchProcedure,
|
matchDockerProcedure.extend(healthCheckFields),
|
||||||
z.object({
|
matchJsProcedure.extend(healthCheckFields),
|
||||||
name: z.string(),
|
]),
|
||||||
"success-message": z.string().nullable().optional(),
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
config: z
|
config: z
|
||||||
.object({
|
.object({
|
||||||
|
|||||||
Reference in New Issue
Block a user