From b668505ce1330e3b1de823a23d55ba8dd8bb8419 Mon Sep 17 00:00:00 2001 From: caballeto Date: Thu, 23 Apr 2026 19:36:46 +0200 Subject: [PATCH] fix(api): regen for typed TimingPhasesDto in HTTP check details MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Picks up the upstream mono fix (devhelmhq/mono#271) that replaces the misleading `Map` timing field on `Http` check details with a typed `TimingPhasesDto`. Before this regen the generated zod schema had: timing: z.record(z.object({}).partial().strict().nullable()).nullish() which would reject the actual snake_case integer payload (`dns_ms`, `tcp_ms`, …) coming from the API. After regen `timing` correctly references `TimingPhasesDto` with nullable int fields. Diff is fully mechanical (typegen + zodgen + descgen). All 870 unit tests pass. Made-with: Cursor --- docs/openapi/monitoring-api.json | 62 +++++++++++++++++++++++++++----- src/lib/api-zod.generated.ts | 14 +++++++- src/lib/api.generated.ts | 44 ++++++++++++++++++++--- 3 files changed, 107 insertions(+), 13 deletions(-) diff --git a/docs/openapi/monitoring-api.json b/docs/openapi/monitoring-api.json index ccd3413..d25734a 100644 --- a/docs/openapi/monitoring-api.json +++ b/docs/openapi/monitoring-api.json @@ -24474,14 +24474,12 @@ ] }, "timing": { - "type": "object", - "additionalProperties": { - "type": "object", - "description": "Request phase timing breakdown", - "nullable": true - }, - "description": "Request phase timing breakdown", - "nullable": true + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/TimingPhasesDto" + } + ] }, "bodyTruncated": { "type": "boolean", @@ -31653,6 +31651,54 @@ }, "description": "Event type to use for a test webhook delivery" }, + "TimingPhasesDto": { + "type": "object", + "properties": { + "dns_ms": { + "type": "integer", + "description": "DNS resolution time in milliseconds", + "format": "int32", + "nullable": true, + "example": 12 + }, + "tcp_ms": { + "type": "integer", + "description": "TCP connect time in milliseconds", + "format": "int32", + "nullable": true, + "example": 18 + }, + "tls_ms": { + "type": "integer", + "description": "TLS handshake time in milliseconds (null for plain HTTP)", + "format": "int32", + "nullable": true, + "example": 34 + }, + "ttfb_ms": { + "type": "integer", + "description": "Time to first response byte in milliseconds", + "format": "int32", + "nullable": true, + "example": 42 + }, + "download_ms": { + "type": "integer", + "description": "Response body download time in milliseconds", + "format": "int32", + "nullable": true, + "example": 8 + }, + "total_ms": { + "type": "integer", + "description": "Total wall-clock request time in milliseconds", + "format": "int32", + "nullable": true, + "example": 114 + } + }, + "description": "Per-phase HTTP request timing breakdown (milliseconds)" + }, "TlsInfoDto": { "type": "object", "properties": { diff --git a/src/lib/api-zod.generated.ts b/src/lib/api-zod.generated.ts index 9a50c15..bcc5c83 100644 --- a/src/lib/api-zod.generated.ts +++ b/src/lib/api-zod.generated.ts @@ -1511,10 +1511,21 @@ const TlsInfoDto = z }) .partial() .strict(); +const TimingPhasesDto = z + .object({ + dns_ms: z.number().int().nullable(), + tcp_ms: z.number().int().nullable(), + tls_ms: z.number().int().nullable(), + ttfb_ms: z.number().int().nullable(), + download_ms: z.number().int().nullable(), + total_ms: z.number().int().nullable(), + }) + .partial() + .strict(); const Http = z .object({ check_type: z.literal("http"), - timing: z.record(z.object({}).partial().strict().nullable()).nullish(), + timing: TimingPhasesDto.nullish(), bodyTruncated: z.boolean().nullish(), }) .strict(); @@ -3359,6 +3370,7 @@ export const schemas = { CategoryDto, ChartBucketDto, TlsInfoDto, + TimingPhasesDto, Http, Tcp, Icmp, diff --git a/src/lib/api.generated.ts b/src/lib/api.generated.ts index 03eed5b..bb7edce 100644 --- a/src/lib/api.generated.ts +++ b/src/lib/api.generated.ts @@ -3897,10 +3897,7 @@ export interface components { * @enum {string} */ check_type: "http"; - /** @description Request phase timing breakdown */ - timing?: { - [key: string]: Record | null; - } | null; + timing?: components["schemas"]["TimingPhasesDto"] | null; /** @description Whether the response body was truncated before storage */ bodyTruncated?: boolean | null; }; @@ -6696,6 +6693,45 @@ export interface components { /** @description Event type to simulate (e.g. monitor.created); null uses a default */ eventType?: string | null; }; + /** @description Per-phase HTTP request timing breakdown (milliseconds) */ + TimingPhasesDto: { + /** + * Format: int32 + * @description DNS resolution time in milliseconds + * @example 12 + */ + dns_ms?: number | null; + /** + * Format: int32 + * @description TCP connect time in milliseconds + * @example 18 + */ + tcp_ms?: number | null; + /** + * Format: int32 + * @description TLS handshake time in milliseconds (null for plain HTTP) + * @example 34 + */ + tls_ms?: number | null; + /** + * Format: int32 + * @description Time to first response byte in milliseconds + * @example 42 + */ + ttfb_ms?: number | null; + /** + * Format: int32 + * @description Response body download time in milliseconds + * @example 8 + */ + download_ms?: number | null; + /** + * Format: int32 + * @description Total wall-clock request time in milliseconds + * @example 114 + */ + total_ms?: number | null; + }; /** @description TLS/SSL certificate details for HTTPS targets */ TlsInfoDto: { /**