From c975c322f43545e8b21ba2e9452c12b85ac07e49 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Tue, 10 Feb 2026 16:16:49 -0600 Subject: [PATCH 1/2] you fmt for the generated code too --- app/api/__generated__/Api.ts | 430 ++++++++++++-------------- app/api/__generated__/http-client.ts | 2 +- app/api/__generated__/msw-handlers.ts | 6 +- tools/generate_api_client.sh | 2 +- 4 files changed, 195 insertions(+), 245 deletions(-) diff --git a/app/api/__generated__/Api.ts b/app/api/__generated__/Api.ts index 98275f5d32..87fb9d175d 100644 --- a/app/api/__generated__/Api.ts +++ b/app/api/__generated__/Api.ts @@ -8,15 +8,8 @@ /* eslint-disable */ -import { - dateReplacer, - handleResponse, - mergeParams, - toQueryString, - type ApiResult, - type FetchParams, - type FullParams, -} from './http-client' +import type { FetchParams, FullParams, ApiResult } from './http-client' +import { dateReplacer, handleResponse, mergeParams, toQueryString } from './http-client' import { snakeify } from './util' export type { ApiResult, ErrorBody, ErrorResult } from './http-client' @@ -66,8 +59,7 @@ export type IpVersion = 'v4' | 'v6' /** * Specify which IP or external subnet pool to allocate from. */ -export type PoolSelector = - /** Use the specified pool by name or ID. */ +export type PoolSelector = /** Use the specified pool by name or ID. */ | { /** The pool to allocate from. */ pool: NameOrId @@ -85,19 +77,19 @@ export type PoolSelector = */ export type AddressAllocator = /** Reserve a specific IP address. The pool is inferred from the address since IP pools cannot have overlapping ranges. */ - | { - /** The IP address to reserve. */ - ip: string - type: 'explicit' - } - /** Automatically allocate an IP address from a pool. */ - | { - /** Pool selection. + | { + /** The IP address to reserve. */ + ip: string + type: 'explicit' + } + /** Automatically allocate an IP address from a pool. */ + | { + /** Pool selection. If omitted, the silo's default pool is used. If the silo has default pools for both IPv4 and IPv6, the request will fail unless `ip_version` is specified. */ - poolSelector?: PoolSelector - type: 'auto' - } + poolSelector?: PoolSelector + type: 'auto' + } /** * A set of addresses associated with a port configuration. @@ -114,10 +106,10 @@ export type AddressConfig = { */ export type AddressLotKind = /** Infrastructure address lots are used for network infrastructure like addresses assigned to rack switches. */ - | 'infra' + | 'infra' - /** Pool address lots are used by IP pools. */ - | 'pool' + /** Pool address lots are used by IP pools. */ + | 'pool' /** * Represents an address lot object, containing the id of the lot that can be used in other API calls. @@ -225,10 +217,10 @@ export type AffinityPolicy = /** If the affinity request cannot be satisfied, allow it anyway. This enables a "best-effort" attempt to satisfy the affinity policy. */ - | 'allow' + | 'allow' - /** If the affinity request cannot be satisfied, fail explicitly. */ - | 'fail' + /** If the affinity request cannot be satisfied, fail explicitly. */ + | 'fail' /** * View of an Affinity Group @@ -264,8 +256,7 @@ export type AffinityGroupCreate = { * * This typically reflects whether it's starting, running, stopping, or stopped, but also includes states related to the Instance's lifecycle */ -export type InstanceState = - /** The instance is being created. */ +export type InstanceState = /** The instance is being created. */ | 'creating' /** The instance is currently starting up. */ @@ -337,8 +328,7 @@ export type BgpMessageHistory = Record /** * Identifies switch physical location */ -export type SwitchLocation = - /** Switch in upper slot */ +export type SwitchLocation = /** Switch in upper slot */ | 'switch0' /** Switch in lower slot */ @@ -394,16 +384,16 @@ export type WebhookDeliveryResponse = { export type WebhookDeliveryAttemptResult = /** The webhook event has been delivered successfully. */ - | 'succeeded' + | 'succeeded' - /** A webhook request was sent to the endpoint, and it returned a HTTP error status code indicating an error. */ - | 'failed_http_error' + /** A webhook request was sent to the endpoint, and it returned a HTTP error status code indicating an error. */ + | 'failed_http_error' - /** The webhook request could not be sent to the receiver endpoint. */ - | 'failed_unreachable' + /** The webhook request could not be sent to the receiver endpoint. */ + | 'failed_unreachable' - /** A connection to the receiver endpoint was successfully established, but no response was received within the delivery timeout. */ - | 'failed_timeout' + /** A connection to the receiver endpoint was successfully established, but no response was received within the delivery timeout. */ + | 'failed_timeout' /** * An individual delivery attempt for a webhook event. @@ -434,19 +424,18 @@ export type AlertDeliveryState = /** The webhook event has not yet been delivered successfully. Either no delivery attempts have yet been performed, or the delivery has failed at least once but has retries remaining. */ - | 'pending' + | 'pending' - /** The webhook event has been delivered successfully. */ - | 'delivered' + /** The webhook event has been delivered successfully. */ + | 'delivered' - /** The webhook delivery attempt has failed permanently and will not be retried again. */ - | 'failed' + /** The webhook delivery attempt has failed permanently and will not be retried again. */ + | 'failed' /** * The reason an alert was delivered */ -export type AlertDeliveryTrigger = - /** Delivery was triggered by the alert itself. */ +export type AlertDeliveryTrigger = /** Delivery was triggered by the alert itself. */ | 'alert' /** Delivery was triggered by a request to resend the alert. */ @@ -573,8 +562,7 @@ export type AlertSubscriptionCreated = { /** * Description of source IPs allowed to reach rack services. */ -export type AllowedSourceIps = - /** Allow traffic from any external IP address. */ +export type AllowedSourceIps = /** Allow traffic from any external IP address. */ | { allow: 'any' } /** Restrict access to a specific set of source IP addresses or subnets. @@ -676,8 +664,7 @@ export type AuditLogEntryActor = /** * Authentication method used for a request */ -export type AuthMethod = - /** Console session cookie */ +export type AuthMethod = /** Console session cookie */ | 'session_cookie' /** Device access token (OAuth 2.0 device authorization flow) */ @@ -689,8 +676,7 @@ export type AuthMethod = /** * Result of an audit log entry */ -export type AuditLogEntryResult = - /** The operation completed successfully */ +export type AuditLogEntryResult = /** The operation completed successfully */ | { /** HTTP status code */ httpStatusCode: number @@ -751,8 +737,7 @@ export type AuditLogEntryResultsPage = { * * This describes the level at which a user must be authorized to read data from a timeseries. For example, fleet-scoping means the data is only visible to an operator or fleet reader. Project-scoped, on the other hand, indicates that a user will see data limited to the projects on which they have read permissions. */ -export type AuthzScope = - /** Timeseries data is limited to fleet readers. */ +export type AuthzScope = /** Timeseries data is limited to fleet readers. */ | 'fleet' /** Timeseries data is limited to the authorized silo for a user. */ @@ -814,8 +799,7 @@ export type BfdSessionEnable = { switch: Name } -export type BfdState = - /** A stable down state. Non-responsive to incoming messages. */ +export type BfdState = /** A stable down state. Non-responsive to incoming messages. */ | 'admin_down' /** The initial state. */ @@ -953,8 +937,7 @@ export type BgpImportedRouteIpv4 = { /** * Define policy relating to the import and export of prefixes from a BGP peer. */ -export type ImportExportPolicy = - /** Do not perform any filtering. */ +export type ImportExportPolicy = /** Do not perform any filtering. */ { type: 'no_filtering' } | { type: 'allow'; value: IpNet[] } /** @@ -1010,28 +993,28 @@ export type BgpPeerConfig = { */ export type BgpPeerState = /** Initial state. Refuse all incoming BGP connections. No resources allocated to peer. */ - | 'idle' + | 'idle' - /** Waiting for the TCP connection to be completed. */ - | 'connect' + /** Waiting for the TCP connection to be completed. */ + | 'connect' - /** Trying to acquire peer by listening for and accepting a TCP connection. */ - | 'active' + /** Trying to acquire peer by listening for and accepting a TCP connection. */ + | 'active' - /** Waiting for open message from peer. */ - | 'open_sent' + /** Waiting for open message from peer. */ + | 'open_sent' - /** Waiting for keepaliave or notification from peer. */ - | 'open_confirm' + /** Waiting for keepaliave or notification from peer. */ + | 'open_confirm' - /** There is an ongoing Connection Collision that hasn't yet been resolved. Two connections are maintained until one connection receives an Open or is able to progress into Established. */ - | 'connection_collision' + /** There is an ongoing Connection Collision that hasn't yet been resolved. Two connections are maintained until one connection receives an Open or is able to progress into Established. */ + | 'connection_collision' - /** Synchronizing with peer. */ - | 'session_setup' + /** Synchronizing with peer. */ + | 'session_setup' - /** Session established. Able to exchange update, notification and keepalive messages with peers. */ - | 'established' + /** Session established. Able to exchange update, notification and keepalive messages with peers. */ + | 'established' /** * The current status of a BGP peer. @@ -1056,8 +1039,7 @@ export type BgpPeerStatus = { * * This type supports ranges similar to the `RangeTo`, `Range` and `RangeFrom` types in the standard library. Those cover `(..end)`, `(start..end)`, and `(start..)` respectively. */ -export type BinRangedouble = - /** A range unbounded below and exclusively above, `..end`. */ +export type BinRangedouble = /** A range unbounded below and exclusively above, `..end`. */ | { end: number; type: 'range_to' } /** A range bounded inclusively below and exclusively above, `start..end`. */ | { end: number; start: number; type: 'range' } @@ -1069,8 +1051,7 @@ export type BinRangedouble = * * This type supports ranges similar to the `RangeTo`, `Range` and `RangeFrom` types in the standard library. Those cover `(..end)`, `(start..end)`, and `(start..)` respectively. */ -export type BinRangefloat = - /** A range unbounded below and exclusively above, `..end`. */ +export type BinRangefloat = /** A range unbounded below and exclusively above, `..end`. */ | { end: number; type: 'range_to' } /** A range bounded inclusively below and exclusively above, `start..end`. */ | { end: number; start: number; type: 'range' } @@ -1082,8 +1063,7 @@ export type BinRangefloat = * * This type supports ranges similar to the `RangeTo`, `Range` and `RangeFrom` types in the standard library. Those cover `(..end)`, `(start..end)`, and `(start..)` respectively. */ -export type BinRangeint16 = - /** A range unbounded below and exclusively above, `..end`. */ +export type BinRangeint16 = /** A range unbounded below and exclusively above, `..end`. */ | { end: number; type: 'range_to' } /** A range bounded inclusively below and exclusively above, `start..end`. */ | { end: number; start: number; type: 'range' } @@ -1095,8 +1075,7 @@ export type BinRangeint16 = * * This type supports ranges similar to the `RangeTo`, `Range` and `RangeFrom` types in the standard library. Those cover `(..end)`, `(start..end)`, and `(start..)` respectively. */ -export type BinRangeint32 = - /** A range unbounded below and exclusively above, `..end`. */ +export type BinRangeint32 = /** A range unbounded below and exclusively above, `..end`. */ | { end: number; type: 'range_to' } /** A range bounded inclusively below and exclusively above, `start..end`. */ | { end: number; start: number; type: 'range' } @@ -1108,8 +1087,7 @@ export type BinRangeint32 = * * This type supports ranges similar to the `RangeTo`, `Range` and `RangeFrom` types in the standard library. Those cover `(..end)`, `(start..end)`, and `(start..)` respectively. */ -export type BinRangeint64 = - /** A range unbounded below and exclusively above, `..end`. */ +export type BinRangeint64 = /** A range unbounded below and exclusively above, `..end`. */ | { end: number; type: 'range_to' } /** A range bounded inclusively below and exclusively above, `start..end`. */ | { end: number; start: number; type: 'range' } @@ -1121,8 +1099,7 @@ export type BinRangeint64 = * * This type supports ranges similar to the `RangeTo`, `Range` and `RangeFrom` types in the standard library. Those cover `(..end)`, `(start..end)`, and `(start..)` respectively. */ -export type BinRangeint8 = - /** A range unbounded below and exclusively above, `..end`. */ +export type BinRangeint8 = /** A range unbounded below and exclusively above, `..end`. */ | { end: number; type: 'range_to' } /** A range bounded inclusively below and exclusively above, `start..end`. */ | { end: number; start: number; type: 'range' } @@ -1134,8 +1111,7 @@ export type BinRangeint8 = * * This type supports ranges similar to the `RangeTo`, `Range` and `RangeFrom` types in the standard library. Those cover `(..end)`, `(start..end)`, and `(start..)` respectively. */ -export type BinRangeuint16 = - /** A range unbounded below and exclusively above, `..end`. */ +export type BinRangeuint16 = /** A range unbounded below and exclusively above, `..end`. */ | { end: number; type: 'range_to' } /** A range bounded inclusively below and exclusively above, `start..end`. */ | { end: number; start: number; type: 'range' } @@ -1147,8 +1123,7 @@ export type BinRangeuint16 = * * This type supports ranges similar to the `RangeTo`, `Range` and `RangeFrom` types in the standard library. Those cover `(..end)`, `(start..end)`, and `(start..)` respectively. */ -export type BinRangeuint32 = - /** A range unbounded below and exclusively above, `..end`. */ +export type BinRangeuint32 = /** A range unbounded below and exclusively above, `..end`. */ | { end: number; type: 'range_to' } /** A range bounded inclusively below and exclusively above, `start..end`. */ | { end: number; start: number; type: 'range' } @@ -1160,8 +1135,7 @@ export type BinRangeuint32 = * * This type supports ranges similar to the `RangeTo`, `Range` and `RangeFrom` types in the standard library. Those cover `(..end)`, `(start..end)`, and `(start..)` respectively. */ -export type BinRangeuint64 = - /** A range unbounded below and exclusively above, `..end`. */ +export type BinRangeuint64 = /** A range unbounded below and exclusively above, `..end`. */ | { end: number; type: 'range_to' } /** A range bounded inclusively below and exclusively above, `start..end`. */ | { end: number; start: number; type: 'range' } @@ -1173,8 +1147,7 @@ export type BinRangeuint64 = * * This type supports ranges similar to the `RangeTo`, `Range` and `RangeFrom` types in the standard library. Those cover `(..end)`, `(start..end)`, and `(start..)` respectively. */ -export type BinRangeuint8 = - /** A range unbounded below and exclusively above, `..end`. */ +export type BinRangeuint8 = /** A range unbounded below and exclusively above, `..end`. */ | { end: number; type: 'range_to' } /** A range bounded inclusively below and exclusively above, `start..end`. */ | { end: number; start: number; type: 'range' } @@ -1857,8 +1830,7 @@ export type DiskType = 'distributed' | 'local' /** * State of a Disk */ -export type DiskState = - /** Disk is being initialized */ +export type DiskState = /** Disk is being initialized */ | { state: 'creating' } /** Disk is ready but detached from any Instance */ | { state: 'detached' } @@ -1914,8 +1886,7 @@ export type Disk = { /** * Different sources for a Distributed Disk */ -export type DiskSource = - /** Create a blank disk */ +export type DiskSource = /** Create a blank disk */ | { /** size of blocks for this Disk. valid values are: 512, 2048, or 4096 */ blockSize: BlockSize @@ -2018,8 +1989,7 @@ export type EphemeralIpCreate = { poolSelector?: PoolSelector } -export type ExternalIp = - /** A source NAT IP address. +export type ExternalIp = /** A source NAT IP address. SNAT addresses are ephemeral addresses used only for outbound connectivity. */ | { @@ -2062,15 +2032,15 @@ SNAT addresses are ephemeral addresses used only for outbound connectivity. */ */ export type ExternalIpCreate = /** An IP address providing both inbound and outbound access. The address is automatically assigned from a pool. */ - | { - /** Pool to allocate from. */ - poolSelector?: PoolSelector - type: 'ephemeral' - } - /** An IP address providing both inbound and outbound access. The address is an existing floating IP object assigned to the current project. + | { + /** Pool to allocate from. */ + poolSelector?: PoolSelector + type: 'ephemeral' + } + /** An IP address providing both inbound and outbound access. The address is an existing floating IP object assigned to the current project. The floating IP must not be in use by another instance or service. */ - | { floatingIp: NameOrId; type: 'floating' } + | { floatingIp: NameOrId; type: 'floating' } /** * A single page of results @@ -2111,8 +2081,7 @@ export type ExternalSubnet = { /** * Specify how to allocate an external subnet. */ -export type ExternalSubnetAllocator = - /** Reserve a specific subnet. */ +export type ExternalSubnetAllocator = /** Reserve a specific subnet. */ | { /** The subnet CIDR to reserve. Must be available in the pool. */ subnet: IpNet @@ -2449,10 +2418,10 @@ export type ImportBlocksBulkWrite = { base64EncodedData: string; offset: number */ export type InstanceAutoRestartPolicy = /** The instance should not be automatically restarted by the control plane if it fails. */ - | 'never' + | 'never' - /** If this instance is running and unexpectedly fails (e.g. due to a host software crash or unexpected host reboot), the control plane will make a best-effort attempt to restart it. The control plane may choose not to restart the instance to preserve the overall availability of the system. */ - | 'best_effort' + /** If this instance is running and unexpectedly fails (e.g. due to a host software crash or unexpected host reboot), the control plane will make a best-effort attempt to restart it. The control plane may choose not to restart the instance to preserve the overall availability of the system. */ + | 'best_effort' /** * A required CPU platform for an instance. @@ -2467,8 +2436,7 @@ export type InstanceAutoRestartPolicy = * * In all cases, the CPU features presented by a given CPU platform are a subset of what the corresponding hardware may actually support; features which cannot be used from a virtual environment or do not have full hypervisor support may be masked off. See RFD 314 for specific CPU features in a CPU platform. */ -export type InstanceCpuPlatform = - /** An AMD Milan-like CPU platform. */ +export type InstanceCpuPlatform = /** An AMD Milan-like CPU platform. */ | 'amd_milan' /** An AMD Turin-like CPU platform. */ @@ -2528,21 +2496,21 @@ If this is not present, then this instance has not been automatically restarted. */ export type InstanceDiskAttachment = /** During instance creation, create and attach disks */ - | { - description: string - /** The source for this `Disk`'s blocks */ - diskBackend: DiskBackend - name: Name - /** The total size of the Disk (in bytes) */ - size: ByteCount - type: 'create' - } - /** During instance creation, attach this disk */ - | { - /** A disk name to attach */ - name: Name - type: 'attach' - } + | { + description: string + /** The source for this `Disk`'s blocks */ + diskBackend: DiskBackend + name: Name + /** The total size of the Disk (in bytes) */ + size: ByteCount + type: 'create' + } + /** During instance creation, attach this disk */ + | { + /** A disk name to attach */ + name: Name + type: 'attach' + } /** * A multicast group identifier @@ -2568,8 +2536,7 @@ export type MulticastGroupJoinSpec = { /** * How a VPC-private IP address is assigned to a network interface. */ -export type Ipv4Assignment = - /** Automatically assign an IP address from the VPC Subnet. */ +export type Ipv4Assignment = /** Automatically assign an IP address from the VPC Subnet. */ | { type: 'auto' } /** Explicitly assign a specific address, if available. */ | { type: 'explicit'; value: string } @@ -2587,8 +2554,7 @@ export type PrivateIpv4StackCreate = { /** * How a VPC-private IP address is assigned to a network interface. */ -export type Ipv6Assignment = - /** Automatically assign an IP address from the VPC Subnet. */ +export type Ipv6Assignment = /** Automatically assign an IP address from the VPC Subnet. */ | { type: 'auto' } /** Explicitly assign a specific address, if available. */ | { type: 'explicit'; value: string } @@ -2606,8 +2572,7 @@ export type PrivateIpv6StackCreate = { /** * Create parameters for a network interface's IP stack. */ -export type PrivateIpStackCreate = - /** The interface has only an IPv4 stack. */ +export type PrivateIpStackCreate = /** The interface has only an IPv4 stack. */ | { type: 'v4'; value: PrivateIpv4StackCreate } /** The interface has only an IPv6 stack. */ | { type: 'v6'; value: PrivateIpv6StackCreate } @@ -2640,21 +2605,21 @@ export type InstanceNetworkInterfaceAttachment = /** Create one or more `InstanceNetworkInterface`s for the `Instance`. If more than one interface is provided, then the first will be designated the primary interface for the instance. */ - | { params: InstanceNetworkInterfaceCreate[]; type: 'create' } - /** Create a single primary interface with an automatically-assigned IPv4 address. + | { params: InstanceNetworkInterfaceCreate[]; type: 'create' } + /** Create a single primary interface with an automatically-assigned IPv4 address. The IP will be pulled from the Project's default VPC / VPC Subnet. */ - | { type: 'default_ipv4' } - /** Create a single primary interface with an automatically-assigned IPv6 address. + | { type: 'default_ipv4' } + /** Create a single primary interface with an automatically-assigned IPv6 address. The IP will be pulled from the Project's default VPC / VPC Subnet. */ - | { type: 'default_ipv6' } - /** Create a single primary interface with automatically-assigned IPv4 and IPv6 addresses. + | { type: 'default_ipv6' } + /** Create a single primary interface with automatically-assigned IPv4 and IPv6 addresses. The IPs will be pulled from the Project's default VPC / VPC Subnet. */ - | { type: 'default_dual_stack' } - /** No network interfaces at all will be created for the instance. */ - | { type: 'none' } + | { type: 'default_dual_stack' } + /** No network interfaces at all will be created for the instance. */ + | { type: 'none' } /** * Create-time parameters for an `Instance` @@ -2747,8 +2712,7 @@ export type PrivateIpv6Stack = { /** * The VPC-private IP stack for a network interface. */ -export type PrivateIpStack = - /** The interface has only an IPv4 stack. */ +export type PrivateIpStack = /** The interface has only an IPv4 stack. */ | { type: 'v4'; value: PrivateIpv4Stack } /** The interface has only an IPv6 stack. */ | { type: 'v6'; value: PrivateIpv6Stack } @@ -2989,8 +2953,7 @@ export type InternetGatewayResultsPage = { /** * Type of IP pool. */ -export type IpPoolType = - /** Unicast IP pool for standard IP allocations. */ +export type IpPoolType = /** Unicast IP pool for standard IP allocations. */ | 'unicast' /** Multicast IP pool for multicast group allocations. @@ -3143,8 +3106,7 @@ export type L4PortRange = string /** * The forward error correction mode of a link. */ -export type LinkFec = - /** Firecode forward error correction. */ +export type LinkFec = /** Firecode forward error correction. */ | 'firecode' /** No forward error correction. */ @@ -3176,8 +3138,7 @@ export type LldpLinkConfigCreate = { /** * The speed of a link. */ -export type LinkSpeed = - /** Zero gigabits per second. */ +export type LinkSpeed = /** Zero gigabits per second. */ | 'speed0_g' /** 1 gigabit per second. */ @@ -3366,8 +3327,7 @@ export type MeasurementResultsPage = { /** * The type of the metric itself, indicating what its values represent. */ -export type MetricType = - /** The value represents an instantaneous measurement in time. */ +export type MetricType = /** The value represents an instantaneous measurement in time. */ | 'gauge' /** The value represents a difference between two points in time. */ @@ -3479,8 +3439,7 @@ export type PrivateIpv6Config = { /** * VPC-private IP address configuration for a network interface. */ -export type PrivateIpConfig = - /** The interface has only an IPv4 configuration. */ +export type PrivateIpConfig = /** The interface has only an IPv4 configuration. */ | { type: 'v4'; value: PrivateIpv4Config } /** The interface has only an IPv6 configuration. */ | { type: 'v6'; value: PrivateIpv6Config } @@ -3498,8 +3457,7 @@ export type PrivateIpConfig = /** * The type of network interface */ -export type NetworkInterfaceKind = - /** A vNIC attached to a guest instance */ +export type NetworkInterfaceKind = /** A vNIC attached to a guest instance */ | { id: string; type: 'instance' } /** A vNIC associated with an internal service */ | { id: string; type: 'service' } @@ -3597,25 +3555,25 @@ export type PhysicalDiskKind = 'm2' | 'u2' */ export type PhysicalDiskPolicy = /** The operator has indicated that the disk is in-service. */ - | { kind: 'in_service' } - /** The operator has indicated that the disk has been permanently removed from service. + | { kind: 'in_service' } + /** The operator has indicated that the disk has been permanently removed from service. This is a terminal state: once a particular disk ID is expunged, it will never return to service. (The actual hardware may be reused, but it will be treated as a brand-new disk.) An expunged disk is always non-provisionable. */ - | { kind: 'expunged' } + | { kind: 'expunged' } /** * The current state of the disk, as determined by Nexus. */ export type PhysicalDiskState = /** The disk is currently active, and has resources allocated on it. */ - | 'active' + | 'active' - /** The disk has been permanently removed from service. + /** The disk has been permanently removed from service. This is a terminal state: once a particular disk ID is decommissioned, it will never return to service. (The actual hardware may be reused, but it will be treated as a brand-new disk.) */ - | 'decommissioned' + | 'decommissioned' /** * View of a Physical Disk @@ -3851,19 +3809,18 @@ export type RouteConfig = { */ export type RouteDestination = /** Route applies to traffic destined for the specified IP address */ - | { type: 'ip'; value: string } - /** Route applies to traffic destined for the specified IP subnet */ - | { type: 'ip_net'; value: IpNet } - /** Route applies to traffic destined for the specified VPC */ - | { type: 'vpc'; value: Name } - /** Route applies to traffic destined for the specified VPC subnet */ - | { type: 'subnet'; value: Name } + | { type: 'ip'; value: string } + /** Route applies to traffic destined for the specified IP subnet */ + | { type: 'ip_net'; value: IpNet } + /** Route applies to traffic destined for the specified VPC */ + | { type: 'vpc'; value: Name } + /** Route applies to traffic destined for the specified VPC subnet */ + | { type: 'subnet'; value: Name } /** * A `RouteTarget` describes the possible locations that traffic matching a route destination can be sent. */ -export type RouteTarget = - /** Forward traffic to a particular IP address. */ +export type RouteTarget = /** Forward traffic to a particular IP address. */ | { type: 'ip'; value: string } /** Forward traffic to a VPC */ | { type: 'vpc'; value: Name } @@ -3885,22 +3842,22 @@ export type RouterRouteKind = /** Determines the default destination of traffic, such as whether it goes to the internet or not. `Destination: An Internet Gateway` `Modifiable: true` */ - | 'default' + | 'default' - /** Automatically added for each VPC Subnet in the VPC + /** Automatically added for each VPC Subnet in the VPC `Destination: A VPC Subnet` `Modifiable: false` */ - | 'vpc_subnet' + | 'vpc_subnet' - /** Automatically added when VPC peering is established + /** Automatically added when VPC peering is established `Destination: A different VPC` `Modifiable: false` */ - | 'vpc_peering' + | 'vpc_peering' - /** Created by a user; see `RouteTarget` + /** Created by a user; see `RouteTarget` `Destination: User defined` `Modifiable: true` */ - | 'custom' + | 'custom' /** * A route defines a rule that governs where traffic should be sent based on its destination. @@ -4051,13 +4008,13 @@ export type SetTargetReleaseParams = { */ export type SiloIdentityMode = /** Users are authenticated with SAML using an external authentication provider. The system updates information about users and groups only during successful authentication (i.e,. "JIT provisioning" of users and groups). */ - | 'saml_jit' + | 'saml_jit' - /** The system is the source of truth about users. There is no linkage to an external authentication provider or identity provider. */ - | 'local_only' + /** The system is the source of truth about users. There is no linkage to an external authentication provider or identity provider. */ + | 'local_only' - /** Users are authenticated with SAML using an external authentication provider. Users and groups are managed with SCIM API calls, likely from the same authentication provider. */ - | 'saml_scim' + /** Users are authenticated with SAML using an external authentication provider. Users and groups are managed with SCIM API calls, likely from the same authentication provider. */ + | 'saml_scim' /** * View of a Silo @@ -4311,8 +4268,7 @@ export type SiloUtilizationResultsPage = { * * This controls whether new resources are going to be provisioned on this sled. */ -export type SledProvisionPolicy = - /** New resources will be provisioned on this sled. */ +export type SledProvisionPolicy = /** New resources will be provisioned on this sled. */ | 'provisionable' /** New resources will not be provisioned on this sled. However, if the sled is currently in service, existing resources will continue to be on this sled unless manually migrated off. */ @@ -4321,8 +4277,7 @@ export type SledProvisionPolicy = /** * The operator-defined policy of a sled. */ -export type SledPolicy = - /** The operator has indicated that the sled is in-service. */ +export type SledPolicy = /** The operator has indicated that the sled is in-service. */ | { kind: 'in_service' /** Determines whether new resources can be provisioned onto the sled. */ @@ -4340,12 +4295,12 @@ An expunged sled is always non-provisionable. */ */ export type SledState = /** The sled is currently active, and has resources allocated on it. */ - | 'active' + | 'active' - /** The sled has been permanently removed from service. + /** The sled has been permanently removed from service. This is a terminal state: once a particular sled ID is decommissioned, it will never return to service. (The actual hardware may be reused, but it will be treated as a brand-new sled.) */ - | 'decommissioned' + | 'decommissioned' /** * An operator's view of a Sled. @@ -4662,8 +4617,7 @@ export type SupportBundleCreate = { userComment?: string | null } -export type SupportBundleState = - /** Support Bundle still actively being collected. +export type SupportBundleState = /** Support Bundle still actively being collected. This is the initial state for a Support Bundle, and it will automatically transition to either "Failing" or "Active". @@ -4727,13 +4681,13 @@ export type Switch = { */ export type SwitchInterfaceKind2 = /** Primary interfaces are associated with physical links. There is exactly one primary interface per physical link. */ - | 'primary' + | 'primary' - /** VLAN interfaces allow physical interfaces to be multiplexed onto multiple logical links, each distinguished by a 12-bit 802.1Q Ethernet tag. */ - | 'vlan' + /** VLAN interfaces allow physical interfaces to be multiplexed onto multiple logical links, each distinguished by a 12-bit 802.1Q Ethernet tag. */ + | 'vlan' - /** Loopback interfaces are anchors for IP addresses that are not specific to any particular port. */ - | 'loopback' + /** Loopback interfaces are anchors for IP addresses that are not specific to any particular port. */ + | 'loopback' /** * A switch port interface configuration for a port settings object. @@ -4756,15 +4710,15 @@ export type SwitchInterfaceConfig = { */ export type SwitchInterfaceKind = /** Primary interfaces are associated with physical links. There is exactly one primary interface per physical link. */ - | { type: 'primary' } - /** VLAN interfaces allow physical interfaces to be multiplexed onto multiple logical links, each distinguished by a 12-bit 802.1Q Ethernet tag. */ - | { - type: 'vlan' - /** The virtual network id (VID) that distinguishes this interface and is used for producing and consuming 802.1Q Ethernet tags. This field has a maximum value of 4095 as 802.1Q tags are twelve bits. */ - vid: number - } - /** Loopback interfaces are anchors for IP addresses that are not specific to any particular port. */ - | { type: 'loopback' } + | { type: 'primary' } + /** VLAN interfaces allow physical interfaces to be multiplexed onto multiple logical links, each distinguished by a 12-bit 802.1Q Ethernet tag. */ + | { + type: 'vlan' + /** The virtual network id (VID) that distinguishes this interface and is used for producing and consuming 802.1Q Ethernet tags. This field has a maximum value of 4095 as 802.1Q tags are twelve bits. */ + vid: number + } + /** Loopback interfaces are anchors for IP addresses that are not specific to any particular port. */ + | { type: 'loopback' } /** * A layer-3 switch interface configuration. When IPv6 is enabled, a link local address will be created for the interface. @@ -4829,13 +4783,13 @@ export type SwitchPortApplySettings = { */ export type SwitchPortGeometry2 = /** The port contains a single QSFP28 link with four lanes. */ - | 'qsfp28x1' + | 'qsfp28x1' - /** The port contains two QSFP28 links each with two lanes. */ - | 'qsfp28x2' + /** The port contains two QSFP28 links each with two lanes. */ + | 'qsfp28x2' - /** The port contains four SFP28 links each with one lane. */ - | 'sfp28x4' + /** The port contains four SFP28 links each with one lane. */ + | 'sfp28x4' /** * A physical port configuration for a port settings object. @@ -4852,13 +4806,13 @@ export type SwitchPortConfig = { */ export type SwitchPortGeometry = /** The port contains a single QSFP28 link with four lanes. */ - | 'qsfp28x1' + | 'qsfp28x1' - /** The port contains two QSFP28 links each with two lanes. */ - | 'qsfp28x2' + /** The port contains two QSFP28 links each with two lanes. */ + | 'qsfp28x2' - /** The port contains four SFP28 links each with one lane. */ - | 'sfp28x4' + /** The port contains four SFP28 links each with one lane. */ + | 'sfp28x4' /** * Physical switch port configuration. @@ -5148,8 +5102,7 @@ export type TufRepoResultsPage = { /** * Whether the uploaded TUF repo already existed or was new and had to be inserted. Part of `TufRepoUpload`. */ -export type TufRepoUploadStatus = - /** The repository already existed in the database */ +export type TufRepoUploadStatus = /** The repository already existed in the database */ | 'already_exists' /** The repository did not exist, and was inserted into the database */ @@ -5271,8 +5224,7 @@ export type UserId = string /** * Parameters for setting a user's password */ -export type UserPassword = - /** Sets the user's password to the provided value */ +export type UserPassword = /** Sets the user's password to the provided value */ | { mode: 'password'; value: Password } /** Invalidates any current password (disabling password authentication) */ | { mode: 'login_disallowed' } @@ -5360,15 +5312,15 @@ export type VpcFirewallRuleDirection = 'inbound' | 'outbound' */ export type VpcFirewallRuleHostFilter = /** The rule applies to traffic from/to all instances in the VPC */ - | { type: 'vpc'; value: Name } - /** The rule applies to traffic from/to all instances in the VPC Subnet */ - | { type: 'subnet'; value: Name } - /** The rule applies to traffic from/to this specific instance */ - | { type: 'instance'; value: Name } - /** The rule applies to traffic from/to a specific IP address */ - | { type: 'ip'; value: string } - /** The rule applies to traffic from/to a specific IP subnet */ - | { type: 'ip_net'; value: IpNet } + | { type: 'vpc'; value: Name } + /** The rule applies to traffic from/to all instances in the VPC Subnet */ + | { type: 'subnet'; value: Name } + /** The rule applies to traffic from/to this specific instance */ + | { type: 'instance'; value: Name } + /** The rule applies to traffic from/to a specific IP address */ + | { type: 'ip'; value: string } + /** The rule applies to traffic from/to a specific IP subnet */ + | { type: 'ip_net'; value: IpNet } /** * The protocols that may be specified in a firewall rule's filter @@ -5395,8 +5347,7 @@ export type VpcFirewallRuleStatus = 'disabled' | 'enabled' /** * A `VpcFirewallRuleTarget` is used to specify the set of instances to which a firewall rule applies. You can target instances directly by name, or specify a VPC, VPC subnet, IP, or IP subnet, which will apply the rule to traffic going to all matching instances. Targets are additive: the rule applies to instances matching ANY target. */ -export type VpcFirewallRuleTarget = - /** The rule applies to all instances in the VPC */ +export type VpcFirewallRuleTarget = /** The rule applies to all instances in the VPC */ | { type: 'vpc'; value: Name } /** The rule applies to all instances in the VPC Subnet */ | { type: 'subnet'; value: Name } @@ -5653,8 +5604,7 @@ export type WebhookSecrets = { secrets: WebhookSecret[] } /** * Supported set of sort modes for scanning by name or id */ -export type NameOrIdSortMode = - /** sort in increasing order of "name" */ +export type NameOrIdSortMode = /** sort in increasing order of "name" */ | 'name_ascending' /** sort in decreasing order of "name" */ @@ -5668,10 +5618,10 @@ export type NameOrIdSortMode = */ export type TimeAndIdSortMode = /** sort in increasing order of timestamp and ID, i.e., earliest first */ - | 'time_and_id_ascending' + | 'time_and_id_ascending' - /** sort in increasing order of timestamp and ID, i.e., most recent first */ - | 'time_and_id_descending' + /** sort in increasing order of timestamp and ID, i.e., most recent first */ + | 'time_and_id_descending' /** * Supported set of sort modes for scanning by id only. @@ -5695,10 +5645,10 @@ export type PaginationOrder = 'ascending' | 'descending' */ export type VersionSortMode = /** Sort in increasing semantic version order (oldest first) */ - | 'version_ascending' + | 'version_ascending' - /** Sort in decreasing semantic version order (newest first) */ - | 'version_descending' + /** Sort in decreasing semantic version order (newest first) */ + | 'version_descending' /** * Supported set of sort modes for scanning by name only diff --git a/app/api/__generated__/http-client.ts b/app/api/__generated__/http-client.ts index 619f8928f2..eb5f15f7a7 100644 --- a/app/api/__generated__/http-client.ts +++ b/app/api/__generated__/http-client.ts @@ -6,7 +6,7 @@ * Copyright Oxide Computer Company */ -import { camelToSnake, isNotNull, processResponseBody } from './util' +import { camelToSnake, processResponseBody, isNotNull } from './util' /** Success responses from the API */ export type ApiSuccess = { diff --git a/app/api/__generated__/msw-handlers.ts b/app/api/__generated__/msw-handlers.ts index 4cff25a267..b970891e85 100644 --- a/app/api/__generated__/msw-handlers.ts +++ b/app/api/__generated__/msw-handlers.ts @@ -8,12 +8,12 @@ import { http, - HttpResponse, type HttpHandler, - type PathParams, + HttpResponse, type StrictResponse, + type PathParams, } from 'msw' -import type { Promisable, SnakeCasedPropertiesDeep as Snakify } from 'type-fest' +import type { SnakeCasedPropertiesDeep as Snakify, Promisable } from 'type-fest' import { type ZodType } from 'zod/v4' import type * as Api from './Api' diff --git a/tools/generate_api_client.sh b/tools/generate_api_client.sh index 08e58f4554..c8c05756f9 100755 --- a/tools/generate_api_client.sh +++ b/tools/generate_api_client.sh @@ -35,7 +35,7 @@ for f in Api.ts msw-handlers.ts validate.ts; do mv "$GEN_DIR/$f.tmp" "$GEN_DIR/$f" done -npm run prettier -- --write --log-level error "$GEN_DIR" +npm run fmt cat > $GEN_DIR/OMICRON_VERSION < Date: Tue, 10 Feb 2026 16:31:03 -0600 Subject: [PATCH 2/2] add a second npm run fmt lol --- app/api/__generated__/Api.ts | 290 +++++++++++++++++------------------ tools/generate_api_client.sh | 3 + 2 files changed, 148 insertions(+), 145 deletions(-) diff --git a/app/api/__generated__/Api.ts b/app/api/__generated__/Api.ts index 87fb9d175d..e3c76d1d94 100644 --- a/app/api/__generated__/Api.ts +++ b/app/api/__generated__/Api.ts @@ -77,19 +77,19 @@ export type PoolSelector = /** Use the specified pool by name or ID. */ */ export type AddressAllocator = /** Reserve a specific IP address. The pool is inferred from the address since IP pools cannot have overlapping ranges. */ - | { - /** The IP address to reserve. */ - ip: string - type: 'explicit' - } - /** Automatically allocate an IP address from a pool. */ - | { - /** Pool selection. + | { + /** The IP address to reserve. */ + ip: string + type: 'explicit' + } + /** Automatically allocate an IP address from a pool. */ + | { + /** Pool selection. If omitted, the silo's default pool is used. If the silo has default pools for both IPv4 and IPv6, the request will fail unless `ip_version` is specified. */ - poolSelector?: PoolSelector - type: 'auto' - } + poolSelector?: PoolSelector + type: 'auto' + } /** * A set of addresses associated with a port configuration. @@ -106,10 +106,10 @@ export type AddressConfig = { */ export type AddressLotKind = /** Infrastructure address lots are used for network infrastructure like addresses assigned to rack switches. */ - | 'infra' + | 'infra' - /** Pool address lots are used by IP pools. */ - | 'pool' + /** Pool address lots are used by IP pools. */ + | 'pool' /** * Represents an address lot object, containing the id of the lot that can be used in other API calls. @@ -217,10 +217,10 @@ export type AffinityPolicy = /** If the affinity request cannot be satisfied, allow it anyway. This enables a "best-effort" attempt to satisfy the affinity policy. */ - | 'allow' + | 'allow' - /** If the affinity request cannot be satisfied, fail explicitly. */ - | 'fail' + /** If the affinity request cannot be satisfied, fail explicitly. */ + | 'fail' /** * View of an Affinity Group @@ -384,16 +384,16 @@ export type WebhookDeliveryResponse = { export type WebhookDeliveryAttemptResult = /** The webhook event has been delivered successfully. */ - | 'succeeded' + | 'succeeded' - /** A webhook request was sent to the endpoint, and it returned a HTTP error status code indicating an error. */ - | 'failed_http_error' + /** A webhook request was sent to the endpoint, and it returned a HTTP error status code indicating an error. */ + | 'failed_http_error' - /** The webhook request could not be sent to the receiver endpoint. */ - | 'failed_unreachable' + /** The webhook request could not be sent to the receiver endpoint. */ + | 'failed_unreachable' - /** A connection to the receiver endpoint was successfully established, but no response was received within the delivery timeout. */ - | 'failed_timeout' + /** A connection to the receiver endpoint was successfully established, but no response was received within the delivery timeout. */ + | 'failed_timeout' /** * An individual delivery attempt for a webhook event. @@ -424,13 +424,13 @@ export type AlertDeliveryState = /** The webhook event has not yet been delivered successfully. Either no delivery attempts have yet been performed, or the delivery has failed at least once but has retries remaining. */ - | 'pending' + | 'pending' - /** The webhook event has been delivered successfully. */ - | 'delivered' + /** The webhook event has been delivered successfully. */ + | 'delivered' - /** The webhook delivery attempt has failed permanently and will not be retried again. */ - | 'failed' + /** The webhook delivery attempt has failed permanently and will not be retried again. */ + | 'failed' /** * The reason an alert was delivered @@ -993,28 +993,28 @@ export type BgpPeerConfig = { */ export type BgpPeerState = /** Initial state. Refuse all incoming BGP connections. No resources allocated to peer. */ - | 'idle' + | 'idle' - /** Waiting for the TCP connection to be completed. */ - | 'connect' + /** Waiting for the TCP connection to be completed. */ + | 'connect' - /** Trying to acquire peer by listening for and accepting a TCP connection. */ - | 'active' + /** Trying to acquire peer by listening for and accepting a TCP connection. */ + | 'active' - /** Waiting for open message from peer. */ - | 'open_sent' + /** Waiting for open message from peer. */ + | 'open_sent' - /** Waiting for keepaliave or notification from peer. */ - | 'open_confirm' + /** Waiting for keepaliave or notification from peer. */ + | 'open_confirm' - /** There is an ongoing Connection Collision that hasn't yet been resolved. Two connections are maintained until one connection receives an Open or is able to progress into Established. */ - | 'connection_collision' + /** There is an ongoing Connection Collision that hasn't yet been resolved. Two connections are maintained until one connection receives an Open or is able to progress into Established. */ + | 'connection_collision' - /** Synchronizing with peer. */ - | 'session_setup' + /** Synchronizing with peer. */ + | 'session_setup' - /** Session established. Able to exchange update, notification and keepalive messages with peers. */ - | 'established' + /** Session established. Able to exchange update, notification and keepalive messages with peers. */ + | 'established' /** * The current status of a BGP peer. @@ -2032,15 +2032,15 @@ SNAT addresses are ephemeral addresses used only for outbound connectivity. */ */ export type ExternalIpCreate = /** An IP address providing both inbound and outbound access. The address is automatically assigned from a pool. */ - | { - /** Pool to allocate from. */ - poolSelector?: PoolSelector - type: 'ephemeral' - } - /** An IP address providing both inbound and outbound access. The address is an existing floating IP object assigned to the current project. + | { + /** Pool to allocate from. */ + poolSelector?: PoolSelector + type: 'ephemeral' + } + /** An IP address providing both inbound and outbound access. The address is an existing floating IP object assigned to the current project. The floating IP must not be in use by another instance or service. */ - | { floatingIp: NameOrId; type: 'floating' } + | { floatingIp: NameOrId; type: 'floating' } /** * A single page of results @@ -2418,10 +2418,10 @@ export type ImportBlocksBulkWrite = { base64EncodedData: string; offset: number */ export type InstanceAutoRestartPolicy = /** The instance should not be automatically restarted by the control plane if it fails. */ - | 'never' + | 'never' - /** If this instance is running and unexpectedly fails (e.g. due to a host software crash or unexpected host reboot), the control plane will make a best-effort attempt to restart it. The control plane may choose not to restart the instance to preserve the overall availability of the system. */ - | 'best_effort' + /** If this instance is running and unexpectedly fails (e.g. due to a host software crash or unexpected host reboot), the control plane will make a best-effort attempt to restart it. The control plane may choose not to restart the instance to preserve the overall availability of the system. */ + | 'best_effort' /** * A required CPU platform for an instance. @@ -2496,21 +2496,21 @@ If this is not present, then this instance has not been automatically restarted. */ export type InstanceDiskAttachment = /** During instance creation, create and attach disks */ - | { - description: string - /** The source for this `Disk`'s blocks */ - diskBackend: DiskBackend - name: Name - /** The total size of the Disk (in bytes) */ - size: ByteCount - type: 'create' - } - /** During instance creation, attach this disk */ - | { - /** A disk name to attach */ - name: Name - type: 'attach' - } + | { + description: string + /** The source for this `Disk`'s blocks */ + diskBackend: DiskBackend + name: Name + /** The total size of the Disk (in bytes) */ + size: ByteCount + type: 'create' + } + /** During instance creation, attach this disk */ + | { + /** A disk name to attach */ + name: Name + type: 'attach' + } /** * A multicast group identifier @@ -2605,21 +2605,21 @@ export type InstanceNetworkInterfaceAttachment = /** Create one or more `InstanceNetworkInterface`s for the `Instance`. If more than one interface is provided, then the first will be designated the primary interface for the instance. */ - | { params: InstanceNetworkInterfaceCreate[]; type: 'create' } - /** Create a single primary interface with an automatically-assigned IPv4 address. + | { params: InstanceNetworkInterfaceCreate[]; type: 'create' } + /** Create a single primary interface with an automatically-assigned IPv4 address. The IP will be pulled from the Project's default VPC / VPC Subnet. */ - | { type: 'default_ipv4' } - /** Create a single primary interface with an automatically-assigned IPv6 address. + | { type: 'default_ipv4' } + /** Create a single primary interface with an automatically-assigned IPv6 address. The IP will be pulled from the Project's default VPC / VPC Subnet. */ - | { type: 'default_ipv6' } - /** Create a single primary interface with automatically-assigned IPv4 and IPv6 addresses. + | { type: 'default_ipv6' } + /** Create a single primary interface with automatically-assigned IPv4 and IPv6 addresses. The IPs will be pulled from the Project's default VPC / VPC Subnet. */ - | { type: 'default_dual_stack' } - /** No network interfaces at all will be created for the instance. */ - | { type: 'none' } + | { type: 'default_dual_stack' } + /** No network interfaces at all will be created for the instance. */ + | { type: 'none' } /** * Create-time parameters for an `Instance` @@ -3555,25 +3555,25 @@ export type PhysicalDiskKind = 'm2' | 'u2' */ export type PhysicalDiskPolicy = /** The operator has indicated that the disk is in-service. */ - | { kind: 'in_service' } - /** The operator has indicated that the disk has been permanently removed from service. + | { kind: 'in_service' } + /** The operator has indicated that the disk has been permanently removed from service. This is a terminal state: once a particular disk ID is expunged, it will never return to service. (The actual hardware may be reused, but it will be treated as a brand-new disk.) An expunged disk is always non-provisionable. */ - | { kind: 'expunged' } + | { kind: 'expunged' } /** * The current state of the disk, as determined by Nexus. */ export type PhysicalDiskState = /** The disk is currently active, and has resources allocated on it. */ - | 'active' + | 'active' - /** The disk has been permanently removed from service. + /** The disk has been permanently removed from service. This is a terminal state: once a particular disk ID is decommissioned, it will never return to service. (The actual hardware may be reused, but it will be treated as a brand-new disk.) */ - | 'decommissioned' + | 'decommissioned' /** * View of a Physical Disk @@ -3809,13 +3809,13 @@ export type RouteConfig = { */ export type RouteDestination = /** Route applies to traffic destined for the specified IP address */ - | { type: 'ip'; value: string } - /** Route applies to traffic destined for the specified IP subnet */ - | { type: 'ip_net'; value: IpNet } - /** Route applies to traffic destined for the specified VPC */ - | { type: 'vpc'; value: Name } - /** Route applies to traffic destined for the specified VPC subnet */ - | { type: 'subnet'; value: Name } + | { type: 'ip'; value: string } + /** Route applies to traffic destined for the specified IP subnet */ + | { type: 'ip_net'; value: IpNet } + /** Route applies to traffic destined for the specified VPC */ + | { type: 'vpc'; value: Name } + /** Route applies to traffic destined for the specified VPC subnet */ + | { type: 'subnet'; value: Name } /** * A `RouteTarget` describes the possible locations that traffic matching a route destination can be sent. @@ -3842,22 +3842,22 @@ export type RouterRouteKind = /** Determines the default destination of traffic, such as whether it goes to the internet or not. `Destination: An Internet Gateway` `Modifiable: true` */ - | 'default' + | 'default' - /** Automatically added for each VPC Subnet in the VPC + /** Automatically added for each VPC Subnet in the VPC `Destination: A VPC Subnet` `Modifiable: false` */ - | 'vpc_subnet' + | 'vpc_subnet' - /** Automatically added when VPC peering is established + /** Automatically added when VPC peering is established `Destination: A different VPC` `Modifiable: false` */ - | 'vpc_peering' + | 'vpc_peering' - /** Created by a user; see `RouteTarget` + /** Created by a user; see `RouteTarget` `Destination: User defined` `Modifiable: true` */ - | 'custom' + | 'custom' /** * A route defines a rule that governs where traffic should be sent based on its destination. @@ -4008,13 +4008,13 @@ export type SetTargetReleaseParams = { */ export type SiloIdentityMode = /** Users are authenticated with SAML using an external authentication provider. The system updates information about users and groups only during successful authentication (i.e,. "JIT provisioning" of users and groups). */ - | 'saml_jit' + | 'saml_jit' - /** The system is the source of truth about users. There is no linkage to an external authentication provider or identity provider. */ - | 'local_only' + /** The system is the source of truth about users. There is no linkage to an external authentication provider or identity provider. */ + | 'local_only' - /** Users are authenticated with SAML using an external authentication provider. Users and groups are managed with SCIM API calls, likely from the same authentication provider. */ - | 'saml_scim' + /** Users are authenticated with SAML using an external authentication provider. Users and groups are managed with SCIM API calls, likely from the same authentication provider. */ + | 'saml_scim' /** * View of a Silo @@ -4295,12 +4295,12 @@ An expunged sled is always non-provisionable. */ */ export type SledState = /** The sled is currently active, and has resources allocated on it. */ - | 'active' + | 'active' - /** The sled has been permanently removed from service. + /** The sled has been permanently removed from service. This is a terminal state: once a particular sled ID is decommissioned, it will never return to service. (The actual hardware may be reused, but it will be treated as a brand-new sled.) */ - | 'decommissioned' + | 'decommissioned' /** * An operator's view of a Sled. @@ -4681,13 +4681,13 @@ export type Switch = { */ export type SwitchInterfaceKind2 = /** Primary interfaces are associated with physical links. There is exactly one primary interface per physical link. */ - | 'primary' + | 'primary' - /** VLAN interfaces allow physical interfaces to be multiplexed onto multiple logical links, each distinguished by a 12-bit 802.1Q Ethernet tag. */ - | 'vlan' + /** VLAN interfaces allow physical interfaces to be multiplexed onto multiple logical links, each distinguished by a 12-bit 802.1Q Ethernet tag. */ + | 'vlan' - /** Loopback interfaces are anchors for IP addresses that are not specific to any particular port. */ - | 'loopback' + /** Loopback interfaces are anchors for IP addresses that are not specific to any particular port. */ + | 'loopback' /** * A switch port interface configuration for a port settings object. @@ -4710,15 +4710,15 @@ export type SwitchInterfaceConfig = { */ export type SwitchInterfaceKind = /** Primary interfaces are associated with physical links. There is exactly one primary interface per physical link. */ - | { type: 'primary' } - /** VLAN interfaces allow physical interfaces to be multiplexed onto multiple logical links, each distinguished by a 12-bit 802.1Q Ethernet tag. */ - | { - type: 'vlan' - /** The virtual network id (VID) that distinguishes this interface and is used for producing and consuming 802.1Q Ethernet tags. This field has a maximum value of 4095 as 802.1Q tags are twelve bits. */ - vid: number - } - /** Loopback interfaces are anchors for IP addresses that are not specific to any particular port. */ - | { type: 'loopback' } + | { type: 'primary' } + /** VLAN interfaces allow physical interfaces to be multiplexed onto multiple logical links, each distinguished by a 12-bit 802.1Q Ethernet tag. */ + | { + type: 'vlan' + /** The virtual network id (VID) that distinguishes this interface and is used for producing and consuming 802.1Q Ethernet tags. This field has a maximum value of 4095 as 802.1Q tags are twelve bits. */ + vid: number + } + /** Loopback interfaces are anchors for IP addresses that are not specific to any particular port. */ + | { type: 'loopback' } /** * A layer-3 switch interface configuration. When IPv6 is enabled, a link local address will be created for the interface. @@ -4783,13 +4783,13 @@ export type SwitchPortApplySettings = { */ export type SwitchPortGeometry2 = /** The port contains a single QSFP28 link with four lanes. */ - | 'qsfp28x1' + | 'qsfp28x1' - /** The port contains two QSFP28 links each with two lanes. */ - | 'qsfp28x2' + /** The port contains two QSFP28 links each with two lanes. */ + | 'qsfp28x2' - /** The port contains four SFP28 links each with one lane. */ - | 'sfp28x4' + /** The port contains four SFP28 links each with one lane. */ + | 'sfp28x4' /** * A physical port configuration for a port settings object. @@ -4806,13 +4806,13 @@ export type SwitchPortConfig = { */ export type SwitchPortGeometry = /** The port contains a single QSFP28 link with four lanes. */ - | 'qsfp28x1' + | 'qsfp28x1' - /** The port contains two QSFP28 links each with two lanes. */ - | 'qsfp28x2' + /** The port contains two QSFP28 links each with two lanes. */ + | 'qsfp28x2' - /** The port contains four SFP28 links each with one lane. */ - | 'sfp28x4' + /** The port contains four SFP28 links each with one lane. */ + | 'sfp28x4' /** * Physical switch port configuration. @@ -5312,15 +5312,15 @@ export type VpcFirewallRuleDirection = 'inbound' | 'outbound' */ export type VpcFirewallRuleHostFilter = /** The rule applies to traffic from/to all instances in the VPC */ - | { type: 'vpc'; value: Name } - /** The rule applies to traffic from/to all instances in the VPC Subnet */ - | { type: 'subnet'; value: Name } - /** The rule applies to traffic from/to this specific instance */ - | { type: 'instance'; value: Name } - /** The rule applies to traffic from/to a specific IP address */ - | { type: 'ip'; value: string } - /** The rule applies to traffic from/to a specific IP subnet */ - | { type: 'ip_net'; value: IpNet } + | { type: 'vpc'; value: Name } + /** The rule applies to traffic from/to all instances in the VPC Subnet */ + | { type: 'subnet'; value: Name } + /** The rule applies to traffic from/to this specific instance */ + | { type: 'instance'; value: Name } + /** The rule applies to traffic from/to a specific IP address */ + | { type: 'ip'; value: string } + /** The rule applies to traffic from/to a specific IP subnet */ + | { type: 'ip_net'; value: IpNet } /** * The protocols that may be specified in a firewall rule's filter @@ -5618,10 +5618,10 @@ export type NameOrIdSortMode = /** sort in increasing order of "name" */ */ export type TimeAndIdSortMode = /** sort in increasing order of timestamp and ID, i.e., earliest first */ - | 'time_and_id_ascending' + | 'time_and_id_ascending' - /** sort in increasing order of timestamp and ID, i.e., most recent first */ - | 'time_and_id_descending' + /** sort in increasing order of timestamp and ID, i.e., most recent first */ + | 'time_and_id_descending' /** * Supported set of sort modes for scanning by id only. @@ -5645,10 +5645,10 @@ export type PaginationOrder = 'ascending' | 'descending' */ export type VersionSortMode = /** Sort in increasing semantic version order (oldest first) */ - | 'version_ascending' + | 'version_ascending' - /** Sort in decreasing semantic version order (newest first) */ - | 'version_descending' + /** Sort in decreasing semantic version order (newest first) */ + | 'version_descending' /** * Supported set of sort modes for scanning by name only diff --git a/tools/generate_api_client.sh b/tools/generate_api_client.sh index c8c05756f9..fe6c25c38a 100755 --- a/tools/generate_api_client.sh +++ b/tools/generate_api_client.sh @@ -35,6 +35,9 @@ for f in Api.ts msw-handlers.ts validate.ts; do mv "$GEN_DIR/$f.tmp" "$GEN_DIR/$f" done +npm run fmt +# second fmt is temporary. see https://github.com/oxidecomputer/console/pull/3067 +# and https://github.com/oxc-project/oxc/issues/19240 npm run fmt cat > $GEN_DIR/OMICRON_VERSION <