@@ -6,9 +6,12 @@ import { z } from 'zod'
66import type { ASNListParams } from 'cloudflare/resources/radar/entities/asns.mjs'
77import type { TrafficAnomalyGetParams } from 'cloudflare/resources/radar/traffic-anomalies.mjs'
88
9- export const AsnParam = z . number ( ) . positive ( )
9+ export const AsnParam = z
10+ . number ( )
11+ . positive ( )
12+ . describe ( 'Autonomous System Number (ASN), must be a positive number.' )
1013
11- export const IpParam = z . string ( ) . ip ( )
14+ export const IpParam = z . string ( ) . ip ( ) . describe ( 'IPv4 or IPv6 address in standard notation.' )
1215
1316export const DateRangeParam : z . ZodType < TrafficAnomalyGetParams [ 'dateRange' ] > = z
1417 . string ( )
@@ -17,11 +20,19 @@ export const DateRangeParam: z.ZodType<TrafficAnomalyGetParams['dateRange']> = z
1720 / ^ ( ( ( [ 1 - 9 ] | [ 1 - 9 ] [ 0 - 9 ] | [ 1 - 2 ] [ 0 - 9 ] [ 0 - 9 ] | 3 [ 0 - 5 ] [ 0 - 9 ] | 3 6 [ 0 - 4 ] ) [ d ] ( c o n t r o l ) ? ) | ( ( [ 1 - 9 ] | [ 1 - 4 ] [ 0 - 9 ] | 5 [ 0 - 2 ] ) [ w ] ( c o n t r o l ) ? ) ) $ / ,
1821 'Invalid Date Range'
1922 )
23+ . describe (
24+ "Date range string in the format of 'Xd' or 'Xw', where X is a number of days (1–364) or weeks (1–52), optionally suffixed with 'control'."
25+ )
2026
21- //TODO use ".describe("...")"
27+ export const DateStartParam : z . ZodType < TrafficAnomalyGetParams [ 'dateStart' ] > = z
28+ . string ( )
29+ . datetime ( )
30+ . describe ( 'Start date in ISO 8601 format (e.g., 2023-04-01T00:00:00Z).' )
2231
23- export const DateStartParam : z . ZodType < TrafficAnomalyGetParams [ 'dateStart' ] > = z . string ( ) . datetime ( )
24- export const DateEndParam : z . ZodType < TrafficAnomalyGetParams [ 'dateEnd' ] > = z . string ( ) . datetime ( )
32+ export const DateEndParam : z . ZodType < TrafficAnomalyGetParams [ 'dateEnd' ] > = z
33+ . string ( )
34+ . datetime ( )
35+ . describe ( 'End date in ISO 8601 format (e.g., 2023-04-30T23:59:59Z).' )
2536
2637export const SingleLocationParam : z . ZodType < ASNListParams [ 'location' ] > = z
2738 . string ( )
@@ -30,7 +41,9 @@ export const SingleLocationParam: z.ZodType<ASNListParams['location']> = z
3041 'Invalid location code. Must be a valid alpha-2 location code (two letters, case insensitive).' ,
3142 } )
3243 . optional ( )
44+ . describe ( 'Optional alpha-2 country code (e.g., "US", "DE").' )
3345
3446export const AsOrderByParam : z . ZodType < ASNListParams [ 'orderBy' ] > = z
3547 . enum ( [ 'ASN' , 'POPULATION' ] )
3648 . optional ( )
49+ . describe ( 'Optional order by parameter: "ASN" or "POPULATION".' )
0 commit comments