Skip to main content

Function: createMonitorObject()

createMonitorObject<TType>(type: TType, fields: PartialMonitorFormDataByType<TType>): MonitorCreationData & Partial<TypedMonitorFormData<TType>>

Defined in: src/utils/monitorValidation.ts:196

Create monitor object with proper field mapping and type safety.

Type Parametersโ€‹

TTypeโ€‹

TType extends "http" | "http-keyword" | "http-status" | "http-header" | "http-json" | "http-latency" | "port" | "ping" | "dns" | "ssl" | "websocket-keepalive" | "server-heartbeat" | "replication" | "cdn-edge-consistency"

Monitor type literal for the monitor being constructed.

Parametersโ€‹

typeโ€‹

TType

Monitor type.

fieldsโ€‹

PartialMonitorFormDataByType<TType>

Field values to merge with defaults.

Returnsโ€‹

MonitorCreationData & Partial<TypedMonitorFormData<TType>>

Monitor creation data with type-specific fields and guaranteed required fields.