Skip to main content

Function: createMonitorObject()

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

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

Create monitor object with proper field mapping and type safety.

Type Parametersโ€‹

TTypeโ€‹

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

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.