feat(secret-sync): add PR suggestions for Zabbix secret sync

This commit is contained in:
Carlos Monastyrski
2025-07-02 10:18:20 -03:00
parent 307e6900ee
commit 9163da291e
5 changed files with 34 additions and 33 deletions
@@ -1,7 +1,7 @@
import { z } from "zod";
import { BaseSecretSyncSchema } from "@app/components/secret-syncs/forms/schemas/base-secret-sync-schema";
import { ZabbixSyncScope } from "@app/hooks/api/appConnections/zabbix";
import { ZabbixMacroType, ZabbixSyncScope } from "@app/hooks/api/appConnections/zabbix";
import { SecretSync } from "@app/hooks/api/secretSyncs";
export const ZabbixSyncDestinationSchema = BaseSecretSyncSchema().merge(
@@ -12,11 +12,15 @@ export const ZabbixSyncDestinationSchema = BaseSecretSyncSchema().merge(
scope: z.literal(ZabbixSyncScope.Host),
hostId: z.string().trim().min(1, "Host ID required"),
hostName: z.string().trim().min(1, "Host name required"),
macroType: z.number().min(0, "Macro type required").max(1, "Macro type required")
macroType: z.nativeEnum(ZabbixMacroType, {
errorMap: () => ({ message: "Macro type must be either 'text' or 'secret'" })
})
}),
z.object({
scope: z.literal(ZabbixSyncScope.Global),
macroType: z.number().min(0, "Macro type required").max(1, "Macro type required")
macroType: z.nativeEnum(ZabbixMacroType, {
errorMap: () => ({ message: "Macro type must be either 'text' or 'secret'" })
})
})
])
})