From d1fdd6bc8cb028eb1114c12efea6025b1d607bb3 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Fri, 15 Aug 2025 17:14:28 -0500 Subject: [PATCH 1/6] bump zod to latest v3, which includes v4 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 579782627a..bcb3cae770 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "tunnel-rat": "^0.1.2", "use-debounce": "^10.0.4", "uuid": "^10.0.0", - "zod": "^3.24.3", + "zod": "^3.25.76", "zustand": "^5.0.3" }, "devDependencies": { @@ -15261,9 +15261,9 @@ } }, "node_modules/zod": { - "version": "3.24.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.3.tgz", - "integrity": "sha512-HhY1oqzWCQWuUqvBFnsyrtZRhyPeR7SUGv+C4+MsisMuVfSPx8HpwWqH8tRahSlt6M3PiFAcoeFhZAqIXTxoSg==", + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/package.json b/package.json index 6f6f30b306..dd0f998723 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "tunnel-rat": "^0.1.2", "use-debounce": "^10.0.4", "uuid": "^10.0.0", - "zod": "^3.24.3", + "zod": "^3.25.76", "zustand": "^5.0.3" }, "devDependencies": { From 260859951475e1ea83944fec1b6fdb0223d75235 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Fri, 15 Aug 2025 17:14:28 -0500 Subject: [PATCH 2/6] zod v4 again --- app/api/__generated__/Api.ts | 173 ++++- app/api/__generated__/msw-handlers.ts | 17 +- app/api/__generated__/validate.ts | 907 ++++++++++++++++---------- 3 files changed, 708 insertions(+), 389 deletions(-) diff --git a/app/api/__generated__/Api.ts b/app/api/__generated__/Api.ts index 2580835b4f..dd14a4ad8a 100644 --- a/app/api/__generated__/Api.ts +++ b/app/api/__generated__/Api.ts @@ -272,7 +272,10 @@ export type AffinityGroupResultsPage = { /** * Updateable properties of an `AffinityGroup` */ -export type AffinityGroupUpdate = { description?: string | null; name?: Name | null } +export type AffinityGroupUpdate = { + description?: string | null + name?: Name | null +} export type BgpMessageHistory = Record @@ -611,7 +614,10 @@ export type AntiAffinityGroupResultsPage = { /** * Updateable properties of an `AntiAffinityGroup` */ -export type AntiAffinityGroupUpdate = { description?: string | null; name?: Name | null } +export type AntiAffinityGroupUpdate = { + description?: string | null + name?: Name | null +} /** * An identifier for an artifact. @@ -2120,7 +2126,10 @@ export type FloatingIpResultsPage = { /** * Updateable identity-related parameters */ -export type FloatingIpUpdate = { description?: string | null; name?: Name | null } +export type FloatingIpUpdate = { + description?: string | null + name?: Name | null +} /** * View of a Group @@ -2253,7 +2262,10 @@ export type ImageResultsPage = { /** * Parameters for importing blocks with a bulk write */ -export type ImportBlocksBulkWrite = { base64EncodedData: string; offset: number } +export type ImportBlocksBulkWrite = { + base64EncodedData: string + offset: number +} /** * A policy determining when an instance should be automatically restarted by the control plane. @@ -3053,7 +3065,11 @@ export type Values = { /** * Timepoints and values for one timeseries. */ -export type Points = { startTimes?: Date[] | null; timestamps: Date[]; values: Values[] } +export type Points = { + startTimes?: Date[] | null + timestamps: Date[] + values: Values[] +} /** * A timeseries contains a timestamped set of values from one source. @@ -4480,7 +4496,11 @@ export type TufRepoInsertResponse = { /** * A sled that has not been added to an initialized rack yet */ -export type UninitializedSled = { baseboard: Baseboard; cubby: number; rackId: string } +export type UninitializedSled = { + baseboard: Baseboard + cubby: number + rackId: string +} /** * The unique hardware ID for a sled @@ -4597,7 +4617,10 @@ export type UserResultsPage = { /** * Credentials for local user login */ -export type UsernamePasswordCredentials = { password: Password; username: UserId } +export type UsernamePasswordCredentials = { + password: Password + username: UserId +} /** * View of the current silo's resource utilization and capacity @@ -4646,7 +4669,10 @@ All IPv6 subnets created from this VPC must be taken from this range, which shou name: Name } -export type VpcFirewallIcmpFilter = { code?: IcmpParamRange | null; icmpType: number } +export type VpcFirewallIcmpFilter = { + code?: IcmpParamRange | null + icmpType: number +} export type VpcFirewallRuleAction = 'allow' | 'deny' @@ -4815,7 +4841,10 @@ export type VpcRouterResultsPage = { /** * Updateable properties of a `VpcRouter` */ -export type VpcRouterUpdate = { description?: string | null; name?: Name | null } +export type VpcRouterUpdate = { + description?: string | null + name?: Name | null +} /** * A VPC subnet represents a logical grouping for instances that allows network traffic between them, within a IPv4 subnetwork or optionally an IPv6 subnetwork. @@ -6800,7 +6829,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: AffinityGroupViewPathParams; query?: AffinityGroupViewQueryParams }, + }: { + path: AffinityGroupViewPathParams + query?: AffinityGroupViewQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -6840,7 +6872,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: AffinityGroupDeletePathParams; query?: AffinityGroupDeleteQueryParams }, + }: { + path: AffinityGroupDeletePathParams + query?: AffinityGroupDeleteQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -6991,7 +7026,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: AlertDeliveryListPathParams; query?: AlertDeliveryListQueryParams }, + }: { + path: AlertDeliveryListPathParams + query?: AlertDeliveryListQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -7008,7 +7046,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: AlertReceiverProbePathParams; query?: AlertReceiverProbeQueryParams }, + }: { + path: AlertReceiverProbePathParams + query?: AlertReceiverProbeQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -7025,7 +7066,10 @@ export class Api extends HttpClient { { path, body, - }: { path: AlertReceiverSubscriptionAddPathParams; body: AlertSubscriptionCreate }, + }: { + path: AlertReceiverSubscriptionAddPathParams + body: AlertSubscriptionCreate + }, params: FetchParams = {} ) => { return this.request({ @@ -7055,7 +7099,10 @@ export class Api extends HttpClient { { path, query, - }: { path: AlertDeliveryResendPathParams; query: AlertDeliveryResendQueryParams }, + }: { + path: AlertDeliveryResendPathParams + query: AlertDeliveryResendQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -7086,7 +7133,10 @@ export class Api extends HttpClient { { query, body, - }: { query: AntiAffinityGroupCreateQueryParams; body: AntiAffinityGroupCreate }, + }: { + query: AntiAffinityGroupCreateQueryParams + body: AntiAffinityGroupCreate + }, params: FetchParams = {} ) => { return this.request({ @@ -7537,7 +7587,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: FloatingIpDeletePathParams; query?: FloatingIpDeleteQueryParams }, + }: { + path: FloatingIpDeletePathParams + query?: FloatingIpDeleteQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -7577,7 +7630,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: FloatingIpDetachPathParams; query?: FloatingIpDetachQueryParams }, + }: { + path: FloatingIpDetachPathParams + query?: FloatingIpDetachQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -7832,7 +7888,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: InstanceDiskListPathParams; query?: InstanceDiskListQueryParams }, + }: { + path: InstanceDiskListPathParams + query?: InstanceDiskListQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -8173,7 +8232,10 @@ export class Api extends HttpClient { { query, body, - }: { query: InternetGatewayCreateQueryParams; body: InternetGatewayCreate }, + }: { + query: InternetGatewayCreateQueryParams + body: InternetGatewayCreate + }, params: FetchParams = {} ) => { return this.request({ @@ -8191,7 +8253,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: InternetGatewayViewPathParams; query?: InternetGatewayViewQueryParams }, + }: { + path: InternetGatewayViewPathParams + query?: InternetGatewayViewQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -8799,7 +8864,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: SledPhysicalDiskListPathParams; query?: SledPhysicalDiskListQueryParams }, + }: { + path: SledPhysicalDiskListPathParams + query?: SledPhysicalDiskListQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -8816,7 +8884,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: SledInstanceListPathParams; query?: SledInstanceListQueryParams }, + }: { + path: SledInstanceListPathParams + query?: SledInstanceListQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -8833,7 +8904,10 @@ export class Api extends HttpClient { { path, body, - }: { path: SledSetProvisionPolicyPathParams; body: SledProvisionPolicyParams }, + }: { + path: SledSetProvisionPolicyPathParams + body: SledProvisionPolicyParams + }, params: FetchParams = {} ) => { return this.request({ @@ -9037,7 +9111,10 @@ export class Api extends HttpClient { { path, query, - }: { path: LocalIdpUserDeletePathParams; query: LocalIdpUserDeleteQueryParams }, + }: { + path: LocalIdpUserDeletePathParams + query: LocalIdpUserDeleteQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -9077,7 +9154,10 @@ export class Api extends HttpClient { { query, body, - }: { query: SamlIdentityProviderCreateQueryParams; body: SamlIdentityProviderCreate }, + }: { + query: SamlIdentityProviderCreateQueryParams + body: SamlIdentityProviderCreate + }, params: FetchParams = {} ) => { return this.request({ @@ -9177,7 +9257,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: IpPoolRangeListPathParams; query?: IpPoolRangeListQueryParams }, + }: { + path: IpPoolRangeListPathParams + query?: IpPoolRangeListQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -10171,7 +10254,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: UserSessionListPathParams; query?: UserSessionListQueryParams }, + }: { + path: UserSessionListPathParams + query?: UserSessionListQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -10212,7 +10298,10 @@ export class Api extends HttpClient { { query, body, - }: { query: VpcFirewallRulesUpdateQueryParams; body: VpcFirewallRuleUpdateParams }, + }: { + query: VpcFirewallRulesUpdateQueryParams + body: VpcFirewallRuleUpdateParams + }, params: FetchParams = {} ) => { return this.request({ @@ -10259,7 +10348,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: VpcRouterRouteViewPathParams; query?: VpcRouterRouteViewQueryParams }, + }: { + path: VpcRouterRouteViewPathParams + query?: VpcRouterRouteViewQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -10299,7 +10391,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: VpcRouterRouteDeletePathParams; query?: VpcRouterRouteDeleteQueryParams }, + }: { + path: VpcRouterRouteDeletePathParams + query?: VpcRouterRouteDeleteQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -10385,7 +10480,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: VpcRouterDeletePathParams; query?: VpcRouterDeleteQueryParams }, + }: { + path: VpcRouterDeletePathParams + query?: VpcRouterDeleteQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -10471,7 +10569,10 @@ export class Api extends HttpClient { { path, query = {}, - }: { path: VpcSubnetDeletePathParams; query?: VpcSubnetDeleteQueryParams }, + }: { + path: VpcSubnetDeletePathParams + query?: VpcSubnetDeleteQueryParams + }, params: FetchParams = {} ) => { return this.request({ @@ -10549,7 +10650,11 @@ export class Api extends HttpClient { path, query = {}, body, - }: { path: VpcUpdatePathParams; query?: VpcUpdateQueryParams; body: VpcUpdate }, + }: { + path: VpcUpdatePathParams + query?: VpcUpdateQueryParams + body: VpcUpdate + }, params: FetchParams = {} ) => { return this.request({ diff --git a/app/api/__generated__/msw-handlers.ts b/app/api/__generated__/msw-handlers.ts index 0c05bee04d..9964f13654 100644 --- a/app/api/__generated__/msw-handlers.ts +++ b/app/api/__generated__/msw-handlers.ts @@ -1,11 +1,3 @@ -/** - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at https://mozilla.org/MPL/2.0/. - * - * Copyright Oxide Computer Company - */ - import { http, HttpResponse, @@ -14,7 +6,7 @@ import { type StrictResponse, } from 'msw' import type { Promisable, SnakeCasedPropertiesDeep as Snakify } from 'type-fest' -import { type ZodSchema } from 'zod' +import { type ZodType } from 'zod/v4' import type * as Api from './Api' import { snakeify } from './util' @@ -1808,7 +1800,7 @@ export interface MSWHandlers { }) => Promisable } -function validateParams( +function validateParams( schema: S, req: Request, pathParams: PathParams @@ -1841,8 +1833,9 @@ function validateParams( const handler = ( handler: MSWHandlers[keyof MSWHandlers], - paramSchema: ZodSchema | null, - bodySchema: ZodSchema | null + // eslint-disable-next-line @typescript-eslint/no-explicit-any + paramSchema: ZodType | null, + bodySchema: ZodType | null ) => async ({ request: req, diff --git a/app/api/__generated__/validate.ts b/app/api/__generated__/validate.ts index 3837132a8d..b872e93a23 100644 --- a/app/api/__generated__/validate.ts +++ b/app/api/__generated__/validate.ts @@ -1,14 +1,6 @@ -/** - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at https://mozilla.org/MPL/2.0/. - * - * Copyright Oxide Computer Company - */ - /* eslint-disable */ -import { z, ZodType } from 'zod' +import { z, ZodType } from 'zod/v4' import { processResponseBody, uniqueItems } from './util' @@ -71,10 +63,7 @@ export const Name = z.preprocess( ) ) -export const NameOrId = z.preprocess( - processResponseBody, - z.union([z.string().uuid(), Name]) -) +export const NameOrId = z.preprocess(processResponseBody, z.union([z.uuid(), Name])) /** * An address tied to an address lot. @@ -108,7 +97,7 @@ export const AddressLot = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), + id: z.uuid(), kind: AddressLotKind, name: Name, timeCreated: z.coerce.date(), @@ -121,11 +110,7 @@ export const AddressLot = z.preprocess( */ export const AddressLotBlock = z.preprocess( processResponseBody, - z.object({ - firstAddress: z.string().ip(), - id: z.string().uuid(), - lastAddress: z.string().ip(), - }) + z.object({ firstAddress: z.ipv4(), id: z.uuid(), lastAddress: z.ipv4() }) ) /** @@ -133,7 +118,7 @@ export const AddressLotBlock = z.preprocess( */ export const AddressLotBlockCreate = z.preprocess( processResponseBody, - z.object({ firstAddress: z.string().ip(), lastAddress: z.string().ip() }) + z.object({ firstAddress: z.ipv4(), lastAddress: z.ipv4() }) ) /** @@ -141,7 +126,10 @@ export const AddressLotBlockCreate = z.preprocess( */ export const AddressLotBlockResultsPage = z.preprocess( processResponseBody, - z.object({ items: AddressLotBlock.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: AddressLotBlock.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -170,7 +158,10 @@ export const AddressLotCreateResponse = z.preprocess( */ export const AddressLotResultsPage = z.preprocess( processResponseBody, - z.object({ items: AddressLot.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: AddressLot.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -193,10 +184,10 @@ export const AffinityGroup = z.preprocess( z.object({ description: z.string(), failureDomain: FailureDomain, - id: z.string().uuid(), + id: z.uuid(), name: Name, policy: AffinityPolicy, - projectId: z.string().uuid(), + projectId: z.uuid(), timeCreated: z.coerce.date(), timeModified: z.coerce.date(), }) @@ -215,7 +206,7 @@ export const AffinityGroupCreate = z.preprocess( }) ) -export const TypedUuidForInstanceKind = z.preprocess(processResponseBody, z.string().uuid()) +export const TypedUuidForInstanceKind = z.preprocess(processResponseBody, z.uuid()) /** * Running state of an Instance (primarily: booted or stopped) @@ -249,7 +240,11 @@ export const AffinityGroupMember = z.preprocess( processResponseBody, z.object({ type: z.enum(['instance']), - value: z.object({ id: TypedUuidForInstanceKind, name: Name, runState: InstanceState }), + value: z.object({ + id: TypedUuidForInstanceKind, + name: Name, + runState: InstanceState, + }), }) ) @@ -269,7 +264,10 @@ export const AffinityGroupMemberResultsPage = z.preprocess( */ export const AffinityGroupResultsPage = z.preprocess( processResponseBody, - z.object({ items: AffinityGroup.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: AffinityGroup.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -283,7 +281,10 @@ export const AffinityGroupUpdate = z.preprocess( }) ) -export const BgpMessageHistory = z.preprocess(processResponseBody, z.record(z.unknown())) +export const BgpMessageHistory = z.preprocess( + processResponseBody, + z.record(z.string(), z.unknown()) +) /** * Identifies switch physical location @@ -299,7 +300,7 @@ export const SwitchLocation = z.preprocess( export const SwitchBgpHistory = z.preprocess( processResponseBody, z.object({ - history: z.record(z.string().min(1), BgpMessageHistory), + history: z.record(z.string(), BgpMessageHistory), switch: SwitchLocation, }) ) @@ -325,17 +326,23 @@ export const AlertClass = z.preprocess( */ export const AlertClassResultsPage = z.preprocess( processResponseBody, - z.object({ items: AlertClass.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: AlertClass.array(), + nextPage: z.string().nullable().optional(), + }) ) -export const TypedUuidForAlertKind = z.preprocess(processResponseBody, z.string().uuid()) +export const TypedUuidForAlertKind = z.preprocess(processResponseBody, z.uuid()) /** * The response received from a webhook receiver endpoint. */ export const WebhookDeliveryResponse = z.preprocess( processResponseBody, - z.object({ durationMs: z.number().min(0), status: z.number().min(0).max(65535) }) + z.object({ + durationMs: z.number().min(0), + status: z.number().min(0).max(65535), + }) ) export const WebhookDeliveryAttemptResult = z.preprocess( @@ -368,10 +375,7 @@ export const AlertDeliveryAttempts = z.preprocess( z.object({ webhook: WebhookDeliveryAttempt.array() }) ) -export const TypedUuidForAlertReceiverKind = z.preprocess( - processResponseBody, - z.string().uuid() -) +export const TypedUuidForAlertReceiverKind = z.preprocess(processResponseBody, z.uuid()) /** * The state of a webhook delivery attempt. @@ -398,7 +402,7 @@ export const AlertDelivery = z.preprocess( alertClass: z.string(), alertId: TypedUuidForAlertKind, attempts: AlertDeliveryAttempts, - id: z.string().uuid(), + id: z.uuid(), receiverId: TypedUuidForAlertReceiverKind, state: AlertDeliveryState, timeStarted: z.coerce.date(), @@ -408,7 +412,7 @@ export const AlertDelivery = z.preprocess( export const AlertDeliveryId = z.preprocess( processResponseBody, - z.object({ deliveryId: z.string().uuid() }) + z.object({ deliveryId: z.uuid() }) ) /** @@ -416,7 +420,10 @@ export const AlertDeliveryId = z.preprocess( */ export const AlertDeliveryResultsPage = z.preprocess( processResponseBody, - z.object({ items: AlertDelivery.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: AlertDelivery.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -437,7 +444,7 @@ export const AlertProbeResult = z.preprocess( */ export const WebhookSecret = z.preprocess( processResponseBody, - z.object({ id: z.string().uuid(), timeCreated: z.coerce.date() }) + z.object({ id: z.uuid(), timeCreated: z.coerce.date() }) ) /** @@ -469,7 +476,7 @@ export const AlertReceiver = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), + id: z.uuid(), kind: AlertReceiverKind, name: Name, subscriptions: AlertSubscription.array(), @@ -483,7 +490,10 @@ export const AlertReceiver = z.preprocess( */ export const AlertReceiverResultsPage = z.preprocess( processResponseBody, - z.object({ items: AlertReceiver.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: AlertReceiver.array(), + nextPage: z.string().nullable().optional(), + }) ) export const AlertSubscriptionCreate = z.preprocess( @@ -535,10 +545,10 @@ export const AntiAffinityGroup = z.preprocess( z.object({ description: z.string(), failureDomain: FailureDomain, - id: z.string().uuid(), + id: z.uuid(), name: Name, policy: AffinityPolicy, - projectId: z.string().uuid(), + projectId: z.uuid(), timeCreated: z.coerce.date(), timeModified: z.coerce.date(), }) @@ -568,7 +578,11 @@ export const AntiAffinityGroupMember = z.preprocess( processResponseBody, z.object({ type: z.enum(['instance']), - value: z.object({ id: TypedUuidForInstanceKind, name: Name, runState: InstanceState }), + value: z.object({ + id: TypedUuidForInstanceKind, + name: Name, + runState: InstanceState, + }), }) ) @@ -588,7 +602,10 @@ export const AntiAffinityGroupMemberResultsPage = z.preprocess( */ export const AntiAffinityGroupResultsPage = z.preprocess( processResponseBody, - z.object({ items: AntiAffinityGroup.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: AntiAffinityGroup.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -613,11 +630,11 @@ export const ArtifactId = z.preprocess( export const AuditLogEntryActor = z.preprocess( processResponseBody, z.union([ - z.object({ kind: z.enum(['user_builtin']), userBuiltinId: z.string().uuid() }), + z.object({ kind: z.enum(['user_builtin']), userBuiltinId: z.uuid() }), z.object({ kind: z.enum(['silo_user']), - siloId: z.string().uuid(), - siloUserId: z.string().uuid(), + siloId: z.uuid(), + siloUserId: z.uuid(), }), z.object({ kind: z.enum(['unauthenticated']) }), ]) @@ -629,7 +646,10 @@ export const AuditLogEntryActor = z.preprocess( export const AuditLogEntryResult = z.preprocess( processResponseBody, z.union([ - z.object({ httpStatusCode: z.number().min(0).max(65535), kind: z.enum(['success']) }), + z.object({ + httpStatusCode: z.number().min(0).max(65535), + kind: z.enum(['success']), + }), z.object({ errorCode: z.string().nullable().optional(), errorMessage: z.string(), @@ -648,12 +668,12 @@ export const AuditLogEntry = z.preprocess( z.object({ actor: AuditLogEntryActor, authMethod: z.string().nullable().optional(), - id: z.string().uuid(), + id: z.uuid(), operationId: z.string(), requestId: z.string(), requestUri: z.string(), result: AuditLogEntryResult, - sourceIp: z.string().ip(), + sourceIp: z.ipv4(), timeCompleted: z.coerce.date(), timeStarted: z.coerce.date(), userAgent: z.string().nullable().optional(), @@ -665,7 +685,10 @@ export const AuditLogEntry = z.preprocess( */ export const AuditLogEntryResultsPage = z.preprocess( processResponseBody, - z.object({ items: AuditLogEntry.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: AuditLogEntry.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -703,7 +726,7 @@ export const BfdMode = z.preprocess( */ export const BfdSessionDisable = z.preprocess( processResponseBody, - z.object({ remote: z.string().ip(), switch: Name }) + z.object({ remote: z.ipv4(), switch: Name }) ) /** @@ -713,9 +736,9 @@ export const BfdSessionEnable = z.preprocess( processResponseBody, z.object({ detectionThreshold: z.number().min(0).max(255), - local: z.string().ip().nullable().optional(), + local: z.ipv4().nullable().optional(), mode: BfdMode, - remote: z.string().ip(), + remote: z.ipv4(), requiredRx: z.number().min(0), switch: Name, }) @@ -730,9 +753,9 @@ export const BfdStatus = z.preprocess( processResponseBody, z.object({ detectionThreshold: z.number().min(0).max(255), - local: z.string().ip().nullable().optional(), + local: z.ipv4().nullable().optional(), mode: BfdMode, - peer: z.string().ip(), + peer: z.ipv4(), requiredRx: z.number().min(0), state: BfdState, switch: Name, @@ -746,7 +769,7 @@ export const BgpAnnounceSet = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), + id: z.uuid(), name: Name, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), @@ -779,8 +802,8 @@ export const BgpAnnounceSetCreate = z.preprocess( export const BgpAnnouncement = z.preprocess( processResponseBody, z.object({ - addressLotBlockId: z.string().uuid(), - announceSetId: z.string().uuid(), + addressLotBlockId: z.uuid(), + announceSetId: z.uuid(), network: IpNet, }) ) @@ -793,7 +816,7 @@ export const BgpConfig = z.preprocess( z.object({ asn: z.number().min(0).max(4294967295), description: z.string(), - id: z.string().uuid(), + id: z.uuid(), name: Name, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), @@ -820,7 +843,10 @@ export const BgpConfigCreate = z.preprocess( */ export const BgpConfigResultsPage = z.preprocess( processResponseBody, - z.object({ items: BgpConfig.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: BgpConfig.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -828,7 +854,7 @@ export const BgpConfigResultsPage = z.preprocess( */ export const BgpExported = z.preprocess( processResponseBody, - z.object({ exports: z.record(z.string().min(1), Ipv4Net.array()) }) + z.object({ exports: z.record(z.string(), Ipv4Net.array()) }) ) /** @@ -838,7 +864,7 @@ export const BgpImportedRouteIpv4 = z.preprocess( processResponseBody, z.object({ id: z.number().min(0).max(4294967295), - nexthop: z.string().ip({ version: 'v4' }), + nexthop: z.ipv4(), prefix: Ipv4Net, switch: SwitchLocation, }) @@ -861,7 +887,7 @@ export const ImportExportPolicy = z.preprocess( export const BgpPeer = z.preprocess( processResponseBody, z.object({ - addr: z.string().ip(), + addr: z.ipv4(), allowedExport: ImportExportPolicy, allowedImport: ImportExportPolicy, bgpConfig: NameOrId, @@ -909,7 +935,7 @@ export const BgpPeerState = z.preprocess( export const BgpPeerStatus = z.preprocess( processResponseBody, z.object({ - addr: z.string().ip(), + addr: z.ipv4(), localAsn: z.number().min(0).max(4294967295), remoteAsn: z.number().min(0).max(4294967295), state: BgpPeerState, @@ -954,13 +980,19 @@ export const BinRangefloat = z.preprocess( export const BinRangeint16 = z.preprocess( processResponseBody, z.union([ - z.object({ end: z.number().min(-32767).max(32767), type: z.enum(['range_to']) }), + z.object({ + end: z.number().min(-32767).max(32767), + type: z.enum(['range_to']), + }), z.object({ end: z.number().min(-32767).max(32767), start: z.number().min(-32767).max(32767), type: z.enum(['range']), }), - z.object({ start: z.number().min(-32767).max(32767), type: z.enum(['range_from']) }), + z.object({ + start: z.number().min(-32767).max(32767), + type: z.enum(['range_from']), + }), ]) ) @@ -1010,13 +1042,19 @@ export const BinRangeint64 = z.preprocess( export const BinRangeint8 = z.preprocess( processResponseBody, z.union([ - z.object({ end: z.number().min(-127).max(127), type: z.enum(['range_to']) }), + z.object({ + end: z.number().min(-127).max(127), + type: z.enum(['range_to']), + }), z.object({ end: z.number().min(-127).max(127), start: z.number().min(-127).max(127), type: z.enum(['range']), }), - z.object({ start: z.number().min(-127).max(127), type: z.enum(['range_from']) }), + z.object({ + start: z.number().min(-127).max(127), + type: z.enum(['range_from']), + }), ]) ) @@ -1034,7 +1072,10 @@ export const BinRangeuint16 = z.preprocess( start: z.number().min(0).max(65535), type: z.enum(['range']), }), - z.object({ start: z.number().min(0).max(65535), type: z.enum(['range_from']) }), + z.object({ + start: z.number().min(0).max(65535), + type: z.enum(['range_from']), + }), ]) ) @@ -1046,13 +1087,19 @@ export const BinRangeuint16 = z.preprocess( export const BinRangeuint32 = z.preprocess( processResponseBody, z.union([ - z.object({ end: z.number().min(0).max(4294967295), type: z.enum(['range_to']) }), + z.object({ + end: z.number().min(0).max(4294967295), + type: z.enum(['range_to']), + }), z.object({ end: z.number().min(0).max(4294967295), start: z.number().min(0).max(4294967295), type: z.enum(['range']), }), - z.object({ start: z.number().min(0).max(4294967295), type: z.enum(['range_from']) }), + z.object({ + start: z.number().min(0).max(4294967295), + type: z.enum(['range_from']), + }), ]) ) @@ -1065,7 +1112,11 @@ export const BinRangeuint64 = z.preprocess( processResponseBody, z.union([ z.object({ end: z.number().min(0), type: z.enum(['range_to']) }), - z.object({ end: z.number().min(0), start: z.number().min(0), type: z.enum(['range']) }), + z.object({ + end: z.number().min(0), + start: z.number().min(0), + type: z.enum(['range']), + }), z.object({ start: z.number().min(0), type: z.enum(['range_from']) }), ]) ) @@ -1084,7 +1135,10 @@ export const BinRangeuint8 = z.preprocess( start: z.number().min(0).max(255), type: z.enum(['range']), }), - z.object({ start: z.number().min(0).max(255), type: z.enum(['range_from']) }), + z.object({ + start: z.number().min(0).max(255), + type: z.enum(['range_from']), + }), ]) ) @@ -1197,7 +1251,7 @@ export const Certificate = z.preprocess( z.object({ cert: z.string(), description: z.string(), - id: z.string().uuid(), + id: z.uuid(), name: Name, service: ServiceUsingCertificate, timeCreated: z.coerce.date(), @@ -1224,7 +1278,10 @@ export const CertificateCreate = z.preprocess( */ export const CertificateResultsPage = z.preprocess( processResponseBody, - z.object({ items: Certificate.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: Certificate.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -1233,7 +1290,7 @@ export const CertificateResultsPage = z.preprocess( export const ConsoleSession = z.preprocess( processResponseBody, z.object({ - id: z.string().uuid(), + id: z.uuid(), timeCreated: z.coerce.date(), timeLastUsed: z.coerce.date(), }) @@ -1244,7 +1301,10 @@ export const ConsoleSession = z.preprocess( */ export const ConsoleSessionResultsPage = z.preprocess( processResponseBody, - z.object({ items: ConsoleSession.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: ConsoleSession.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -1286,8 +1346,8 @@ export const CurrentUser = z.preprocess( processResponseBody, z.object({ displayName: z.string(), - id: z.string().uuid(), - siloId: z.string().uuid(), + id: z.uuid(), + siloId: z.uuid(), siloName: Name, }) ) @@ -1577,7 +1637,10 @@ export const DatumType = z.preprocess( export const MissingDatum = z.preprocess( processResponseBody, - z.object({ datumType: DatumType, startTime: z.coerce.date().nullable().optional() }) + z.object({ + datumType: DatumType, + startTime: z.coerce.date().nullable().optional(), + }) ) /** @@ -1589,16 +1652,28 @@ export const Datum = z.preprocess( z.object({ datum: SafeBoolean, type: z.enum(['bool']) }), z.object({ datum: z.number().min(-127).max(127), type: z.enum(['i8']) }), z.object({ datum: z.number().min(0).max(255), type: z.enum(['u8']) }), - z.object({ datum: z.number().min(-32767).max(32767), type: z.enum(['i16']) }), + z.object({ + datum: z.number().min(-32767).max(32767), + type: z.enum(['i16']), + }), z.object({ datum: z.number().min(0).max(65535), type: z.enum(['u16']) }), - z.object({ datum: z.number().min(-2147483647).max(2147483647), type: z.enum(['i32']) }), - z.object({ datum: z.number().min(0).max(4294967295), type: z.enum(['u32']) }), + z.object({ + datum: z.number().min(-2147483647).max(2147483647), + type: z.enum(['i32']), + }), + z.object({ + datum: z.number().min(0).max(4294967295), + type: z.enum(['u32']), + }), z.object({ datum: z.number(), type: z.enum(['i64']) }), z.object({ datum: z.number().min(0), type: z.enum(['u64']) }), z.object({ datum: z.number(), type: z.enum(['f32']) }), z.object({ datum: z.number(), type: z.enum(['f64']) }), z.object({ datum: z.string(), type: z.enum(['string']) }), - z.object({ datum: z.number().min(0).max(255).array(), type: z.enum(['bytes']) }), + z.object({ + datum: z.number().min(0).max(255).array(), + type: z.enum(['bytes']), + }), z.object({ datum: Cumulativeint64, type: z.enum(['cumulative_i64']) }), z.object({ datum: Cumulativeuint64, type: z.enum(['cumulative_u64']) }), z.object({ datum: Cumulativefloat, type: z.enum(['cumulative_f32']) }), @@ -1628,7 +1703,7 @@ export const DerEncodedKeyPair = z.preprocess( export const DeviceAccessToken = z.preprocess( processResponseBody, z.object({ - id: z.string().uuid(), + id: z.uuid(), timeCreated: z.coerce.date(), timeExpires: z.coerce.date().nullable().optional(), }) @@ -1636,7 +1711,11 @@ export const DeviceAccessToken = z.preprocess( export const DeviceAccessTokenRequest = z.preprocess( processResponseBody, - z.object({ clientId: z.string().uuid(), deviceCode: z.string(), grantType: z.string() }) + z.object({ + clientId: z.uuid(), + deviceCode: z.string(), + grantType: z.string(), + }) ) /** @@ -1644,13 +1723,16 @@ export const DeviceAccessTokenRequest = z.preprocess( */ export const DeviceAccessTokenResultsPage = z.preprocess( processResponseBody, - z.object({ items: DeviceAccessToken.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: DeviceAccessToken.array(), + nextPage: z.string().nullable().optional(), + }) ) export const DeviceAuthRequest = z.preprocess( processResponseBody, z.object({ - clientId: z.string().uuid(), + clientId: z.uuid(), ttlSeconds: z.number().min(1).max(4294967295).nullable().optional(), }) ) @@ -1678,9 +1760,9 @@ export const DiskState = z.preprocess( z.object({ state: z.enum(['importing_from_bulk_writes']) }), z.object({ state: z.enum(['finalizing']) }), z.object({ state: z.enum(['maintenance']) }), - z.object({ instance: z.string().uuid(), state: z.enum(['attaching']) }), - z.object({ instance: z.string().uuid(), state: z.enum(['attached']) }), - z.object({ instance: z.string().uuid(), state: z.enum(['detaching']) }), + z.object({ instance: z.uuid(), state: z.enum(['attaching']) }), + z.object({ instance: z.uuid(), state: z.enum(['attached']) }), + z.object({ instance: z.uuid(), state: z.enum(['detaching']) }), z.object({ state: z.enum(['destroyed']) }), z.object({ state: z.enum(['faulted']) }), ]) @@ -1695,12 +1777,12 @@ export const Disk = z.preprocess( blockSize: ByteCount, description: z.string(), devicePath: z.string(), - id: z.string().uuid(), - imageId: z.string().uuid().nullable().optional(), + id: z.uuid(), + imageId: z.uuid().nullable().optional(), name: Name, - projectId: z.string().uuid(), + projectId: z.uuid(), size: ByteCount, - snapshotId: z.string().uuid().nullable().optional(), + snapshotId: z.uuid().nullable().optional(), state: DiskState, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), @@ -1714,8 +1796,8 @@ export const DiskSource = z.preprocess( processResponseBody, z.union([ z.object({ blockSize: BlockSize, type: z.enum(['blank']) }), - z.object({ snapshotId: z.string().uuid(), type: z.enum(['snapshot']) }), - z.object({ imageId: z.string().uuid(), type: z.enum(['image']) }), + z.object({ snapshotId: z.uuid(), type: z.enum(['snapshot']) }), + z.object({ imageId: z.uuid(), type: z.enum(['image']) }), z.object({ blockSize: BlockSize, type: z.enum(['importing_blocks']) }), ]) ) @@ -1725,7 +1807,12 @@ export const DiskSource = z.preprocess( */ export const DiskCreate = z.preprocess( processResponseBody, - z.object({ description: z.string(), diskSource: DiskSource, name: Name, size: ByteCount }) + z.object({ + description: z.string(), + diskSource: DiskSource, + name: Name, + size: ByteCount, + }) ) export const DiskPath = z.preprocess(processResponseBody, z.object({ disk: NameOrId })) @@ -1791,7 +1878,11 @@ export const EphemeralIpCreate = z.preprocess( */ export const Error = z.preprocess( processResponseBody, - z.object({ errorCode: z.string().optional(), message: z.string(), requestId: z.string() }) + z.object({ + errorCode: z.string().optional(), + message: z.string(), + requestId: z.string(), + }) ) export const ExternalIp = z.preprocess( @@ -1799,25 +1890,21 @@ export const ExternalIp = z.preprocess( z.union([ z.object({ firstPort: z.number().min(0).max(65535), - ip: z.string().ip(), - ipPoolId: z.string().uuid(), + ip: z.ipv4(), + ipPoolId: z.uuid(), kind: z.enum(['snat']), lastPort: z.number().min(0).max(65535), }), - z.object({ - ip: z.string().ip(), - ipPoolId: z.string().uuid(), - kind: z.enum(['ephemeral']), - }), + z.object({ ip: z.ipv4(), ipPoolId: z.uuid(), kind: z.enum(['ephemeral']) }), z.object({ description: z.string(), - id: z.string().uuid(), - instanceId: z.string().uuid().nullable().optional(), - ip: z.string().ip(), - ipPoolId: z.string().uuid(), + id: z.uuid(), + instanceId: z.uuid().nullable().optional(), + ip: z.ipv4(), + ipPoolId: z.uuid(), kind: z.enum(['floating']), name: Name, - projectId: z.string().uuid(), + projectId: z.uuid(), timeCreated: z.coerce.date(), timeModified: z.coerce.date(), }), @@ -1830,7 +1917,10 @@ export const ExternalIp = z.preprocess( export const ExternalIpCreate = z.preprocess( processResponseBody, z.union([ - z.object({ pool: NameOrId.nullable().optional(), type: z.enum(['ephemeral']) }), + z.object({ + pool: NameOrId.nullable().optional(), + type: z.enum(['ephemeral']), + }), z.object({ floatingIp: NameOrId, type: z.enum(['floating']) }), ]) ) @@ -1840,7 +1930,10 @@ export const ExternalIpCreate = z.preprocess( */ export const ExternalIpResultsPage = z.preprocess( processResponseBody, - z.object({ items: ExternalIp.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: ExternalIp.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -1891,14 +1984,23 @@ export const FieldValue = z.preprocess( z.object({ type: z.enum(['string']), value: z.string() }), z.object({ type: z.enum(['i8']), value: z.number().min(-127).max(127) }), z.object({ type: z.enum(['u8']), value: z.number().min(0).max(255) }), - z.object({ type: z.enum(['i16']), value: z.number().min(-32767).max(32767) }), + z.object({ + type: z.enum(['i16']), + value: z.number().min(-32767).max(32767), + }), z.object({ type: z.enum(['u16']), value: z.number().min(0).max(65535) }), - z.object({ type: z.enum(['i32']), value: z.number().min(-2147483647).max(2147483647) }), - z.object({ type: z.enum(['u32']), value: z.number().min(0).max(4294967295) }), + z.object({ + type: z.enum(['i32']), + value: z.number().min(-2147483647).max(2147483647), + }), + z.object({ + type: z.enum(['u32']), + value: z.number().min(0).max(4294967295), + }), z.object({ type: z.enum(['i64']), value: z.number() }), z.object({ type: z.enum(['u64']), value: z.number().min(0) }), - z.object({ type: z.enum(['ip_addr']), value: z.string().ip() }), - z.object({ type: z.enum(['uuid']), value: z.string().uuid() }), + z.object({ type: z.enum(['ip_addr']), value: z.ipv4() }), + z.object({ type: z.enum(['uuid']), value: z.uuid() }), z.object({ type: z.enum(['bool']), value: SafeBoolean }), ]) ) @@ -1932,7 +2034,7 @@ export const IdentityType = z.preprocess( export const FleetRoleRoleAssignment = z.preprocess( processResponseBody, z.object({ - identityId: z.string().uuid(), + identityId: z.uuid(), identityType: IdentityType, roleName: FleetRole, }) @@ -1955,12 +2057,12 @@ export const FloatingIp = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), - instanceId: z.string().uuid().nullable().optional(), - ip: z.string().ip(), - ipPoolId: z.string().uuid(), + id: z.uuid(), + instanceId: z.uuid().nullable().optional(), + ip: z.ipv4(), + ipPoolId: z.uuid(), name: Name, - projectId: z.string().uuid(), + projectId: z.uuid(), timeCreated: z.coerce.date(), timeModified: z.coerce.date(), }) @@ -1986,7 +2088,7 @@ export const FloatingIpCreate = z.preprocess( processResponseBody, z.object({ description: z.string(), - ip: z.string().ip().nullable().optional(), + ip: z.ipv4().nullable().optional(), name: Name, pool: NameOrId.nullable().optional(), }) @@ -1997,7 +2099,10 @@ export const FloatingIpCreate = z.preprocess( */ export const FloatingIpResultsPage = z.preprocess( processResponseBody, - z.object({ items: FloatingIp.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: FloatingIp.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -2016,7 +2121,7 @@ export const FloatingIpUpdate = z.preprocess( */ export const Group = z.preprocess( processResponseBody, - z.object({ displayName: z.string(), id: z.string().uuid(), siloId: z.string().uuid() }) + z.object({ displayName: z.string(), id: z.uuid(), siloId: z.uuid() }) ) /** @@ -2024,7 +2129,10 @@ export const Group = z.preprocess( */ export const GroupResultsPage = z.preprocess( processResponseBody, - z.object({ items: Group.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: Group.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -2064,7 +2172,7 @@ export const IdentityProvider = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), + id: z.uuid(), name: Name, providerType: IdentityProviderType, timeCreated: z.coerce.date(), @@ -2077,7 +2185,10 @@ export const IdentityProvider = z.preprocess( */ export const IdentityProviderResultsPage = z.preprocess( processResponseBody, - z.object({ items: IdentityProvider.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: IdentityProvider.array(), + nextPage: z.string().nullable().optional(), + }) ) export const IdpMetadataSource = z.preprocess( @@ -2099,10 +2210,10 @@ export const Image = z.preprocess( blockSize: ByteCount, description: z.string(), digest: Digest.nullable().optional(), - id: z.string().uuid(), + id: z.uuid(), name: Name, os: z.string(), - projectId: z.string().uuid().nullable().optional(), + projectId: z.uuid().nullable().optional(), size: ByteCount, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), @@ -2115,7 +2226,7 @@ export const Image = z.preprocess( */ export const ImageSource = z.preprocess( processResponseBody, - z.object({ id: z.string().uuid(), type: z.enum(['snapshot']) }) + z.object({ id: z.uuid(), type: z.enum(['snapshot']) }) ) /** @@ -2137,7 +2248,10 @@ export const ImageCreate = z.preprocess( */ export const ImageResultsPage = z.preprocess( processResponseBody, - z.object({ items: Image.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: Image.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -2173,14 +2287,14 @@ export const Instance = z.preprocess( autoRestartCooldownExpiration: z.coerce.date().nullable().optional(), autoRestartEnabled: SafeBoolean, autoRestartPolicy: InstanceAutoRestartPolicy.nullable().optional(), - bootDiskId: z.string().uuid().nullable().optional(), + bootDiskId: z.uuid().nullable().optional(), description: z.string(), hostname: z.string(), - id: z.string().uuid(), + id: z.uuid(), memory: ByteCount, name: Name, ncpus: InstanceCpuCount, - projectId: z.string().uuid(), + projectId: z.uuid(), runState: InstanceState, timeCreated: z.coerce.date(), timeLastAutoRestarted: z.coerce.date().nullable().optional(), @@ -2213,7 +2327,7 @@ export const InstanceNetworkInterfaceCreate = z.preprocess( processResponseBody, z.object({ description: z.string(), - ip: z.string().ip().nullable().optional(), + ip: z.ipv4().nullable().optional(), name: Name, subnetName: Name, vpcName: Name, @@ -2226,7 +2340,10 @@ export const InstanceNetworkInterfaceCreate = z.preprocess( export const InstanceNetworkInterfaceAttachment = z.preprocess( processResponseBody, z.union([ - z.object({ params: InstanceNetworkInterfaceCreate.array(), type: z.enum(['create']) }), + z.object({ + params: InstanceNetworkInterfaceCreate.array(), + type: z.enum(['create']), + }), z.object({ type: z.enum(['default']) }), z.object({ type: z.enum(['none']) }), ]) @@ -2239,8 +2356,8 @@ export const InstanceCreate = z.preprocess( processResponseBody, z.object({ antiAffinityGroups: NameOrId.array().default([]).optional(), - autoRestartPolicy: InstanceAutoRestartPolicy.default(null).nullable().optional(), - bootDisk: InstanceDiskAttachment.default(null).nullable().optional(), + autoRestartPolicy: InstanceAutoRestartPolicy.nullable().default(null).optional(), + bootDisk: InstanceDiskAttachment.nullable().default(null).optional(), description: z.string(), disks: InstanceDiskAttachment.array().default([]).optional(), externalIps: ExternalIpCreate.array().default([]).optional(), @@ -2278,17 +2395,17 @@ export const InstanceNetworkInterface = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), - instanceId: z.string().uuid(), - ip: z.string().ip(), + id: z.uuid(), + instanceId: z.uuid(), + ip: z.ipv4(), mac: MacAddr, name: Name, primary: SafeBoolean, - subnetId: z.string().uuid(), + subnetId: z.uuid(), timeCreated: z.coerce.date(), timeModified: z.coerce.date(), transitIps: IpNet.array().default([]).optional(), - vpcId: z.string().uuid(), + vpcId: z.uuid(), }) ) @@ -2323,7 +2440,10 @@ export const InstanceNetworkInterfaceUpdate = z.preprocess( */ export const InstanceResultsPage = z.preprocess( processResponseBody, - z.object({ items: Instance.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: Instance.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -2331,7 +2451,10 @@ export const InstanceResultsPage = z.preprocess( */ export const InstanceSerialConsoleData = z.preprocess( processResponseBody, - z.object({ data: z.number().min(0).max(255).array(), lastByteOffset: z.number().min(0) }) + z.object({ + data: z.number().min(0).max(255).array(), + lastByteOffset: z.number().min(0), + }) ) /** @@ -2363,11 +2486,11 @@ export const InternetGateway = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), + id: z.uuid(), name: Name, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), - vpcId: z.string().uuid(), + vpcId: z.uuid(), }) ) @@ -2385,10 +2508,10 @@ export const InternetGatewayCreate = z.preprocess( export const InternetGatewayIpAddress = z.preprocess( processResponseBody, z.object({ - address: z.string().ip(), + address: z.ipv4(), description: z.string(), - id: z.string().uuid(), - internetGatewayId: z.string().uuid(), + id: z.uuid(), + internetGatewayId: z.uuid(), name: Name, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), @@ -2400,7 +2523,7 @@ export const InternetGatewayIpAddress = z.preprocess( */ export const InternetGatewayIpAddressCreate = z.preprocess( processResponseBody, - z.object({ address: z.string().ip(), description: z.string(), name: Name }) + z.object({ address: z.ipv4(), description: z.string(), name: Name }) ) /** @@ -2421,9 +2544,9 @@ export const InternetGatewayIpPool = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), - internetGatewayId: z.string().uuid(), - ipPoolId: z.string().uuid(), + id: z.uuid(), + internetGatewayId: z.uuid(), + ipPoolId: z.uuid(), name: Name, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), @@ -2454,7 +2577,10 @@ export const InternetGatewayIpPoolResultsPage = z.preprocess( */ export const InternetGatewayResultsPage = z.preprocess( processResponseBody, - z.object({ items: InternetGateway.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: InternetGateway.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -2464,7 +2590,7 @@ export const IpPool = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), + id: z.uuid(), name: Name, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), @@ -2491,10 +2617,7 @@ export const IpPoolLinkSilo = z.preprocess( */ export const Ipv4Range = z.preprocess( processResponseBody, - z.object({ - first: z.string().ip({ version: 'v4' }), - last: z.string().ip({ version: 'v4' }), - }) + z.object({ first: z.ipv4(), last: z.ipv4() }) ) /** @@ -2504,10 +2627,7 @@ export const Ipv4Range = z.preprocess( */ export const Ipv6Range = z.preprocess( processResponseBody, - z.object({ - first: z.string().ip({ version: 'v6' }), - last: z.string().ip({ version: 'v6' }), - }) + z.object({ first: z.ipv6(), last: z.ipv6() }) ) export const IpRange = z.preprocess(processResponseBody, z.union([Ipv4Range, Ipv6Range])) @@ -2515,8 +2635,8 @@ export const IpRange = z.preprocess(processResponseBody, z.union([Ipv4Range, Ipv export const IpPoolRange = z.preprocess( processResponseBody, z.object({ - id: z.string().uuid(), - ipPoolId: z.string().uuid(), + id: z.uuid(), + ipPoolId: z.uuid(), range: IpRange, timeCreated: z.coerce.date(), }) @@ -2527,7 +2647,10 @@ export const IpPoolRange = z.preprocess( */ export const IpPoolRangeResultsPage = z.preprocess( processResponseBody, - z.object({ items: IpPoolRange.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: IpPoolRange.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -2535,7 +2658,10 @@ export const IpPoolRangeResultsPage = z.preprocess( */ export const IpPoolResultsPage = z.preprocess( processResponseBody, - z.object({ items: IpPool.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: IpPool.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -2543,11 +2669,7 @@ export const IpPoolResultsPage = z.preprocess( */ export const IpPoolSiloLink = z.preprocess( processResponseBody, - z.object({ - ipPoolId: z.string().uuid(), - isDefault: SafeBoolean, - siloId: z.string().uuid(), - }) + z.object({ ipPoolId: z.uuid(), isDefault: SafeBoolean, siloId: z.uuid() }) ) /** @@ -2555,7 +2677,10 @@ export const IpPoolSiloLink = z.preprocess( */ export const IpPoolSiloLinkResultsPage = z.preprocess( processResponseBody, - z.object({ items: IpPoolSiloLink.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: IpPoolSiloLink.array(), + nextPage: z.string().nullable().optional(), + }) ) export const IpPoolSiloUpdate = z.preprocess( @@ -2621,7 +2746,7 @@ export const LldpLinkConfigCreate = z.preprocess( enabled: SafeBoolean, linkDescription: z.string().nullable().optional(), linkName: z.string().nullable().optional(), - managementIp: z.string().ip().nullable().optional(), + managementIp: z.ipv4().nullable().optional(), systemDescription: z.string().nullable().optional(), systemName: z.string().nullable().optional(), }) @@ -2683,10 +2808,10 @@ export const LldpLinkConfig = z.preprocess( z.object({ chassisId: z.string().nullable().optional(), enabled: SafeBoolean, - id: z.string().uuid(), + id: z.uuid(), linkDescription: z.string().nullable().optional(), linkName: z.string().nullable().optional(), - managementIp: z.string().ip().nullable().optional(), + managementIp: z.ipv4().nullable().optional(), systemDescription: z.string().nullable().optional(), systemName: z.string().nullable().optional(), }) @@ -2695,7 +2820,7 @@ export const LldpLinkConfig = z.preprocess( export const NetworkAddress = z.preprocess( processResponseBody, z.union([ - z.object({ ipAddr: z.string().ip() }), + z.object({ ipAddr: z.ipv4() }), z.object({ iEEE802: z.number().min(0).max(255).array() }), ]) ) @@ -2732,7 +2857,10 @@ export const LldpNeighbor = z.preprocess( */ export const LldpNeighborResultsPage = z.preprocess( processResponseBody, - z.object({ items: LldpNeighbor.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: LldpNeighbor.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -2742,9 +2870,9 @@ export const LoopbackAddress = z.preprocess( processResponseBody, z.object({ address: IpNet, - addressLotBlockId: z.string().uuid(), - id: z.string().uuid(), - rackId: z.string().uuid(), + addressLotBlockId: z.uuid(), + id: z.uuid(), + rackId: z.uuid(), switchLocation: z.string(), }) ) @@ -2755,11 +2883,11 @@ export const LoopbackAddress = z.preprocess( export const LoopbackAddressCreate = z.preprocess( processResponseBody, z.object({ - address: z.string().ip(), + address: z.ipv4(), addressLot: NameOrId, anycast: SafeBoolean, mask: z.number().min(0).max(255), - rackId: z.string().uuid(), + rackId: z.uuid(), switchLocation: Name, }) ) @@ -2769,7 +2897,10 @@ export const LoopbackAddressCreate = z.preprocess( */ export const LoopbackAddressResultsPage = z.preprocess( processResponseBody, - z.object({ items: LoopbackAddress.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: LoopbackAddress.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -2785,7 +2916,10 @@ export const Measurement = z.preprocess( */ export const MeasurementResultsPage = z.preprocess( processResponseBody, - z.object({ items: Measurement.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: Measurement.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -2802,9 +2936,9 @@ export const MetricType = z.preprocess( export const NetworkInterfaceKind = z.preprocess( processResponseBody, z.union([ - z.object({ id: z.string().uuid(), type: z.enum(['instance']) }), - z.object({ id: z.string().uuid(), type: z.enum(['service']) }), - z.object({ id: z.string().uuid(), type: z.enum(['probe']) }), + z.object({ id: z.uuid(), type: z.enum(['instance']) }), + z.object({ id: z.uuid(), type: z.enum(['service']) }), + z.object({ id: z.uuid(), type: z.enum(['probe']) }), ]) ) @@ -2819,8 +2953,8 @@ export const Vni = z.preprocess(processResponseBody, z.number().min(0).max(42949 export const NetworkInterface = z.preprocess( processResponseBody, z.object({ - id: z.string().uuid(), - ip: z.string().ip(), + id: z.uuid(), + ip: z.ipv4(), kind: NetworkInterfaceKind, mac: MacAddr, name: Name, @@ -2840,10 +2974,22 @@ export const NetworkInterface = z.preprocess( export const ValueArray = z.preprocess( processResponseBody, z.union([ - z.object({ type: z.enum(['integer']), values: z.number().nullable().array() }), - z.object({ type: z.enum(['double']), values: z.number().nullable().array() }), - z.object({ type: z.enum(['boolean']), values: SafeBoolean.nullable().array() }), - z.object({ type: z.enum(['string']), values: z.string().nullable().array() }), + z.object({ + type: z.enum(['integer']), + values: z.number().nullable().array(), + }), + z.object({ + type: z.enum(['double']), + values: z.number().nullable().array(), + }), + z.object({ + type: z.enum(['boolean']), + values: SafeBoolean.nullable().array(), + }), + z.object({ + type: z.enum(['string']), + values: z.string().nullable().array(), + }), z.object({ type: z.enum(['integer_distribution']), values: Distributionint64.nullable().array(), @@ -2882,7 +3028,7 @@ export const Points = z.preprocess( */ export const Timeseries = z.preprocess( processResponseBody, - z.object({ fields: z.record(z.string().min(1), FieldValue), points: Points }) + z.object({ fields: z.record(z.string(), FieldValue), points: Points }) ) /** @@ -2892,7 +3038,7 @@ export const Timeseries = z.preprocess( */ export const Table = z.preprocess( processResponseBody, - z.object({ name: z.string(), timeseries: z.record(z.string().min(1), Timeseries) }) + z.object({ name: z.string(), timeseries: z.record(z.string(), Timeseries) }) ) /** @@ -2943,11 +3089,11 @@ export const PhysicalDisk = z.preprocess( processResponseBody, z.object({ formFactor: PhysicalDiskKind, - id: z.string().uuid(), + id: z.uuid(), model: z.string(), policy: PhysicalDiskPolicy, serial: z.string(), - sledId: z.string().uuid().nullable().optional(), + sledId: z.uuid().nullable().optional(), state: PhysicalDiskState, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), @@ -2960,7 +3106,10 @@ export const PhysicalDisk = z.preprocess( */ export const PhysicalDiskResultsPage = z.preprocess( processResponseBody, - z.object({ items: PhysicalDisk.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: PhysicalDisk.array(), + nextPage: z.string().nullable().optional(), + }) ) export const PingStatus = z.preprocess(processResponseBody, z.enum(['ok'])) @@ -2974,9 +3123,9 @@ export const Probe = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), + id: z.uuid(), name: Name, - sled: z.string().uuid(), + sled: z.uuid(), timeCreated: z.coerce.date(), timeModified: z.coerce.date(), }) @@ -2991,7 +3140,7 @@ export const ProbeCreate = z.preprocess( description: z.string(), ipPool: NameOrId.nullable().optional(), name: Name, - sled: z.string().uuid(), + sled: z.uuid(), }) ) @@ -3004,7 +3153,7 @@ export const ProbeExternalIp = z.preprocess( processResponseBody, z.object({ firstPort: z.number().min(0).max(65535), - ip: z.string().ip(), + ip: z.ipv4(), kind: ProbeExternalIpKind, lastPort: z.number().min(0).max(65535), }) @@ -3014,10 +3163,10 @@ export const ProbeInfo = z.preprocess( processResponseBody, z.object({ externalIps: ProbeExternalIp.array(), - id: z.string().uuid(), + id: z.uuid(), interface: NetworkInterface, name: Name, - sled: z.string().uuid(), + sled: z.uuid(), }) ) @@ -3026,7 +3175,10 @@ export const ProbeInfo = z.preprocess( */ export const ProbeInfoResultsPage = z.preprocess( processResponseBody, - z.object({ items: ProbeInfo.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: ProbeInfo.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -3036,7 +3188,7 @@ export const Project = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), + id: z.uuid(), name: Name, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), @@ -3056,7 +3208,10 @@ export const ProjectCreate = z.preprocess( */ export const ProjectResultsPage = z.preprocess( processResponseBody, - z.object({ items: Project.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: Project.array(), + nextPage: z.string().nullable().optional(), + }) ) export const ProjectRole = z.preprocess( @@ -3072,7 +3227,7 @@ export const ProjectRole = z.preprocess( export const ProjectRoleRoleAssignment = z.preprocess( processResponseBody, z.object({ - identityId: z.string().uuid(), + identityId: z.uuid(), identityType: IdentityType, roleName: ProjectRole, }) @@ -3105,7 +3260,7 @@ export const ProjectUpdate = z.preprocess( export const Rack = z.preprocess( processResponseBody, z.object({ - id: z.string().uuid(), + id: z.uuid(), timeCreated: z.coerce.date(), timeModified: z.coerce.date(), }) @@ -3126,7 +3281,7 @@ export const Route = z.preprocess( processResponseBody, z.object({ dst: IpNet, - gw: z.string().ip(), + gw: z.ipv4(), ribPriority: z.number().min(0).max(255).nullable().optional(), vid: z.number().min(0).max(65535).nullable().optional(), }) @@ -3148,7 +3303,7 @@ export const RouteConfig = z.preprocess( export const RouteDestination = z.preprocess( processResponseBody, z.union([ - z.object({ type: z.enum(['ip']), value: z.string().ip() }), + z.object({ type: z.enum(['ip']), value: z.ipv4() }), z.object({ type: z.enum(['ip_net']), value: IpNet }), z.object({ type: z.enum(['vpc']), value: Name }), z.object({ type: z.enum(['subnet']), value: Name }), @@ -3161,7 +3316,7 @@ export const RouteDestination = z.preprocess( export const RouteTarget = z.preprocess( processResponseBody, z.union([ - z.object({ type: z.enum(['ip']), value: z.string().ip() }), + z.object({ type: z.enum(['ip']), value: z.ipv4() }), z.object({ type: z.enum(['vpc']), value: Name }), z.object({ type: z.enum(['subnet']), value: Name }), z.object({ type: z.enum(['instance']), value: Name }), @@ -3188,13 +3343,13 @@ export const RouterRoute = z.preprocess( z.object({ description: z.string(), destination: RouteDestination, - id: z.string().uuid(), + id: z.uuid(), kind: RouterRouteKind, name: Name, target: RouteTarget, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), - vpcRouterId: z.string().uuid(), + vpcRouterId: z.uuid(), }) ) @@ -3216,7 +3371,10 @@ export const RouterRouteCreate = z.preprocess( */ export const RouterRouteResultsPage = z.preprocess( processResponseBody, - z.object({ items: RouterRoute.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: RouterRoute.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -3241,7 +3399,7 @@ export const SamlIdentityProvider = z.preprocess( acsUrl: z.string(), description: z.string(), groupAttributeName: z.string().nullable().optional(), - id: z.string().uuid(), + id: z.uuid(), idpEntityId: z.string(), name: Name, publicCert: z.string().nullable().optional(), @@ -3265,7 +3423,7 @@ export const SamlIdentityProviderCreate = z.preprocess( idpEntityId: z.string(), idpMetadataSource: IdpMetadataSource, name: Name, - signingKeypair: DerEncodedKeyPair.default(null).nullable().optional(), + signingKeypair: DerEncodedKeyPair.nullable().default(null).optional(), sloUrl: z.string(), spClientId: z.string(), technicalContactEmail: z.string(), @@ -3312,9 +3470,9 @@ export const Silo = z.preprocess( z.object({ description: z.string(), discoverable: SafeBoolean, - id: z.string().uuid(), + id: z.uuid(), identityMode: SiloIdentityMode, - mappedFleetRoles: z.record(z.string().min(1), FleetRole.array().refine(...uniqueItems)), + mappedFleetRoles: z.record(z.string(), FleetRole.array().refine(...uniqueItems)), name: Name, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), @@ -3328,7 +3486,7 @@ export const SiloAuthSettings = z.preprocess( processResponseBody, z.object({ deviceTokenMaxTtlSeconds: z.number().min(0).max(4294967295).nullable().optional(), - siloId: z.string().uuid(), + siloId: z.uuid(), }) ) @@ -3337,7 +3495,9 @@ export const SiloAuthSettings = z.preprocess( */ export const SiloAuthSettingsUpdate = z.preprocess( processResponseBody, - z.object({ deviceTokenMaxTtlSeconds: z.number().min(1).max(4294967295).nullable() }) + z.object({ + deviceTokenMaxTtlSeconds: z.number().min(1).max(4294967295).nullable(), + }) ) /** @@ -3359,7 +3519,7 @@ export const SiloCreate = z.preprocess( discoverable: SafeBoolean, identityMode: SiloIdentityMode, mappedFleetRoles: z - .record(z.string().min(1), FleetRole.array().refine(...uniqueItems)) + .record(z.string(), FleetRole.array().refine(...uniqueItems)) .optional(), name: Name, quotas: SiloQuotasCreate, @@ -3374,7 +3534,7 @@ export const SiloIpPool = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), + id: z.uuid(), isDefault: SafeBoolean, name: Name, timeCreated: z.coerce.date(), @@ -3387,7 +3547,10 @@ export const SiloIpPool = z.preprocess( */ export const SiloIpPoolResultsPage = z.preprocess( processResponseBody, - z.object({ items: SiloIpPool.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: SiloIpPool.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -3398,7 +3561,7 @@ export const SiloQuotas = z.preprocess( z.object({ cpus: z.number(), memory: ByteCount, - siloId: z.string().uuid(), + siloId: z.uuid(), storage: ByteCount, }) ) @@ -3408,7 +3571,10 @@ export const SiloQuotas = z.preprocess( */ export const SiloQuotasResultsPage = z.preprocess( processResponseBody, - z.object({ items: SiloQuotas.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: SiloQuotas.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -3444,7 +3610,7 @@ export const SiloRole = z.preprocess( export const SiloRoleRoleAssignment = z.preprocess( processResponseBody, z.object({ - identityId: z.string().uuid(), + identityId: z.uuid(), identityType: IdentityType, roleName: SiloRole, }) @@ -3476,7 +3642,7 @@ export const SiloUtilization = z.preprocess( z.object({ allocated: VirtualResourceCounts, provisioned: VirtualResourceCounts, - siloId: z.string().uuid(), + siloId: z.uuid(), siloName: Name, }) ) @@ -3486,7 +3652,10 @@ export const SiloUtilization = z.preprocess( */ export const SiloUtilizationResultsPage = z.preprocess( processResponseBody, - z.object({ items: SiloUtilization.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: SiloUtilization.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -3505,7 +3674,10 @@ export const SledProvisionPolicy = z.preprocess( export const SledPolicy = z.preprocess( processResponseBody, z.union([ - z.object({ kind: z.enum(['in_service']), provisionPolicy: SledProvisionPolicy }), + z.object({ + kind: z.enum(['in_service']), + provisionPolicy: SledProvisionPolicy, + }), z.object({ kind: z.enum(['expunged']) }), ]) ) @@ -3525,9 +3697,9 @@ export const Sled = z.preprocess( processResponseBody, z.object({ baseboard: Baseboard, - id: z.string().uuid(), + id: z.uuid(), policy: SledPolicy, - rackId: z.string().uuid(), + rackId: z.uuid(), state: SledState, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), @@ -3539,7 +3711,7 @@ export const Sled = z.preprocess( /** * The unique ID of a sled. */ -export const SledId = z.preprocess(processResponseBody, z.object({ id: z.string().uuid() })) +export const SledId = z.preprocess(processResponseBody, z.object({ id: z.uuid() })) /** * An operator's view of an instance running on a given sled @@ -3547,10 +3719,10 @@ export const SledId = z.preprocess(processResponseBody, z.object({ id: z.string( export const SledInstance = z.preprocess( processResponseBody, z.object({ - activeSledId: z.string().uuid(), - id: z.string().uuid(), + activeSledId: z.uuid(), + id: z.uuid(), memory: z.number(), - migrationId: z.string().uuid().nullable().optional(), + migrationId: z.uuid().nullable().optional(), name: Name, ncpus: z.number(), projectName: Name, @@ -3566,7 +3738,10 @@ export const SledInstance = z.preprocess( */ export const SledInstanceResultsPage = z.preprocess( processResponseBody, - z.object({ items: SledInstance.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: SledInstance.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -3605,10 +3780,10 @@ export const Snapshot = z.preprocess( processResponseBody, z.object({ description: z.string(), - diskId: z.string().uuid(), - id: z.string().uuid(), + diskId: z.uuid(), + id: z.uuid(), name: Name, - projectId: z.string().uuid(), + projectId: z.uuid(), size: ByteCount, state: SnapshotState, timeCreated: z.coerce.date(), @@ -3629,7 +3804,10 @@ export const SnapshotCreate = z.preprocess( */ export const SnapshotResultsPage = z.preprocess( processResponseBody, - z.object({ items: Snapshot.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: Snapshot.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -3639,10 +3817,10 @@ export const SshKey = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), + id: z.uuid(), name: Name, publicKey: z.string(), - siloUserId: z.string().uuid(), + siloUserId: z.uuid(), timeCreated: z.coerce.date(), timeModified: z.coerce.date(), }) @@ -3661,7 +3839,10 @@ export const SshKeyCreate = z.preprocess( */ export const SshKeyResultsPage = z.preprocess( processResponseBody, - z.object({ items: SshKey.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: SshKey.array(), + nextPage: z.string().nullable().optional(), + }) ) export const SupportBundleCreate = z.preprocess( @@ -3669,10 +3850,7 @@ export const SupportBundleCreate = z.preprocess( z.object({ userComment: z.string().nullable().optional() }) ) -export const TypedUuidForSupportBundleKind = z.preprocess( - processResponseBody, - z.string().uuid() -) +export const TypedUuidForSupportBundleKind = z.preprocess(processResponseBody, z.uuid()) export const SupportBundleState = z.preprocess( processResponseBody, @@ -3696,7 +3874,10 @@ export const SupportBundleInfo = z.preprocess( */ export const SupportBundleInfoResultsPage = z.preprocess( processResponseBody, - z.object({ items: SupportBundleInfo.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: SupportBundleInfo.array(), + nextPage: z.string().nullable().optional(), + }) ) export const SupportBundleUpdate = z.preprocess( @@ -3711,8 +3892,8 @@ export const Switch = z.preprocess( processResponseBody, z.object({ baseboard: Baseboard, - id: z.string().uuid(), - rackId: z.string().uuid(), + id: z.uuid(), + rackId: z.uuid(), timeCreated: z.coerce.date(), timeModified: z.coerce.date(), }) @@ -3732,10 +3913,10 @@ export const SwitchInterfaceKind2 = z.preprocess( export const SwitchInterfaceConfig = z.preprocess( processResponseBody, z.object({ - id: z.string().uuid(), + id: z.uuid(), interfaceName: Name, kind: SwitchInterfaceKind2, - portSettingsId: z.string().uuid(), + portSettingsId: z.uuid(), v6Enabled: SafeBoolean, }) ) @@ -3757,10 +3938,17 @@ export const SwitchInterfaceKind = z.preprocess( */ export const SwitchInterfaceConfigCreate = z.preprocess( processResponseBody, - z.object({ kind: SwitchInterfaceKind, linkName: Name, v6Enabled: SafeBoolean }) + z.object({ + kind: SwitchInterfaceKind, + linkName: Name, + v6Enabled: SafeBoolean, + }) ) -export const SwitchLinkState = z.preprocess(processResponseBody, z.record(z.unknown())) +export const SwitchLinkState = z.preprocess( + processResponseBody, + z.record(z.string(), z.unknown()) +) /** * A switch port represents a physical external port on a rack switch. @@ -3768,10 +3956,10 @@ export const SwitchLinkState = z.preprocess(processResponseBody, z.record(z.unkn export const SwitchPort = z.preprocess( processResponseBody, z.object({ - id: z.string().uuid(), + id: z.uuid(), portName: Name, - portSettingsId: z.string().uuid().nullable().optional(), - rackId: z.string().uuid(), + portSettingsId: z.uuid().nullable().optional(), + rackId: z.uuid(), switchLocation: z.string(), }) ) @@ -3783,11 +3971,11 @@ export const SwitchPortAddressView = z.preprocess( processResponseBody, z.object({ address: IpNet, - addressLotBlockId: z.string().uuid(), - addressLotId: z.string().uuid(), + addressLotBlockId: z.uuid(), + addressLotId: z.uuid(), addressLotName: Name, interfaceName: Name, - portSettingsId: z.string().uuid(), + portSettingsId: z.uuid(), vlanId: z.number().min(0).max(65535).nullable().optional(), }) ) @@ -3813,7 +4001,7 @@ export const SwitchPortGeometry2 = z.preprocess( */ export const SwitchPortConfig = z.preprocess( processResponseBody, - z.object({ geometry: SwitchPortGeometry2, portSettingsId: z.string().uuid() }) + z.object({ geometry: SwitchPortGeometry2, portSettingsId: z.uuid() }) ) /** @@ -3857,7 +4045,7 @@ export const SwitchPortLinkConfig = z.preprocess( linkName: Name, lldpLinkConfig: LldpLinkConfig.nullable().optional(), mtu: z.number().min(0).max(65535), - portSettingsId: z.string().uuid(), + portSettingsId: z.uuid(), speed: LinkSpeed, txEqConfig: TxEqConfig2.nullable().optional(), }) @@ -3868,7 +4056,10 @@ export const SwitchPortLinkConfig = z.preprocess( */ export const SwitchPortResultsPage = z.preprocess( processResponseBody, - z.object({ items: SwitchPort.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: SwitchPort.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -3878,9 +4069,9 @@ export const SwitchPortRouteConfig = z.preprocess( processResponseBody, z.object({ dst: IpNet, - gw: z.string().ip(), + gw: z.ipv4(), interfaceName: Name, - portSettingsId: z.string().uuid(), + portSettingsId: z.uuid(), ribPriority: z.number().min(0).max(255).nullable().optional(), vlanId: z.number().min(0).max(65535).nullable().optional(), }) @@ -3891,7 +4082,7 @@ export const SwitchPortRouteConfig = z.preprocess( */ export const SwitchPortSettingsGroups = z.preprocess( processResponseBody, - z.object({ portSettingsGroupId: z.string().uuid(), portSettingsId: z.string().uuid() }) + z.object({ portSettingsGroupId: z.uuid(), portSettingsId: z.uuid() }) ) /** @@ -3899,7 +4090,10 @@ export const SwitchPortSettingsGroups = z.preprocess( */ export const SwitchVlanInterfaceConfig = z.preprocess( processResponseBody, - z.object({ interfaceConfigId: z.string().uuid(), vlanId: z.number().min(0).max(65535) }) + z.object({ + interfaceConfigId: z.uuid(), + vlanId: z.number().min(0).max(65535), + }) ) /** @@ -3912,7 +4106,7 @@ export const SwitchPortSettings = z.preprocess( bgpPeers: BgpPeer.array(), description: z.string(), groups: SwitchPortSettingsGroups.array(), - id: z.string().uuid(), + id: z.uuid(), interfaces: SwitchInterfaceConfig.array(), links: SwitchPortLinkConfig.array(), name: Name, @@ -3949,7 +4143,7 @@ export const SwitchPortSettingsIdentity = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), + id: z.uuid(), name: Name, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), @@ -3972,7 +4166,10 @@ export const SwitchPortSettingsIdentityResultsPage = z.preprocess( */ export const SwitchResultsPage = z.preprocess( processResponseBody, - z.object({ items: Switch.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: Switch.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -4078,7 +4275,10 @@ export const TimeseriesSchema = z.preprocess( */ export const TimeseriesSchemaResultsPage = z.preprocess( processResponseBody, - z.object({ items: TimeseriesSchema.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: TimeseriesSchema.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -4158,7 +4358,7 @@ export const UninitializedSled = z.preprocess( z.object({ baseboard: Baseboard, cubby: z.number().min(0).max(65535), - rackId: z.string().uuid(), + rackId: z.uuid(), }) ) @@ -4175,7 +4375,10 @@ export const UninitializedSledId = z.preprocess( */ export const UninitializedSledResultsPage = z.preprocess( processResponseBody, - z.object({ items: UninitializedSled.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: UninitializedSled.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -4184,8 +4387,8 @@ export const UninitializedSledResultsPage = z.preprocess( export const UpdatesTrustRoot = z.preprocess( processResponseBody, z.object({ - id: z.string().uuid(), - rootRole: z.record(z.unknown()), + id: z.uuid(), + rootRole: z.record(z.string(), z.unknown()), timeCreated: z.coerce.date(), }) ) @@ -4195,7 +4398,10 @@ export const UpdatesTrustRoot = z.preprocess( */ export const UpdatesTrustRootResultsPage = z.preprocess( processResponseBody, - z.object({ items: UpdatesTrustRoot.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: UpdatesTrustRoot.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -4203,7 +4409,7 @@ export const UpdatesTrustRootResultsPage = z.preprocess( */ export const User = z.preprocess( processResponseBody, - z.object({ displayName: z.string(), id: z.string().uuid(), siloId: z.string().uuid() }) + z.object({ displayName: z.string(), id: z.uuid(), siloId: z.uuid() }) ) /** @@ -4215,7 +4421,7 @@ export const UserBuiltin = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), + id: z.uuid(), name: Name, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), @@ -4227,7 +4433,10 @@ export const UserBuiltin = z.preprocess( */ export const UserBuiltinResultsPage = z.preprocess( processResponseBody, - z.object({ items: UserBuiltin.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: UserBuiltin.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -4286,7 +4495,10 @@ export const UsernamePasswordCredentials = z.preprocess( */ export const Utilization = z.preprocess( processResponseBody, - z.object({ capacity: VirtualResourceCounts, provisioned: VirtualResourceCounts }) + z.object({ + capacity: VirtualResourceCounts, + provisioned: VirtualResourceCounts, + }) ) /** @@ -4297,11 +4509,11 @@ export const Vpc = z.preprocess( z.object({ description: z.string(), dnsName: Name, - id: z.string().uuid(), + id: z.uuid(), ipv6Prefix: Ipv6Net, name: Name, - projectId: z.string().uuid(), - systemRouterId: z.string().uuid(), + projectId: z.uuid(), + systemRouterId: z.uuid(), timeCreated: z.coerce.date(), timeModified: z.coerce.date(), }) @@ -4347,7 +4559,7 @@ export const VpcFirewallRuleHostFilter = z.preprocess( z.object({ type: z.enum(['vpc']), value: Name }), z.object({ type: z.enum(['subnet']), value: Name }), z.object({ type: z.enum(['instance']), value: Name }), - z.object({ type: z.enum(['ip']), value: z.string().ip() }), + z.object({ type: z.enum(['ip']), value: z.ipv4() }), z.object({ type: z.enum(['ip_net']), value: IpNet }), ]) ) @@ -4360,7 +4572,10 @@ export const VpcFirewallRuleProtocol = z.preprocess( z.union([ z.object({ type: z.enum(['tcp']) }), z.object({ type: z.enum(['udp']) }), - z.object({ type: z.enum(['icmp']), value: VpcFirewallIcmpFilter.nullable() }), + z.object({ + type: z.enum(['icmp']), + value: VpcFirewallIcmpFilter.nullable(), + }), ]) ) @@ -4390,7 +4605,7 @@ export const VpcFirewallRuleTarget = z.preprocess( z.object({ type: z.enum(['vpc']), value: Name }), z.object({ type: z.enum(['subnet']), value: Name }), z.object({ type: z.enum(['instance']), value: Name }), - z.object({ type: z.enum(['ip']), value: z.string().ip() }), + z.object({ type: z.enum(['ip']), value: z.ipv4() }), z.object({ type: z.enum(['ip_net']), value: IpNet }), ]) ) @@ -4405,14 +4620,14 @@ export const VpcFirewallRule = z.preprocess( description: z.string(), direction: VpcFirewallRuleDirection, filters: VpcFirewallRuleFilter, - id: z.string().uuid(), + id: z.uuid(), name: Name, priority: z.number().min(0).max(65535), status: VpcFirewallRuleStatus, targets: VpcFirewallRuleTarget.array(), timeCreated: z.coerce.date(), timeModified: z.coerce.date(), - vpcId: z.string().uuid(), + vpcId: z.uuid(), }) ) @@ -4466,12 +4681,12 @@ export const VpcRouter = z.preprocess( processResponseBody, z.object({ description: z.string(), - id: z.string().uuid(), + id: z.uuid(), kind: VpcRouterKind, name: Name, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), - vpcId: z.string().uuid(), + vpcId: z.uuid(), }) ) @@ -4488,7 +4703,10 @@ export const VpcRouterCreate = z.preprocess( */ export const VpcRouterResultsPage = z.preprocess( processResponseBody, - z.object({ items: VpcRouter.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: VpcRouter.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -4508,15 +4726,15 @@ export const VpcRouterUpdate = z.preprocess( export const VpcSubnet = z.preprocess( processResponseBody, z.object({ - customRouterId: z.string().uuid().nullable().optional(), + customRouterId: z.uuid().nullable().optional(), description: z.string(), - id: z.string().uuid(), + id: z.uuid(), ipv4Block: Ipv4Net, ipv6Block: Ipv6Net, name: Name, timeCreated: z.coerce.date(), timeModified: z.coerce.date(), - vpcId: z.string().uuid(), + vpcId: z.uuid(), }) ) @@ -4539,7 +4757,10 @@ export const VpcSubnetCreate = z.preprocess( */ export const VpcSubnetResultsPage = z.preprocess( processResponseBody, - z.object({ items: VpcSubnet.array(), nextPage: z.string().nullable().optional() }) + z.object({ + items: VpcSubnet.array(), + nextPage: z.string().nullable().optional(), + }) ) /** @@ -4588,7 +4809,7 @@ export const WebhookReceiver = z.preprocess( z.object({ description: z.string(), endpoint: z.string(), - id: z.string().uuid(), + id: z.uuid(), name: Name, secrets: WebhookSecret.array(), subscriptions: AlertSubscription.array(), @@ -4760,7 +4981,7 @@ export const SupportBundleViewParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - bundleId: z.string().uuid(), + bundleId: z.uuid(), }), query: z.object({}), }) @@ -4770,7 +4991,7 @@ export const SupportBundleUpdateParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - bundleId: z.string().uuid(), + bundleId: z.uuid(), }), query: z.object({}), }) @@ -4780,7 +5001,7 @@ export const SupportBundleDeleteParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - bundleId: z.string().uuid(), + bundleId: z.uuid(), }), query: z.object({}), }) @@ -4790,7 +5011,7 @@ export const SupportBundleDownloadParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - bundleId: z.string().uuid(), + bundleId: z.uuid(), }), query: z.object({}), }) @@ -4800,7 +5021,7 @@ export const SupportBundleHeadParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - bundleId: z.string().uuid(), + bundleId: z.uuid(), }), query: z.object({}), }) @@ -4810,7 +5031,7 @@ export const SupportBundleDownloadFileParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - bundleId: z.string().uuid(), + bundleId: z.uuid(), file: z.string(), }), query: z.object({}), @@ -4821,7 +5042,7 @@ export const SupportBundleHeadFileParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - bundleId: z.string().uuid(), + bundleId: z.uuid(), file: z.string(), }), query: z.object({}), @@ -4832,7 +5053,7 @@ export const SupportBundleIndexParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - bundleId: z.string().uuid(), + bundleId: z.uuid(), }), query: z.object({}), }) @@ -5060,7 +5281,7 @@ export const AlertDeliveryResendParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - alertId: z.string().uuid(), + alertId: z.uuid(), }), query: z.object({ receiver: NameOrId, @@ -5431,7 +5652,7 @@ export const GroupViewParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - groupId: z.string().uuid(), + groupId: z.uuid(), }), query: z.object({}), }) @@ -5951,7 +6172,7 @@ export const CurrentUserAccessTokenDeleteParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - tokenId: z.string().uuid(), + tokenId: z.uuid(), }), query: z.object({}), }) @@ -6261,7 +6482,7 @@ export const PhysicalDiskViewParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - diskId: z.string().uuid(), + diskId: z.uuid(), }), query: z.object({}), }) @@ -6272,7 +6493,7 @@ export const NetworkingSwitchPortLldpNeighborsParams = z.preprocess( z.object({ path: z.object({ port: Name, - rackId: z.string().uuid(), + rackId: z.uuid(), switchLocation: Name, }), query: z.object({ @@ -6299,7 +6520,7 @@ export const RackViewParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - rackId: z.string().uuid(), + rackId: z.uuid(), }), query: z.object({}), }) @@ -6329,7 +6550,7 @@ export const SledViewParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - sledId: z.string().uuid(), + sledId: z.uuid(), }), query: z.object({}), }) @@ -6339,7 +6560,7 @@ export const SledPhysicalDiskListParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - sledId: z.string().uuid(), + sledId: z.uuid(), }), query: z.object({ limit: z.number().min(1).max(4294967295).nullable().optional(), @@ -6353,7 +6574,7 @@ export const SledInstanceListParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - sledId: z.string().uuid(), + sledId: z.uuid(), }), query: z.object({ limit: z.number().min(1).max(4294967295).nullable().optional(), @@ -6367,7 +6588,7 @@ export const SledSetProvisionPolicyParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - sledId: z.string().uuid(), + sledId: z.uuid(), }), query: z.object({}), }) @@ -6392,7 +6613,7 @@ export const NetworkingSwitchPortListParams = z.preprocess( limit: z.number().min(1).max(4294967295).nullable().optional(), pageToken: z.string().nullable().optional(), sortBy: IdSortMode.optional(), - switchPortId: z.string().uuid().nullable().optional(), + switchPortId: z.uuid().nullable().optional(), }), }) ) @@ -6404,7 +6625,7 @@ export const NetworkingSwitchPortLldpConfigViewParams = z.preprocess( port: Name, }), query: z.object({ - rackId: z.string().uuid(), + rackId: z.uuid(), switchLocation: Name, }), }) @@ -6417,7 +6638,7 @@ export const NetworkingSwitchPortLldpConfigUpdateParams = z.preprocess( port: Name, }), query: z.object({ - rackId: z.string().uuid(), + rackId: z.uuid(), switchLocation: Name, }), }) @@ -6430,7 +6651,7 @@ export const NetworkingSwitchPortApplySettingsParams = z.preprocess( port: Name, }), query: z.object({ - rackId: z.string().uuid(), + rackId: z.uuid(), switchLocation: Name, }), }) @@ -6443,7 +6664,7 @@ export const NetworkingSwitchPortClearSettingsParams = z.preprocess( port: Name, }), query: z.object({ - rackId: z.string().uuid(), + rackId: z.uuid(), switchLocation: Name, }), }) @@ -6456,7 +6677,7 @@ export const NetworkingSwitchPortStatusParams = z.preprocess( port: Name, }), query: z.object({ - rackId: z.string().uuid(), + rackId: z.uuid(), switchLocation: Name, }), }) @@ -6478,7 +6699,7 @@ export const SwitchViewParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - switchId: z.string().uuid(), + switchId: z.uuid(), }), query: z.object({}), }) @@ -6511,7 +6732,7 @@ export const LocalIdpUserDeleteParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - userId: z.string().uuid(), + userId: z.uuid(), }), query: z.object({ silo: NameOrId, @@ -6523,7 +6744,7 @@ export const LocalIdpUserSetPasswordParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - userId: z.string().uuid(), + userId: z.uuid(), }), query: z.object({ silo: NameOrId, @@ -6974,8 +7195,8 @@ export const NetworkingLoopbackAddressDeleteParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - address: z.string().ip(), - rackId: z.string().uuid(), + address: z.ipv4(), + rackId: z.uuid(), subnetMask: z.number().min(0).max(255), switchLocation: Name, }), @@ -7229,7 +7450,7 @@ export const SystemUpdateTrustRootViewParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - trustRootId: z.string().uuid(), + trustRootId: z.uuid(), }), query: z.object({}), }) @@ -7239,7 +7460,7 @@ export const SystemUpdateTrustRootDeleteParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - trustRootId: z.string().uuid(), + trustRootId: z.uuid(), }), query: z.object({}), }) @@ -7262,7 +7483,7 @@ export const SiloUserViewParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - userId: z.string().uuid(), + userId: z.uuid(), }), query: z.object({ silo: NameOrId, @@ -7329,7 +7550,7 @@ export const UserListParams = z.preprocess( z.object({ path: z.object({}), query: z.object({ - group: z.string().uuid().nullable().optional(), + group: z.uuid().nullable().optional(), limit: z.number().min(1).max(4294967295).nullable().optional(), pageToken: z.string().nullable().optional(), sortBy: IdSortMode.optional(), @@ -7341,7 +7562,7 @@ export const UserViewParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - userId: z.string().uuid(), + userId: z.uuid(), }), query: z.object({}), }) @@ -7351,7 +7572,7 @@ export const UserTokenListParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - userId: z.string().uuid(), + userId: z.uuid(), }), query: z.object({ limit: z.number().min(1).max(4294967295).nullable().optional(), @@ -7365,7 +7586,7 @@ export const UserLogoutParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - userId: z.string().uuid(), + userId: z.uuid(), }), query: z.object({}), }) @@ -7375,7 +7596,7 @@ export const UserSessionListParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - userId: z.string().uuid(), + userId: z.uuid(), }), query: z.object({ limit: z.number().min(1).max(4294967295).nullable().optional(), @@ -7729,7 +7950,7 @@ export const WebhookSecretsDeleteParams = z.preprocess( processResponseBody, z.object({ path: z.object({ - secretId: z.string().uuid(), + secretId: z.uuid(), }), query: z.object({}), }) From 23e9fe8a8e228d16328c340296c58d80b04fcc6b Mon Sep 17 00:00:00 2001 From: David Crespo Date: Fri, 15 Aug 2025 17:25:09 -0500 Subject: [PATCH 3/6] fix the failing tests --- mock-api/msw/handlers.ts | 10 ++++++---- mock-api/snapshot.ts | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mock-api/msw/handlers.ts b/mock-api/msw/handlers.ts index 6803c75b95..af6ad59fed 100644 --- a/mock-api/msw/handlers.ts +++ b/mock-api/msw/handlers.ts @@ -808,10 +808,12 @@ export const handlers = makeHandlers({ } updateDesc(nic, body) - if (typeof body.primary === 'boolean' && body.primary !== nic.primary) { - if (nic.primary) { - throw 'Cannot remove the primary interface' - } + // We used to error here if body.primary was false and nic.primary was true + // on the grounds that you can't unset the primary interface. But this turns + // out not to match the real API, which ignores primary: false. + // https://github.com/oxidecomputer/omicron/blob/61ad056c/nexus/db-queries/src/db/datastore/network_interface.rs?plain=1#L804-L808 + + if (typeof body.primary === 'boolean' && body.primary && !nic.primary) { db.networkInterfaces .filter((n) => n.instance_id === nic.instance_id) .forEach((n) => { diff --git a/mock-api/snapshot.ts b/mock-api/snapshot.ts index 52e4758308..cc3e6bd218 100644 --- a/mock-api/snapshot.ts +++ b/mock-api/snapshot.ts @@ -77,7 +77,7 @@ export const snapshots: Json[] = [ state: 'ready', }, { - id: '7fc6ca11-452e-d3e4-9e1c-752ff615abea', + id: '75832119-7d9b-4e91-a7c6-76b996b69aaa', name: 'snapshot-heavy', description: '', project_id: project.id, From 8b7fdc6dcb3e088b1aad1eca1807cb17693c6a52 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Fri, 15 Aug 2025 18:08:04 -0500 Subject: [PATCH 4/6] manually fix license headers (will be automatically handled when I do the generator) --- app/api/__generated__/msw-handlers.ts | 8 ++++++++ app/api/__generated__/validate.ts | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/app/api/__generated__/msw-handlers.ts b/app/api/__generated__/msw-handlers.ts index 9964f13654..a1a593469e 100644 --- a/app/api/__generated__/msw-handlers.ts +++ b/app/api/__generated__/msw-handlers.ts @@ -1,3 +1,11 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * Copyright Oxide Computer Company + */ + import { http, HttpResponse, diff --git a/app/api/__generated__/validate.ts b/app/api/__generated__/validate.ts index b872e93a23..3139ad4293 100644 --- a/app/api/__generated__/validate.ts +++ b/app/api/__generated__/validate.ts @@ -1,3 +1,11 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * Copyright Oxide Computer Company + */ + /* eslint-disable */ import { z, ZodType } from 'zod/v4' From f2c9c3f1fe6074a5cf83be961f33683181b46abb Mon Sep 17 00:00:00 2001 From: David Crespo Date: Fri, 15 Aug 2025 18:14:44 -0500 Subject: [PATCH 5/6] use the published generator --- app/api/__generated__/Api.ts | 173 +++-------- app/api/__generated__/validate.ts | 479 ++++++------------------------ package-lock.json | 8 +- package.json | 2 +- 4 files changed, 131 insertions(+), 531 deletions(-) diff --git a/app/api/__generated__/Api.ts b/app/api/__generated__/Api.ts index dd14a4ad8a..2580835b4f 100644 --- a/app/api/__generated__/Api.ts +++ b/app/api/__generated__/Api.ts @@ -272,10 +272,7 @@ export type AffinityGroupResultsPage = { /** * Updateable properties of an `AffinityGroup` */ -export type AffinityGroupUpdate = { - description?: string | null - name?: Name | null -} +export type AffinityGroupUpdate = { description?: string | null; name?: Name | null } export type BgpMessageHistory = Record @@ -614,10 +611,7 @@ export type AntiAffinityGroupResultsPage = { /** * Updateable properties of an `AntiAffinityGroup` */ -export type AntiAffinityGroupUpdate = { - description?: string | null - name?: Name | null -} +export type AntiAffinityGroupUpdate = { description?: string | null; name?: Name | null } /** * An identifier for an artifact. @@ -2126,10 +2120,7 @@ export type FloatingIpResultsPage = { /** * Updateable identity-related parameters */ -export type FloatingIpUpdate = { - description?: string | null - name?: Name | null -} +export type FloatingIpUpdate = { description?: string | null; name?: Name | null } /** * View of a Group @@ -2262,10 +2253,7 @@ export type ImageResultsPage = { /** * Parameters for importing blocks with a bulk write */ -export type ImportBlocksBulkWrite = { - base64EncodedData: string - offset: number -} +export type ImportBlocksBulkWrite = { base64EncodedData: string; offset: number } /** * A policy determining when an instance should be automatically restarted by the control plane. @@ -3065,11 +3053,7 @@ export type Values = { /** * Timepoints and values for one timeseries. */ -export type Points = { - startTimes?: Date[] | null - timestamps: Date[] - values: Values[] -} +export type Points = { startTimes?: Date[] | null; timestamps: Date[]; values: Values[] } /** * A timeseries contains a timestamped set of values from one source. @@ -4496,11 +4480,7 @@ export type TufRepoInsertResponse = { /** * A sled that has not been added to an initialized rack yet */ -export type UninitializedSled = { - baseboard: Baseboard - cubby: number - rackId: string -} +export type UninitializedSled = { baseboard: Baseboard; cubby: number; rackId: string } /** * The unique hardware ID for a sled @@ -4617,10 +4597,7 @@ export type UserResultsPage = { /** * Credentials for local user login */ -export type UsernamePasswordCredentials = { - password: Password - username: UserId -} +export type UsernamePasswordCredentials = { password: Password; username: UserId } /** * View of the current silo's resource utilization and capacity @@ -4669,10 +4646,7 @@ All IPv6 subnets created from this VPC must be taken from this range, which shou name: Name } -export type VpcFirewallIcmpFilter = { - code?: IcmpParamRange | null - icmpType: number -} +export type VpcFirewallIcmpFilter = { code?: IcmpParamRange | null; icmpType: number } export type VpcFirewallRuleAction = 'allow' | 'deny' @@ -4841,10 +4815,7 @@ export type VpcRouterResultsPage = { /** * Updateable properties of a `VpcRouter` */ -export type VpcRouterUpdate = { - description?: string | null - name?: Name | null -} +export type VpcRouterUpdate = { description?: string | null; name?: Name | null } /** * A VPC subnet represents a logical grouping for instances that allows network traffic between them, within a IPv4 subnetwork or optionally an IPv6 subnetwork. @@ -6829,10 +6800,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: AffinityGroupViewPathParams - query?: AffinityGroupViewQueryParams - }, + }: { path: AffinityGroupViewPathParams; query?: AffinityGroupViewQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -6872,10 +6840,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: AffinityGroupDeletePathParams - query?: AffinityGroupDeleteQueryParams - }, + }: { path: AffinityGroupDeletePathParams; query?: AffinityGroupDeleteQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -7026,10 +6991,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: AlertDeliveryListPathParams - query?: AlertDeliveryListQueryParams - }, + }: { path: AlertDeliveryListPathParams; query?: AlertDeliveryListQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -7046,10 +7008,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: AlertReceiverProbePathParams - query?: AlertReceiverProbeQueryParams - }, + }: { path: AlertReceiverProbePathParams; query?: AlertReceiverProbeQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -7066,10 +7025,7 @@ export class Api extends HttpClient { { path, body, - }: { - path: AlertReceiverSubscriptionAddPathParams - body: AlertSubscriptionCreate - }, + }: { path: AlertReceiverSubscriptionAddPathParams; body: AlertSubscriptionCreate }, params: FetchParams = {} ) => { return this.request({ @@ -7099,10 +7055,7 @@ export class Api extends HttpClient { { path, query, - }: { - path: AlertDeliveryResendPathParams - query: AlertDeliveryResendQueryParams - }, + }: { path: AlertDeliveryResendPathParams; query: AlertDeliveryResendQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -7133,10 +7086,7 @@ export class Api extends HttpClient { { query, body, - }: { - query: AntiAffinityGroupCreateQueryParams - body: AntiAffinityGroupCreate - }, + }: { query: AntiAffinityGroupCreateQueryParams; body: AntiAffinityGroupCreate }, params: FetchParams = {} ) => { return this.request({ @@ -7587,10 +7537,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: FloatingIpDeletePathParams - query?: FloatingIpDeleteQueryParams - }, + }: { path: FloatingIpDeletePathParams; query?: FloatingIpDeleteQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -7630,10 +7577,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: FloatingIpDetachPathParams - query?: FloatingIpDetachQueryParams - }, + }: { path: FloatingIpDetachPathParams; query?: FloatingIpDetachQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -7888,10 +7832,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: InstanceDiskListPathParams - query?: InstanceDiskListQueryParams - }, + }: { path: InstanceDiskListPathParams; query?: InstanceDiskListQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -8232,10 +8173,7 @@ export class Api extends HttpClient { { query, body, - }: { - query: InternetGatewayCreateQueryParams - body: InternetGatewayCreate - }, + }: { query: InternetGatewayCreateQueryParams; body: InternetGatewayCreate }, params: FetchParams = {} ) => { return this.request({ @@ -8253,10 +8191,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: InternetGatewayViewPathParams - query?: InternetGatewayViewQueryParams - }, + }: { path: InternetGatewayViewPathParams; query?: InternetGatewayViewQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -8864,10 +8799,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: SledPhysicalDiskListPathParams - query?: SledPhysicalDiskListQueryParams - }, + }: { path: SledPhysicalDiskListPathParams; query?: SledPhysicalDiskListQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -8884,10 +8816,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: SledInstanceListPathParams - query?: SledInstanceListQueryParams - }, + }: { path: SledInstanceListPathParams; query?: SledInstanceListQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -8904,10 +8833,7 @@ export class Api extends HttpClient { { path, body, - }: { - path: SledSetProvisionPolicyPathParams - body: SledProvisionPolicyParams - }, + }: { path: SledSetProvisionPolicyPathParams; body: SledProvisionPolicyParams }, params: FetchParams = {} ) => { return this.request({ @@ -9111,10 +9037,7 @@ export class Api extends HttpClient { { path, query, - }: { - path: LocalIdpUserDeletePathParams - query: LocalIdpUserDeleteQueryParams - }, + }: { path: LocalIdpUserDeletePathParams; query: LocalIdpUserDeleteQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -9154,10 +9077,7 @@ export class Api extends HttpClient { { query, body, - }: { - query: SamlIdentityProviderCreateQueryParams - body: SamlIdentityProviderCreate - }, + }: { query: SamlIdentityProviderCreateQueryParams; body: SamlIdentityProviderCreate }, params: FetchParams = {} ) => { return this.request({ @@ -9257,10 +9177,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: IpPoolRangeListPathParams - query?: IpPoolRangeListQueryParams - }, + }: { path: IpPoolRangeListPathParams; query?: IpPoolRangeListQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -10254,10 +10171,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: UserSessionListPathParams - query?: UserSessionListQueryParams - }, + }: { path: UserSessionListPathParams; query?: UserSessionListQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -10298,10 +10212,7 @@ export class Api extends HttpClient { { query, body, - }: { - query: VpcFirewallRulesUpdateQueryParams - body: VpcFirewallRuleUpdateParams - }, + }: { query: VpcFirewallRulesUpdateQueryParams; body: VpcFirewallRuleUpdateParams }, params: FetchParams = {} ) => { return this.request({ @@ -10348,10 +10259,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: VpcRouterRouteViewPathParams - query?: VpcRouterRouteViewQueryParams - }, + }: { path: VpcRouterRouteViewPathParams; query?: VpcRouterRouteViewQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -10391,10 +10299,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: VpcRouterRouteDeletePathParams - query?: VpcRouterRouteDeleteQueryParams - }, + }: { path: VpcRouterRouteDeletePathParams; query?: VpcRouterRouteDeleteQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -10480,10 +10385,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: VpcRouterDeletePathParams - query?: VpcRouterDeleteQueryParams - }, + }: { path: VpcRouterDeletePathParams; query?: VpcRouterDeleteQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -10569,10 +10471,7 @@ export class Api extends HttpClient { { path, query = {}, - }: { - path: VpcSubnetDeletePathParams - query?: VpcSubnetDeleteQueryParams - }, + }: { path: VpcSubnetDeletePathParams; query?: VpcSubnetDeleteQueryParams }, params: FetchParams = {} ) => { return this.request({ @@ -10650,11 +10549,7 @@ export class Api extends HttpClient { path, query = {}, body, - }: { - path: VpcUpdatePathParams - query?: VpcUpdateQueryParams - body: VpcUpdate - }, + }: { path: VpcUpdatePathParams; query?: VpcUpdateQueryParams; body: VpcUpdate }, params: FetchParams = {} ) => { return this.request({ diff --git a/app/api/__generated__/validate.ts b/app/api/__generated__/validate.ts index 3139ad4293..aa341271a8 100644 --- a/app/api/__generated__/validate.ts +++ b/app/api/__generated__/validate.ts @@ -134,10 +134,7 @@ export const AddressLotBlockCreate = z.preprocess( */ export const AddressLotBlockResultsPage = z.preprocess( processResponseBody, - z.object({ - items: AddressLotBlock.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: AddressLotBlock.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -166,10 +163,7 @@ export const AddressLotCreateResponse = z.preprocess( */ export const AddressLotResultsPage = z.preprocess( processResponseBody, - z.object({ - items: AddressLot.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: AddressLot.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -248,11 +242,7 @@ export const AffinityGroupMember = z.preprocess( processResponseBody, z.object({ type: z.enum(['instance']), - value: z.object({ - id: TypedUuidForInstanceKind, - name: Name, - runState: InstanceState, - }), + value: z.object({ id: TypedUuidForInstanceKind, name: Name, runState: InstanceState }), }) ) @@ -272,10 +262,7 @@ export const AffinityGroupMemberResultsPage = z.preprocess( */ export const AffinityGroupResultsPage = z.preprocess( processResponseBody, - z.object({ - items: AffinityGroup.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: AffinityGroup.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -307,10 +294,7 @@ export const SwitchLocation = z.preprocess( */ export const SwitchBgpHistory = z.preprocess( processResponseBody, - z.object({ - history: z.record(z.string(), BgpMessageHistory), - switch: SwitchLocation, - }) + z.object({ history: z.record(z.string(), BgpMessageHistory), switch: SwitchLocation }) ) /** @@ -334,10 +318,7 @@ export const AlertClass = z.preprocess( */ export const AlertClassResultsPage = z.preprocess( processResponseBody, - z.object({ - items: AlertClass.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: AlertClass.array(), nextPage: z.string().nullable().optional() }) ) export const TypedUuidForAlertKind = z.preprocess(processResponseBody, z.uuid()) @@ -347,10 +328,7 @@ export const TypedUuidForAlertKind = z.preprocess(processResponseBody, z.uuid()) */ export const WebhookDeliveryResponse = z.preprocess( processResponseBody, - z.object({ - durationMs: z.number().min(0), - status: z.number().min(0).max(65535), - }) + z.object({ durationMs: z.number().min(0), status: z.number().min(0).max(65535) }) ) export const WebhookDeliveryAttemptResult = z.preprocess( @@ -428,10 +406,7 @@ export const AlertDeliveryId = z.preprocess( */ export const AlertDeliveryResultsPage = z.preprocess( processResponseBody, - z.object({ - items: AlertDelivery.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: AlertDelivery.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -498,10 +473,7 @@ export const AlertReceiver = z.preprocess( */ export const AlertReceiverResultsPage = z.preprocess( processResponseBody, - z.object({ - items: AlertReceiver.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: AlertReceiver.array(), nextPage: z.string().nullable().optional() }) ) export const AlertSubscriptionCreate = z.preprocess( @@ -586,11 +558,7 @@ export const AntiAffinityGroupMember = z.preprocess( processResponseBody, z.object({ type: z.enum(['instance']), - value: z.object({ - id: TypedUuidForInstanceKind, - name: Name, - runState: InstanceState, - }), + value: z.object({ id: TypedUuidForInstanceKind, name: Name, runState: InstanceState }), }) ) @@ -610,10 +578,7 @@ export const AntiAffinityGroupMemberResultsPage = z.preprocess( */ export const AntiAffinityGroupResultsPage = z.preprocess( processResponseBody, - z.object({ - items: AntiAffinityGroup.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: AntiAffinityGroup.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -639,11 +604,7 @@ export const AuditLogEntryActor = z.preprocess( processResponseBody, z.union([ z.object({ kind: z.enum(['user_builtin']), userBuiltinId: z.uuid() }), - z.object({ - kind: z.enum(['silo_user']), - siloId: z.uuid(), - siloUserId: z.uuid(), - }), + z.object({ kind: z.enum(['silo_user']), siloId: z.uuid(), siloUserId: z.uuid() }), z.object({ kind: z.enum(['unauthenticated']) }), ]) ) @@ -654,10 +615,7 @@ export const AuditLogEntryActor = z.preprocess( export const AuditLogEntryResult = z.preprocess( processResponseBody, z.union([ - z.object({ - httpStatusCode: z.number().min(0).max(65535), - kind: z.enum(['success']), - }), + z.object({ httpStatusCode: z.number().min(0).max(65535), kind: z.enum(['success']) }), z.object({ errorCode: z.string().nullable().optional(), errorMessage: z.string(), @@ -693,10 +651,7 @@ export const AuditLogEntry = z.preprocess( */ export const AuditLogEntryResultsPage = z.preprocess( processResponseBody, - z.object({ - items: AuditLogEntry.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: AuditLogEntry.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -809,11 +764,7 @@ export const BgpAnnounceSetCreate = z.preprocess( */ export const BgpAnnouncement = z.preprocess( processResponseBody, - z.object({ - addressLotBlockId: z.uuid(), - announceSetId: z.uuid(), - network: IpNet, - }) + z.object({ addressLotBlockId: z.uuid(), announceSetId: z.uuid(), network: IpNet }) ) /** @@ -851,10 +802,7 @@ export const BgpConfigCreate = z.preprocess( */ export const BgpConfigResultsPage = z.preprocess( processResponseBody, - z.object({ - items: BgpConfig.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: BgpConfig.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -988,19 +936,13 @@ export const BinRangefloat = z.preprocess( export const BinRangeint16 = z.preprocess( processResponseBody, z.union([ - z.object({ - end: z.number().min(-32767).max(32767), - type: z.enum(['range_to']), - }), + z.object({ end: z.number().min(-32767).max(32767), type: z.enum(['range_to']) }), z.object({ end: z.number().min(-32767).max(32767), start: z.number().min(-32767).max(32767), type: z.enum(['range']), }), - z.object({ - start: z.number().min(-32767).max(32767), - type: z.enum(['range_from']), - }), + z.object({ start: z.number().min(-32767).max(32767), type: z.enum(['range_from']) }), ]) ) @@ -1050,19 +992,13 @@ export const BinRangeint64 = z.preprocess( export const BinRangeint8 = z.preprocess( processResponseBody, z.union([ - z.object({ - end: z.number().min(-127).max(127), - type: z.enum(['range_to']), - }), + z.object({ end: z.number().min(-127).max(127), type: z.enum(['range_to']) }), z.object({ end: z.number().min(-127).max(127), start: z.number().min(-127).max(127), type: z.enum(['range']), }), - z.object({ - start: z.number().min(-127).max(127), - type: z.enum(['range_from']), - }), + z.object({ start: z.number().min(-127).max(127), type: z.enum(['range_from']) }), ]) ) @@ -1080,10 +1016,7 @@ export const BinRangeuint16 = z.preprocess( start: z.number().min(0).max(65535), type: z.enum(['range']), }), - z.object({ - start: z.number().min(0).max(65535), - type: z.enum(['range_from']), - }), + z.object({ start: z.number().min(0).max(65535), type: z.enum(['range_from']) }), ]) ) @@ -1095,19 +1028,13 @@ export const BinRangeuint16 = z.preprocess( export const BinRangeuint32 = z.preprocess( processResponseBody, z.union([ - z.object({ - end: z.number().min(0).max(4294967295), - type: z.enum(['range_to']), - }), + z.object({ end: z.number().min(0).max(4294967295), type: z.enum(['range_to']) }), z.object({ end: z.number().min(0).max(4294967295), start: z.number().min(0).max(4294967295), type: z.enum(['range']), }), - z.object({ - start: z.number().min(0).max(4294967295), - type: z.enum(['range_from']), - }), + z.object({ start: z.number().min(0).max(4294967295), type: z.enum(['range_from']) }), ]) ) @@ -1120,11 +1047,7 @@ export const BinRangeuint64 = z.preprocess( processResponseBody, z.union([ z.object({ end: z.number().min(0), type: z.enum(['range_to']) }), - z.object({ - end: z.number().min(0), - start: z.number().min(0), - type: z.enum(['range']), - }), + z.object({ end: z.number().min(0), start: z.number().min(0), type: z.enum(['range']) }), z.object({ start: z.number().min(0), type: z.enum(['range_from']) }), ]) ) @@ -1143,10 +1066,7 @@ export const BinRangeuint8 = z.preprocess( start: z.number().min(0).max(255), type: z.enum(['range']), }), - z.object({ - start: z.number().min(0).max(255), - type: z.enum(['range_from']), - }), + z.object({ start: z.number().min(0).max(255), type: z.enum(['range_from']) }), ]) ) @@ -1286,10 +1206,7 @@ export const CertificateCreate = z.preprocess( */ export const CertificateResultsPage = z.preprocess( processResponseBody, - z.object({ - items: Certificate.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: Certificate.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -1297,11 +1214,7 @@ export const CertificateResultsPage = z.preprocess( */ export const ConsoleSession = z.preprocess( processResponseBody, - z.object({ - id: z.uuid(), - timeCreated: z.coerce.date(), - timeLastUsed: z.coerce.date(), - }) + z.object({ id: z.uuid(), timeCreated: z.coerce.date(), timeLastUsed: z.coerce.date() }) ) /** @@ -1309,10 +1222,7 @@ export const ConsoleSession = z.preprocess( */ export const ConsoleSessionResultsPage = z.preprocess( processResponseBody, - z.object({ - items: ConsoleSession.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: ConsoleSession.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -1352,12 +1262,7 @@ export const Cumulativeuint64 = z.preprocess( */ export const CurrentUser = z.preprocess( processResponseBody, - z.object({ - displayName: z.string(), - id: z.uuid(), - siloId: z.uuid(), - siloName: Name, - }) + z.object({ displayName: z.string(), id: z.uuid(), siloId: z.uuid(), siloName: Name }) ) /** @@ -1645,10 +1550,7 @@ export const DatumType = z.preprocess( export const MissingDatum = z.preprocess( processResponseBody, - z.object({ - datumType: DatumType, - startTime: z.coerce.date().nullable().optional(), - }) + z.object({ datumType: DatumType, startTime: z.coerce.date().nullable().optional() }) ) /** @@ -1660,28 +1562,16 @@ export const Datum = z.preprocess( z.object({ datum: SafeBoolean, type: z.enum(['bool']) }), z.object({ datum: z.number().min(-127).max(127), type: z.enum(['i8']) }), z.object({ datum: z.number().min(0).max(255), type: z.enum(['u8']) }), - z.object({ - datum: z.number().min(-32767).max(32767), - type: z.enum(['i16']), - }), + z.object({ datum: z.number().min(-32767).max(32767), type: z.enum(['i16']) }), z.object({ datum: z.number().min(0).max(65535), type: z.enum(['u16']) }), - z.object({ - datum: z.number().min(-2147483647).max(2147483647), - type: z.enum(['i32']), - }), - z.object({ - datum: z.number().min(0).max(4294967295), - type: z.enum(['u32']), - }), + z.object({ datum: z.number().min(-2147483647).max(2147483647), type: z.enum(['i32']) }), + z.object({ datum: z.number().min(0).max(4294967295), type: z.enum(['u32']) }), z.object({ datum: z.number(), type: z.enum(['i64']) }), z.object({ datum: z.number().min(0), type: z.enum(['u64']) }), z.object({ datum: z.number(), type: z.enum(['f32']) }), z.object({ datum: z.number(), type: z.enum(['f64']) }), z.object({ datum: z.string(), type: z.enum(['string']) }), - z.object({ - datum: z.number().min(0).max(255).array(), - type: z.enum(['bytes']), - }), + z.object({ datum: z.number().min(0).max(255).array(), type: z.enum(['bytes']) }), z.object({ datum: Cumulativeint64, type: z.enum(['cumulative_i64']) }), z.object({ datum: Cumulativeuint64, type: z.enum(['cumulative_u64']) }), z.object({ datum: Cumulativefloat, type: z.enum(['cumulative_f32']) }), @@ -1719,11 +1609,7 @@ export const DeviceAccessToken = z.preprocess( export const DeviceAccessTokenRequest = z.preprocess( processResponseBody, - z.object({ - clientId: z.uuid(), - deviceCode: z.string(), - grantType: z.string(), - }) + z.object({ clientId: z.uuid(), deviceCode: z.string(), grantType: z.string() }) ) /** @@ -1731,10 +1617,7 @@ export const DeviceAccessTokenRequest = z.preprocess( */ export const DeviceAccessTokenResultsPage = z.preprocess( processResponseBody, - z.object({ - items: DeviceAccessToken.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: DeviceAccessToken.array(), nextPage: z.string().nullable().optional() }) ) export const DeviceAuthRequest = z.preprocess( @@ -1815,12 +1698,7 @@ export const DiskSource = z.preprocess( */ export const DiskCreate = z.preprocess( processResponseBody, - z.object({ - description: z.string(), - diskSource: DiskSource, - name: Name, - size: ByteCount, - }) + z.object({ description: z.string(), diskSource: DiskSource, name: Name, size: ByteCount }) ) export const DiskPath = z.preprocess(processResponseBody, z.object({ disk: NameOrId })) @@ -1886,11 +1764,7 @@ export const EphemeralIpCreate = z.preprocess( */ export const Error = z.preprocess( processResponseBody, - z.object({ - errorCode: z.string().optional(), - message: z.string(), - requestId: z.string(), - }) + z.object({ errorCode: z.string().optional(), message: z.string(), requestId: z.string() }) ) export const ExternalIp = z.preprocess( @@ -1925,10 +1799,7 @@ export const ExternalIp = z.preprocess( export const ExternalIpCreate = z.preprocess( processResponseBody, z.union([ - z.object({ - pool: NameOrId.nullable().optional(), - type: z.enum(['ephemeral']), - }), + z.object({ pool: NameOrId.nullable().optional(), type: z.enum(['ephemeral']) }), z.object({ floatingIp: NameOrId, type: z.enum(['floating']) }), ]) ) @@ -1938,10 +1809,7 @@ export const ExternalIpCreate = z.preprocess( */ export const ExternalIpResultsPage = z.preprocess( processResponseBody, - z.object({ - items: ExternalIp.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: ExternalIp.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -1992,19 +1860,10 @@ export const FieldValue = z.preprocess( z.object({ type: z.enum(['string']), value: z.string() }), z.object({ type: z.enum(['i8']), value: z.number().min(-127).max(127) }), z.object({ type: z.enum(['u8']), value: z.number().min(0).max(255) }), - z.object({ - type: z.enum(['i16']), - value: z.number().min(-32767).max(32767), - }), + z.object({ type: z.enum(['i16']), value: z.number().min(-32767).max(32767) }), z.object({ type: z.enum(['u16']), value: z.number().min(0).max(65535) }), - z.object({ - type: z.enum(['i32']), - value: z.number().min(-2147483647).max(2147483647), - }), - z.object({ - type: z.enum(['u32']), - value: z.number().min(0).max(4294967295), - }), + z.object({ type: z.enum(['i32']), value: z.number().min(-2147483647).max(2147483647) }), + z.object({ type: z.enum(['u32']), value: z.number().min(0).max(4294967295) }), z.object({ type: z.enum(['i64']), value: z.number() }), z.object({ type: z.enum(['u64']), value: z.number().min(0) }), z.object({ type: z.enum(['ip_addr']), value: z.ipv4() }), @@ -2041,11 +1900,7 @@ export const IdentityType = z.preprocess( */ export const FleetRoleRoleAssignment = z.preprocess( processResponseBody, - z.object({ - identityId: z.uuid(), - identityType: IdentityType, - roleName: FleetRole, - }) + z.object({ identityId: z.uuid(), identityType: IdentityType, roleName: FleetRole }) ) /** @@ -2107,10 +1962,7 @@ export const FloatingIpCreate = z.preprocess( */ export const FloatingIpResultsPage = z.preprocess( processResponseBody, - z.object({ - items: FloatingIp.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: FloatingIp.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -2137,10 +1989,7 @@ export const Group = z.preprocess( */ export const GroupResultsPage = z.preprocess( processResponseBody, - z.object({ - items: Group.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: Group.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -2193,10 +2042,7 @@ export const IdentityProvider = z.preprocess( */ export const IdentityProviderResultsPage = z.preprocess( processResponseBody, - z.object({ - items: IdentityProvider.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: IdentityProvider.array(), nextPage: z.string().nullable().optional() }) ) export const IdpMetadataSource = z.preprocess( @@ -2256,10 +2102,7 @@ export const ImageCreate = z.preprocess( */ export const ImageResultsPage = z.preprocess( processResponseBody, - z.object({ - items: Image.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: Image.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -2348,10 +2191,7 @@ export const InstanceNetworkInterfaceCreate = z.preprocess( export const InstanceNetworkInterfaceAttachment = z.preprocess( processResponseBody, z.union([ - z.object({ - params: InstanceNetworkInterfaceCreate.array(), - type: z.enum(['create']), - }), + z.object({ params: InstanceNetworkInterfaceCreate.array(), type: z.enum(['create']) }), z.object({ type: z.enum(['default']) }), z.object({ type: z.enum(['none']) }), ]) @@ -2448,10 +2288,7 @@ export const InstanceNetworkInterfaceUpdate = z.preprocess( */ export const InstanceResultsPage = z.preprocess( processResponseBody, - z.object({ - items: Instance.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: Instance.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -2459,10 +2296,7 @@ export const InstanceResultsPage = z.preprocess( */ export const InstanceSerialConsoleData = z.preprocess( processResponseBody, - z.object({ - data: z.number().min(0).max(255).array(), - lastByteOffset: z.number().min(0), - }) + z.object({ data: z.number().min(0).max(255).array(), lastByteOffset: z.number().min(0) }) ) /** @@ -2585,10 +2419,7 @@ export const InternetGatewayIpPoolResultsPage = z.preprocess( */ export const InternetGatewayResultsPage = z.preprocess( processResponseBody, - z.object({ - items: InternetGateway.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: InternetGateway.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -2655,10 +2486,7 @@ export const IpPoolRange = z.preprocess( */ export const IpPoolRangeResultsPage = z.preprocess( processResponseBody, - z.object({ - items: IpPoolRange.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: IpPoolRange.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -2666,10 +2494,7 @@ export const IpPoolRangeResultsPage = z.preprocess( */ export const IpPoolResultsPage = z.preprocess( processResponseBody, - z.object({ - items: IpPool.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: IpPool.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -2685,10 +2510,7 @@ export const IpPoolSiloLink = z.preprocess( */ export const IpPoolSiloLinkResultsPage = z.preprocess( processResponseBody, - z.object({ - items: IpPoolSiloLink.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: IpPoolSiloLink.array(), nextPage: z.string().nullable().optional() }) ) export const IpPoolSiloUpdate = z.preprocess( @@ -2865,10 +2687,7 @@ export const LldpNeighbor = z.preprocess( */ export const LldpNeighborResultsPage = z.preprocess( processResponseBody, - z.object({ - items: LldpNeighbor.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: LldpNeighbor.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -2905,10 +2724,7 @@ export const LoopbackAddressCreate = z.preprocess( */ export const LoopbackAddressResultsPage = z.preprocess( processResponseBody, - z.object({ - items: LoopbackAddress.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: LoopbackAddress.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -2924,10 +2740,7 @@ export const Measurement = z.preprocess( */ export const MeasurementResultsPage = z.preprocess( processResponseBody, - z.object({ - items: Measurement.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: Measurement.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -2982,22 +2795,10 @@ export const NetworkInterface = z.preprocess( export const ValueArray = z.preprocess( processResponseBody, z.union([ - z.object({ - type: z.enum(['integer']), - values: z.number().nullable().array(), - }), - z.object({ - type: z.enum(['double']), - values: z.number().nullable().array(), - }), - z.object({ - type: z.enum(['boolean']), - values: SafeBoolean.nullable().array(), - }), - z.object({ - type: z.enum(['string']), - values: z.string().nullable().array(), - }), + z.object({ type: z.enum(['integer']), values: z.number().nullable().array() }), + z.object({ type: z.enum(['double']), values: z.number().nullable().array() }), + z.object({ type: z.enum(['boolean']), values: SafeBoolean.nullable().array() }), + z.object({ type: z.enum(['string']), values: z.string().nullable().array() }), z.object({ type: z.enum(['integer_distribution']), values: Distributionint64.nullable().array(), @@ -3114,10 +2915,7 @@ export const PhysicalDisk = z.preprocess( */ export const PhysicalDiskResultsPage = z.preprocess( processResponseBody, - z.object({ - items: PhysicalDisk.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: PhysicalDisk.array(), nextPage: z.string().nullable().optional() }) ) export const PingStatus = z.preprocess(processResponseBody, z.enum(['ok'])) @@ -3183,10 +2981,7 @@ export const ProbeInfo = z.preprocess( */ export const ProbeInfoResultsPage = z.preprocess( processResponseBody, - z.object({ - items: ProbeInfo.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: ProbeInfo.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -3216,10 +3011,7 @@ export const ProjectCreate = z.preprocess( */ export const ProjectResultsPage = z.preprocess( processResponseBody, - z.object({ - items: Project.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: Project.array(), nextPage: z.string().nullable().optional() }) ) export const ProjectRole = z.preprocess( @@ -3234,11 +3026,7 @@ export const ProjectRole = z.preprocess( */ export const ProjectRoleRoleAssignment = z.preprocess( processResponseBody, - z.object({ - identityId: z.uuid(), - identityType: IdentityType, - roleName: ProjectRole, - }) + z.object({ identityId: z.uuid(), identityType: IdentityType, roleName: ProjectRole }) ) /** @@ -3267,11 +3055,7 @@ export const ProjectUpdate = z.preprocess( */ export const Rack = z.preprocess( processResponseBody, - z.object({ - id: z.uuid(), - timeCreated: z.coerce.date(), - timeModified: z.coerce.date(), - }) + z.object({ id: z.uuid(), timeCreated: z.coerce.date(), timeModified: z.coerce.date() }) ) /** @@ -3379,10 +3163,7 @@ export const RouterRouteCreate = z.preprocess( */ export const RouterRouteResultsPage = z.preprocess( processResponseBody, - z.object({ - items: RouterRoute.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: RouterRoute.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -3503,9 +3284,7 @@ export const SiloAuthSettings = z.preprocess( */ export const SiloAuthSettingsUpdate = z.preprocess( processResponseBody, - z.object({ - deviceTokenMaxTtlSeconds: z.number().min(1).max(4294967295).nullable(), - }) + z.object({ deviceTokenMaxTtlSeconds: z.number().min(1).max(4294967295).nullable() }) ) /** @@ -3555,10 +3334,7 @@ export const SiloIpPool = z.preprocess( */ export const SiloIpPoolResultsPage = z.preprocess( processResponseBody, - z.object({ - items: SiloIpPool.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: SiloIpPool.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -3566,12 +3342,7 @@ export const SiloIpPoolResultsPage = z.preprocess( */ export const SiloQuotas = z.preprocess( processResponseBody, - z.object({ - cpus: z.number(), - memory: ByteCount, - siloId: z.uuid(), - storage: ByteCount, - }) + z.object({ cpus: z.number(), memory: ByteCount, siloId: z.uuid(), storage: ByteCount }) ) /** @@ -3579,10 +3350,7 @@ export const SiloQuotas = z.preprocess( */ export const SiloQuotasResultsPage = z.preprocess( processResponseBody, - z.object({ - items: SiloQuotas.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: SiloQuotas.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -3617,11 +3385,7 @@ export const SiloRole = z.preprocess( */ export const SiloRoleRoleAssignment = z.preprocess( processResponseBody, - z.object({ - identityId: z.uuid(), - identityType: IdentityType, - roleName: SiloRole, - }) + z.object({ identityId: z.uuid(), identityType: IdentityType, roleName: SiloRole }) ) /** @@ -3660,10 +3424,7 @@ export const SiloUtilization = z.preprocess( */ export const SiloUtilizationResultsPage = z.preprocess( processResponseBody, - z.object({ - items: SiloUtilization.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: SiloUtilization.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -3682,10 +3443,7 @@ export const SledProvisionPolicy = z.preprocess( export const SledPolicy = z.preprocess( processResponseBody, z.union([ - z.object({ - kind: z.enum(['in_service']), - provisionPolicy: SledProvisionPolicy, - }), + z.object({ kind: z.enum(['in_service']), provisionPolicy: SledProvisionPolicy }), z.object({ kind: z.enum(['expunged']) }), ]) ) @@ -3746,10 +3504,7 @@ export const SledInstance = z.preprocess( */ export const SledInstanceResultsPage = z.preprocess( processResponseBody, - z.object({ - items: SledInstance.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: SledInstance.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -3812,10 +3567,7 @@ export const SnapshotCreate = z.preprocess( */ export const SnapshotResultsPage = z.preprocess( processResponseBody, - z.object({ - items: Snapshot.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: Snapshot.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -3847,10 +3599,7 @@ export const SshKeyCreate = z.preprocess( */ export const SshKeyResultsPage = z.preprocess( processResponseBody, - z.object({ - items: SshKey.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: SshKey.array(), nextPage: z.string().nullable().optional() }) ) export const SupportBundleCreate = z.preprocess( @@ -3882,10 +3631,7 @@ export const SupportBundleInfo = z.preprocess( */ export const SupportBundleInfoResultsPage = z.preprocess( processResponseBody, - z.object({ - items: SupportBundleInfo.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: SupportBundleInfo.array(), nextPage: z.string().nullable().optional() }) ) export const SupportBundleUpdate = z.preprocess( @@ -3946,11 +3692,7 @@ export const SwitchInterfaceKind = z.preprocess( */ export const SwitchInterfaceConfigCreate = z.preprocess( processResponseBody, - z.object({ - kind: SwitchInterfaceKind, - linkName: Name, - v6Enabled: SafeBoolean, - }) + z.object({ kind: SwitchInterfaceKind, linkName: Name, v6Enabled: SafeBoolean }) ) export const SwitchLinkState = z.preprocess( @@ -4064,10 +3806,7 @@ export const SwitchPortLinkConfig = z.preprocess( */ export const SwitchPortResultsPage = z.preprocess( processResponseBody, - z.object({ - items: SwitchPort.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: SwitchPort.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -4098,10 +3837,7 @@ export const SwitchPortSettingsGroups = z.preprocess( */ export const SwitchVlanInterfaceConfig = z.preprocess( processResponseBody, - z.object({ - interfaceConfigId: z.uuid(), - vlanId: z.number().min(0).max(65535), - }) + z.object({ interfaceConfigId: z.uuid(), vlanId: z.number().min(0).max(65535) }) ) /** @@ -4174,10 +3910,7 @@ export const SwitchPortSettingsIdentityResultsPage = z.preprocess( */ export const SwitchResultsPage = z.preprocess( processResponseBody, - z.object({ - items: Switch.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: Switch.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -4283,10 +4016,7 @@ export const TimeseriesSchema = z.preprocess( */ export const TimeseriesSchemaResultsPage = z.preprocess( processResponseBody, - z.object({ - items: TimeseriesSchema.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: TimeseriesSchema.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -4363,11 +4093,7 @@ export const TufRepoInsertResponse = z.preprocess( */ export const UninitializedSled = z.preprocess( processResponseBody, - z.object({ - baseboard: Baseboard, - cubby: z.number().min(0).max(65535), - rackId: z.uuid(), - }) + z.object({ baseboard: Baseboard, cubby: z.number().min(0).max(65535), rackId: z.uuid() }) ) /** @@ -4383,10 +4109,7 @@ export const UninitializedSledId = z.preprocess( */ export const UninitializedSledResultsPage = z.preprocess( processResponseBody, - z.object({ - items: UninitializedSled.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: UninitializedSled.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -4406,10 +4129,7 @@ export const UpdatesTrustRoot = z.preprocess( */ export const UpdatesTrustRootResultsPage = z.preprocess( processResponseBody, - z.object({ - items: UpdatesTrustRoot.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: UpdatesTrustRoot.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -4441,10 +4161,7 @@ export const UserBuiltin = z.preprocess( */ export const UserBuiltinResultsPage = z.preprocess( processResponseBody, - z.object({ - items: UserBuiltin.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: UserBuiltin.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -4503,10 +4220,7 @@ export const UsernamePasswordCredentials = z.preprocess( */ export const Utilization = z.preprocess( processResponseBody, - z.object({ - capacity: VirtualResourceCounts, - provisioned: VirtualResourceCounts, - }) + z.object({ capacity: VirtualResourceCounts, provisioned: VirtualResourceCounts }) ) /** @@ -4580,10 +4294,7 @@ export const VpcFirewallRuleProtocol = z.preprocess( z.union([ z.object({ type: z.enum(['tcp']) }), z.object({ type: z.enum(['udp']) }), - z.object({ - type: z.enum(['icmp']), - value: VpcFirewallIcmpFilter.nullable(), - }), + z.object({ type: z.enum(['icmp']), value: VpcFirewallIcmpFilter.nullable() }), ]) ) @@ -4711,10 +4422,7 @@ export const VpcRouterCreate = z.preprocess( */ export const VpcRouterResultsPage = z.preprocess( processResponseBody, - z.object({ - items: VpcRouter.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: VpcRouter.array(), nextPage: z.string().nullable().optional() }) ) /** @@ -4765,10 +4473,7 @@ export const VpcSubnetCreate = z.preprocess( */ export const VpcSubnetResultsPage = z.preprocess( processResponseBody, - z.object({ - items: VpcSubnet.array(), - nextPage: z.string().nullable().optional(), - }) + z.object({ items: VpcSubnet.array(), nextPage: z.string().nullable().optional() }) ) /** diff --git a/package-lock.json b/package-lock.json index bcb3cae770..6bdcc55209 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,7 +56,7 @@ "devDependencies": { "@ianvs/prettier-plugin-sort-imports": "^4.4.1", "@mswjs/http-middleware": "^0.10.3", - "@oxide/openapi-gen-ts": "~0.8.1", + "@oxide/openapi-gen-ts": "~0.9.0", "@playwright/test": "^1.54.1", "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "^6.6.3", @@ -1576,9 +1576,9 @@ } }, "node_modules/@oxide/openapi-gen-ts": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@oxide/openapi-gen-ts/-/openapi-gen-ts-0.8.1.tgz", - "integrity": "sha512-2U9n2qFOemfVm8mAxkgmCLvQL43OXggyvZybjSN9q54WxLgXz3Wl3pG73+mHgXVpfNsBOvrCEscZf/gy4iS1cQ==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@oxide/openapi-gen-ts/-/openapi-gen-ts-0.9.0.tgz", + "integrity": "sha512-Yw6L8knvhAOonz3KS4RMHciWe7FEp6ry1pWoI0SRGRh6snAetwbI6dj9ZwCx2J8nM2lclSS3r99toF5C9Ux5Gw==", "dev": true, "license": "MPL-2.0", "dependencies": { diff --git a/package.json b/package.json index dd0f998723..7fcaea878b 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "devDependencies": { "@ianvs/prettier-plugin-sort-imports": "^4.4.1", "@mswjs/http-middleware": "^0.10.3", - "@oxide/openapi-gen-ts": "~0.8.1", + "@oxide/openapi-gen-ts": "~0.9.0", "@playwright/test": "^1.54.1", "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "^6.6.3", From 7cc600e22a569c4eefecca4465998ebd2f867175 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Fri, 15 Aug 2025 18:16:59 -0500 Subject: [PATCH 6/6] use zod v4 in vite and use real v4 package --- package-lock.json | 8 ++++---- package.json | 2 +- vite.config.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6bdcc55209..54fbd9c180 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "tunnel-rat": "^0.1.2", "use-debounce": "^10.0.4", "uuid": "^10.0.0", - "zod": "^3.25.76", + "zod": "^4.0.17", "zustand": "^5.0.3" }, "devDependencies": { @@ -15261,9 +15261,9 @@ } }, "node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.0.17.tgz", + "integrity": "sha512-1PHjlYRevNxxdy2JZ8JcNAw7rX8V9P1AKkP+x/xZfxB0K5FYfuV+Ug6P/6NVSR2jHQ+FzDDoDHS04nYUsOIyLQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/package.json b/package.json index 7fcaea878b..2ec84415a9 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "tunnel-rat": "^0.1.2", "use-debounce": "^10.0.4", "uuid": "^10.0.0", - "zod": "^3.25.76", + "zod": "^4.0.17", "zustand": "^5.0.3" }, "devDependencies": { diff --git a/vite.config.ts b/vite.config.ts index e344433a93..e0645c1509 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,7 +12,7 @@ import react from '@vitejs/plugin-react-swc' import { defineConfig } from 'vite' import { createHtmlPlugin } from 'vite-plugin-html' import tsconfigPaths from 'vite-tsconfig-paths' -import { z } from 'zod' +import { z } from 'zod/v4' import vercelConfig from './vercel.json'