@distilled.cloud/fly-io 1.0.0-rc.12 → 1.0.0-rc.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,16 @@ import * as T from "../traits.js";
5
5
  import { FlyIoProtocol, } from "../protocol.js";
6
6
  import { BadRequest, Conflict, Forbidden, GatewayTimeout, NotFound, UnprocessableEntity, } from "../errors.js";
7
7
  import * as Retry from "../retry.js";
8
+ export class MachineReplacing extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
9
+ /*@__PURE__*/ S.TaggedError()("MachineReplacing", {
10
+ message: S.String,
11
+ }), [
12
+ {
13
+ status: 412,
14
+ message: "failed_precondition: machine getting replaced, refusing to start",
15
+ },
16
+ ]) {
17
+ }
8
18
  export class MachineStartFromCreatedState extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
9
19
  /*@__PURE__*/ S.TaggedError()("MachineStartFromCreatedState", {
10
20
  message: S.String,
@@ -25,6 +35,22 @@ export class MachineWaitTimeout extends /*@__PURE__*/ /*@__PURE__*/ T.applyError
25
35
  },
26
36
  ]) {
27
37
  }
38
+ export class NetworkNotFound extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
39
+ /*@__PURE__*/ S.TaggedError()("NetworkNotFound", {
40
+ message: S.String,
41
+ }), [{ status: 400, message: { includes: "network not found" } }]) {
42
+ }
43
+ export class VolumeAttached extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
44
+ /*@__PURE__*/ S.TaggedError()("VolumeAttached", {
45
+ message: S.String,
46
+ }), [
47
+ {
48
+ message: {
49
+ includes: "failed_precondition: volume is currently bound to machine:",
50
+ },
51
+ },
52
+ ]) {
53
+ }
28
54
  export const AuthenticateTokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
29
55
  header: S.optional(S.String),
30
56
  }).pipe(T.Http({ method: "POST", uri: "/v1/tokens/authenticate", code: 200 }))).annotate({
@@ -207,6 +233,7 @@ export const CertificateCheckResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
207
233
  export const CordonMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
208
234
  app_name: S.String.pipe(T.Label()),
209
235
  machine_id: S.String.pipe(T.Label()),
236
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
210
237
  }).pipe(T.Http({
211
238
  method: "POST",
212
239
  uri: "/v1/apps/{app_name}/machines/{machine_id}/cordon",
@@ -219,13 +246,17 @@ export const CordonMachineResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}))
219
246
  });
220
247
  export const CreateAppRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
221
248
  enable_subdomains: S.optional(S.Boolean),
249
+ idempotency_key: S.optional(S.String),
222
250
  name: S.optional(S.String),
223
251
  network: S.optional(S.String),
224
252
  org_slug: S.optional(S.String),
225
253
  }).pipe(T.Http({ method: "POST", uri: "/v1/apps", code: 200 }))).annotate({
226
254
  identifier: "CreateAppRequest",
227
255
  });
228
- export const CreateAppResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
256
+ export const CreateAppResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
257
+ created_at: S.optional(S.Number),
258
+ id: S.optional(S.String),
259
+ })).annotate({
229
260
  identifier: "CreateAppResponse",
230
261
  });
231
262
  export const CreateAppAcmeCertificateRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
@@ -300,11 +331,18 @@ export const IPPair = /*@__PURE__*/ S.suspend(() => S.Struct({
300
331
  v4: S.optional(S.String),
301
332
  v6: S.optional(S.String),
302
333
  })).annotate({ identifier: "IPPair" });
334
+ export const IPAssignmentNetwork = /*@__PURE__*/ S.suspend(() => S.Struct({
335
+ name: S.optional(S.String),
336
+ org_slug: S.optional(S.String),
337
+ })).annotate({
338
+ identifier: "IPAssignmentNetwork",
339
+ });
303
340
  export const AssignIPResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
304
341
  created_at: S.optional(S.String),
305
342
  egress: S.optional(S.Boolean),
306
343
  ip: S.optional(S.String),
307
344
  ip_pair: S.optional(IPPair),
345
+ network: S.optional(S.NullOr(IPAssignmentNetwork)),
308
346
  region: S.optional(S.String),
309
347
  service_name: S.optional(S.String),
310
348
  shared: S.optional(S.Boolean),
@@ -412,7 +450,6 @@ export const FlyContainerHealthcheck = /*@__PURE__*/ S.suspend(() => S.Struct({
412
450
  export const FlyContainerConfigHealthchecksList = /*@__PURE__*/ S.Array(FlyContainerHealthcheck);
413
451
  export const FlyMachineRestartPolicy = S.String;
414
452
  export const FlyMachineRestart = /*@__PURE__*/ S.suspend(() => S.Struct({
415
- gpu_bid_price: S.optional(S.Number),
416
453
  max_retries: S.optional(S.Number),
417
454
  policy: S.optional(FlyMachineRestartPolicy),
418
455
  })).annotate({
@@ -476,6 +513,7 @@ export const FlyMachineConfigEnvMap = /*@__PURE__*/ S.Record(S.String, S.String)
476
513
  export const FlyMachineConfigFilesList = /*@__PURE__*/ S.Array(FlyFile);
477
514
  export const FlyMachineGuestKernelArgsList = /*@__PURE__*/ S.Array(S.String);
478
515
  export const FlyMachineGuestPersistRootfs = S.String;
516
+ export const FlyMachineGuestRequiredHostFeaturesList = /*@__PURE__*/ S.Array(S.String);
479
517
  export const FlyMachineGuest = /*@__PURE__*/ S.suspend(() => S.Struct({
480
518
  cpu_kind: S.optional(S.String),
481
519
  cpus: S.optional(S.Number),
@@ -486,6 +524,7 @@ export const FlyMachineGuest = /*@__PURE__*/ S.suspend(() => S.Struct({
486
524
  max_memory_mb: S.optional(S.Number),
487
525
  memory_mb: S.optional(S.Number),
488
526
  persist_rootfs: S.optional(FlyMachineGuestPersistRootfs),
527
+ required_host_features: S.optional(FlyMachineGuestRequiredHostFeaturesList),
489
528
  })).annotate({
490
529
  identifier: "FlyMachineGuest",
491
530
  });
@@ -511,8 +550,10 @@ export const FlyMachineMetrics = /*@__PURE__*/ S.suspend(() => S.Struct({
511
550
  });
512
551
  export const FlyMachineMount = /*@__PURE__*/ S.suspend(() => S.Struct({
513
552
  add_size_gb: S.optional(S.Number),
553
+ add_size_percent: S.optional(S.Number),
514
554
  encrypted: S.optional(S.Boolean),
515
555
  extend_threshold_percent: S.optional(S.Number),
556
+ min_add_size_gb: S.optional(S.Number),
516
557
  name: S.optional(S.String),
517
558
  path: S.optional(S.String),
518
559
  size_gb: S.optional(S.Number),
@@ -548,7 +589,9 @@ export const FlyMachineRootfs = /*@__PURE__*/ S.suspend(() => S.Struct({
548
589
  })).annotate({
549
590
  identifier: "FlyMachineRootfs",
550
591
  });
551
- export const FlyMachineServiceAutostop = S.String;
592
+ export const FlyMachineServiceAutostopMode = S.String;
593
+ export const FlyMachineServiceAutostop =
594
+ /*@__PURE__*/ S.Union([FlyMachineServiceAutostopMode, S.Boolean]);
552
595
  export const FlyMachineServiceCheckHeadersList = /*@__PURE__*/ S.Array(FlyMachineHTTPHeader);
553
596
  export const FlyMachineServiceCheck = /*@__PURE__*/ S.suspend(() => S.Struct({
554
597
  grace_period: S.optional(S.String),
@@ -704,6 +747,7 @@ export const MachineEvent = /*@__PURE__*/ S.suspend(() => S.Struct({
704
747
  type: S.optional(S.String),
705
748
  })).annotate({ identifier: "MachineEvent" });
706
749
  export const MachineEventsList = /*@__PURE__*/ S.Array(MachineEvent);
750
+ export const MachineHostFeaturesList = /*@__PURE__*/ S.Array(S.String);
707
751
  export const MachineHostStatus = S.String;
708
752
  export const ImageRefLabelsMap = /*@__PURE__*/ S.Record(S.String, S.String);
709
753
  export const ImageRef = /*@__PURE__*/ S.suspend(() => S.Struct({
@@ -724,6 +768,7 @@ export const Machine = /*@__PURE__*/ S.suspend(() => S.Struct({
724
768
  cordoned: S.optional(S.Boolean),
725
769
  created_at: S.optional(S.String),
726
770
  events: S.optional(MachineEventsList),
771
+ host_features: S.optional(MachineHostFeaturesList),
727
772
  host_status: S.optional(MachineHostStatus),
728
773
  id: S.optional(S.String),
729
774
  image_ref: S.optional(ImageRef),
@@ -736,12 +781,14 @@ export const Machine = /*@__PURE__*/ S.suspend(() => S.Struct({
736
781
  region: S.optional(S.String),
737
782
  state: S.optional(S.String),
738
783
  updated_at: S.optional(S.String),
784
+ version: S.optional(S.String),
739
785
  })).annotate({ identifier: "Machine" });
740
786
  export const CreateMachineLeaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
741
787
  app_name: S.String.pipe(T.Label()),
742
788
  machine_id: S.String.pipe(T.Label()),
743
789
  description: S.optional(S.String),
744
- ttl: S.optional(S.Number),
790
+ ttl: S.optional(S.Number.pipe(T.Query())),
791
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
745
792
  }).pipe(T.Http({
746
793
  method: "POST",
747
794
  uri: "/v1/apps/{app_name}/machines/{machine_id}/lease",
@@ -756,6 +803,10 @@ export const Lease = /*@__PURE__*/ S.suspend(() => S.Struct({
756
803
  owner: S.optional(S.String),
757
804
  version: S.optional(S.String),
758
805
  })).annotate({ identifier: "Lease" });
806
+ export const MachineLease = /*@__PURE__*/ S.suspend(() => S.Struct({
807
+ status: S.optional(S.String),
808
+ data: S.optional(Lease),
809
+ })).annotate({ identifier: "MachineLease" });
759
810
  export const CreatePostgresRequestPgMajorVersion = S.String;
760
811
  export const CreatePostgresRequestPlan = S.String;
761
812
  export const CreatePostgresRequestPoolMode = S.String;
@@ -821,6 +872,8 @@ export const PostgresCluster = /*@__PURE__*/ S.suspend(() => S.Struct({
821
872
  region: S.optional(S.String),
822
873
  replicas: S.optional(S.Number),
823
874
  status: S.optional(PostgresClusterStatus),
875
+ storage_provisioned_bytes: S.optional(S.NullOr(S.Number)),
876
+ storage_used_bytes: S.optional(S.NullOr(S.Number)),
824
877
  })).annotate({
825
878
  identifier: "PostgresCluster",
826
879
  });
@@ -947,7 +1000,9 @@ export const CreateVolumeRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
947
1000
  }).pipe(T.Http({ method: "POST", uri: "/v1/apps/{app_name}/volumes", code: 200 }))).annotate({
948
1001
  identifier: "CreateVolumeRequest",
949
1002
  });
1003
+ export const VolumeHostFeaturesList = /*@__PURE__*/ S.Array(S.String);
950
1004
  export const VolumeHostStatus = S.String;
1005
+ export const VolumeRequiredHostFeaturesList = /*@__PURE__*/ S.Array(S.String);
951
1006
  export const VolumeType = S.String;
952
1007
  export const Volume = /*@__PURE__*/ S.suspend(() => S.Struct({
953
1008
  attached_alloc_id: S.optional(S.String),
@@ -962,10 +1017,12 @@ export const Volume = /*@__PURE__*/ S.suspend(() => S.Struct({
962
1017
  created_at: S.optional(S.String),
963
1018
  encrypted: S.optional(S.Boolean),
964
1019
  fstype: S.optional(S.String),
1020
+ host_features: S.optional(VolumeHostFeaturesList),
965
1021
  host_status: S.optional(VolumeHostStatus),
966
1022
  id: S.optional(S.String),
967
1023
  name: S.optional(S.String),
968
1024
  region: S.optional(S.String),
1025
+ required_host_features: S.optional(VolumeRequiredHostFeaturesList),
969
1026
  size_gb: S.optional(S.Number),
970
1027
  snapshot_retention: S.optional(S.Number),
971
1028
  state: S.optional(S.String),
@@ -1080,6 +1137,7 @@ export const DeleteMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1080
1137
  app_name: S.String.pipe(T.Label()),
1081
1138
  machine_id: S.String.pipe(T.Label()),
1082
1139
  force: S.optional(S.Boolean.pipe(T.Query())),
1140
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
1083
1141
  }).pipe(T.Http({
1084
1142
  method: "DELETE",
1085
1143
  uri: "/v1/apps/{app_name}/machines/{machine_id}",
@@ -1372,6 +1430,7 @@ export const CurrentTokenResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
1372
1430
  export const GetMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1373
1431
  app_name: S.String.pipe(T.Label()),
1374
1432
  machine_id: S.String.pipe(T.Label()),
1433
+ version: S.optional(S.String.pipe(T.Query())),
1375
1434
  include_leases: S.optional(S.Boolean.pipe(T.Query())),
1376
1435
  }).pipe(T.Http({
1377
1436
  method: "GET",
@@ -1588,6 +1647,7 @@ export const IPAssignment = /*@__PURE__*/ S.suspend(() => S.Struct({
1588
1647
  created_at: S.optional(S.String),
1589
1648
  egress: S.optional(S.Boolean),
1590
1649
  ip: S.optional(S.String),
1650
+ network: S.optional(S.NullOr(IPAssignmentNetwork)),
1591
1651
  region: S.optional(S.String),
1592
1652
  service_name: S.optional(S.String),
1593
1653
  shared: S.optional(S.Boolean),
@@ -1666,6 +1726,8 @@ export const ListMachinesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1666
1726
  state: S.optional(S.String.pipe(T.Query())),
1667
1727
  summary: S.optional(S.Boolean.pipe(T.Query())),
1668
1728
  metadata__key_: S.optional(S.String.pipe(T.Query("metadata.{key}"))),
1729
+ cursor: S.optional(S.String.pipe(T.Query())),
1730
+ limit: S.optional(S.Number.pipe(T.Query())),
1669
1731
  }).pipe(T.Http({ method: "GET", uri: "/v1/apps/{app_name}/machines", code: 200 }))).annotate({
1670
1732
  identifier: "ListMachinesRequest",
1671
1733
  });
@@ -1810,16 +1872,16 @@ export const ListPostgresExtensionsRequest = /*@__PURE__*/ S.suspend(() => S.Str
1810
1872
  }))).annotate({
1811
1873
  identifier: "ListPostgresExtensionsRequest",
1812
1874
  });
1813
- export const PostgresInstalledExtension = /*@__PURE__*/ S.suspend(() => S.Struct({
1875
+ export const PostgresExtensionInstalled = /*@__PURE__*/ S.suspend(() => S.Struct({
1814
1876
  schema: S.optional(S.String),
1815
1877
  version: S.optional(S.String),
1816
1878
  })).annotate({
1817
- identifier: "PostgresInstalledExtension",
1879
+ identifier: "PostgresExtensionInstalled",
1818
1880
  });
1819
1881
  export const PostgresExtension = /*@__PURE__*/ S.suspend(() => S.Struct({
1820
1882
  default_version: S.optional(S.String),
1821
1883
  description: S.optional(S.String),
1822
- installed: S.optional(PostgresInstalledExtension),
1884
+ installed: S.optional(S.NullOr(PostgresExtensionInstalled)),
1823
1885
  name: S.optional(S.String),
1824
1886
  system: S.optional(S.Boolean),
1825
1887
  })).annotate({
@@ -1913,7 +1975,9 @@ export const ListVolumesOrgRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1913
1975
  }).pipe(T.Http({ method: "GET", uri: "/v1/orgs/{org_slug}/volumes", code: 200 }))).annotate({
1914
1976
  identifier: "ListVolumesOrgRequest",
1915
1977
  });
1978
+ export const OrgVolumeHostFeaturesList = /*@__PURE__*/ S.Array(S.String);
1916
1979
  export const OrgVolumeHostStatus = S.String;
1980
+ export const OrgVolumeRequiredHostFeaturesList = /*@__PURE__*/ S.Array(S.String);
1917
1981
  export const OrgVolumeType = S.String;
1918
1982
  export const OrgVolume = /*@__PURE__*/ S.suspend(() => S.Struct({
1919
1983
  app_name: S.optional(S.String),
@@ -1929,10 +1993,12 @@ export const OrgVolume = /*@__PURE__*/ S.suspend(() => S.Struct({
1929
1993
  created_at: S.optional(S.String),
1930
1994
  encrypted: S.optional(S.Boolean),
1931
1995
  fstype: S.optional(S.String),
1996
+ host_features: S.optional(OrgVolumeHostFeaturesList),
1932
1997
  host_status: S.optional(OrgVolumeHostStatus),
1933
1998
  id: S.optional(S.String),
1934
1999
  name: S.optional(S.String),
1935
2000
  region: S.optional(S.String),
2001
+ required_host_features: S.optional(OrgVolumeRequiredHostFeaturesList),
1936
2002
  size_gb: S.optional(S.Number),
1937
2003
  snapshot_retention: S.optional(S.Number),
1938
2004
  state: S.optional(S.String),
@@ -1952,6 +2018,7 @@ export const OrgVolumesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
1952
2018
  export const MachinesReleaseLeaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1953
2019
  app_name: S.String.pipe(T.Label()),
1954
2020
  machine_id: S.String.pipe(T.Label()),
2021
+ lease_nonce: S.String.pipe(T.Header("fly-machine-lease-nonce")),
1955
2022
  }).pipe(T.Http({
1956
2023
  method: "DELETE",
1957
2024
  uri: "/v1/apps/{app_name}/machines/{machine_id}/lease",
@@ -1979,6 +2046,65 @@ export const PatchMachineMetadataRequest = /*@__PURE__*/ S.suspend(() => S.Struc
1979
2046
  export const PatchMachineMetadataResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
1980
2047
  identifier: "PatchMachineMetadataResponse",
1981
2048
  });
2049
+ export const PostgresQueriesActiveRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2050
+ postgres_cluster_id: S.String.pipe(T.Label()),
2051
+ database: S.String.pipe(T.Query()),
2052
+ }).pipe(T.Http({
2053
+ method: "GET",
2054
+ uri: "/v1/postgres/{postgres_cluster_id}/queries/active",
2055
+ code: 200,
2056
+ }))).annotate({
2057
+ identifier: "PostgresQueriesActiveRequest",
2058
+ });
2059
+ export const PostgresActiveQuery = /*@__PURE__*/ S.suspend(() => S.Struct({
2060
+ application_name: S.optional(S.String),
2061
+ client: S.optional(S.String),
2062
+ database: S.optional(S.String),
2063
+ duration_seconds: S.optional(S.Number),
2064
+ pid: S.optional(S.Number),
2065
+ query: S.optional(S.String),
2066
+ state: S.optional(S.String),
2067
+ state_duration_seconds: S.optional(S.Number),
2068
+ user: S.optional(S.String),
2069
+ wait_event: S.optional(S.String),
2070
+ wait_event_type: S.optional(S.String),
2071
+ })).annotate({
2072
+ identifier: "PostgresActiveQuery",
2073
+ });
2074
+ export const ListPostgresActiveQueriesResponseDataList = /*@__PURE__*/ S.Array(PostgresActiveQuery);
2075
+ export const ListPostgresActiveQueriesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
2076
+ data: S.optional(ListPostgresActiveQueriesResponseDataList),
2077
+ })).annotate({
2078
+ identifier: "ListPostgresActiveQueriesResponse",
2079
+ });
2080
+ export const PostgresQueriesSlowRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2081
+ postgres_cluster_id: S.String.pipe(T.Label()),
2082
+ range: S.optional(S.Number.pipe(T.Query())),
2083
+ }).pipe(T.Http({
2084
+ method: "GET",
2085
+ uri: "/v1/postgres/{postgres_cluster_id}/queries/slow",
2086
+ code: 200,
2087
+ }))).annotate({
2088
+ identifier: "PostgresQueriesSlowRequest",
2089
+ });
2090
+ export const PostgresSlowQuery = /*@__PURE__*/ S.suspend(() => S.Struct({
2091
+ calls: S.optional(S.Number),
2092
+ database: S.optional(S.String),
2093
+ max_exec_time_seconds: S.optional(S.Number),
2094
+ mean_exec_time_seconds: S.optional(S.Number),
2095
+ query: S.optional(S.String),
2096
+ query_id: S.optional(S.String),
2097
+ total_exec_time_seconds: S.optional(S.Number),
2098
+ user: S.optional(S.String),
2099
+ })).annotate({
2100
+ identifier: "PostgresSlowQuery",
2101
+ });
2102
+ export const ListPostgresSlowQueriesResponseDataList = /*@__PURE__*/ S.Array(PostgresSlowQuery);
2103
+ export const ListPostgresSlowQueriesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
2104
+ data: S.optional(ListPostgresSlowQueriesResponseDataList),
2105
+ })).annotate({
2106
+ identifier: "ListPostgresSlowQueriesResponse",
2107
+ });
1982
2108
  export const PostgresUsersCredentialsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1983
2109
  postgres_cluster_id: S.String.pipe(T.Label()),
1984
2110
  username: S.String.pipe(T.Label()),
@@ -2037,6 +2163,7 @@ export const RestartMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2037
2163
  machine_id: S.String.pipe(T.Label()),
2038
2164
  timeout: S.optional(S.String.pipe(T.Query())),
2039
2165
  signal: S.optional(RestartMachineRequestSignal.pipe(T.Query())),
2166
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
2040
2167
  }).pipe(T.Http({
2041
2168
  method: "POST",
2042
2169
  uri: "/v1/apps/{app_name}/machines/{machine_id}/restart",
@@ -2134,6 +2261,7 @@ export const SignSecretkeyResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
2134
2261
  export const StartMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2135
2262
  app_name: S.String.pipe(T.Label()),
2136
2263
  machine_id: S.String.pipe(T.Label()),
2264
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
2137
2265
  }).pipe(T.Http({
2138
2266
  method: "POST",
2139
2267
  uri: "/v1/apps/{app_name}/machines/{machine_id}/start",
@@ -2150,6 +2278,7 @@ export const StopMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2150
2278
  machine_id: S.String.pipe(T.Label()),
2151
2279
  signal: S.optional(StopMachineRequestSignal),
2152
2280
  timeout: S.optional(S.String),
2281
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
2153
2282
  }).pipe(T.Http({
2154
2283
  method: "POST",
2155
2284
  uri: "/v1/apps/{app_name}/machines/{machine_id}/stop",
@@ -2163,6 +2292,7 @@ export const StopMachineResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).a
2163
2292
  export const SuspendMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2164
2293
  app_name: S.String.pipe(T.Label()),
2165
2294
  machine_id: S.String.pipe(T.Label()),
2295
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
2166
2296
  }).pipe(T.Http({
2167
2297
  method: "POST",
2168
2298
  uri: "/v1/apps/{app_name}/machines/{machine_id}/suspend",
@@ -2176,6 +2306,7 @@ export const SuspendMachineResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})
2176
2306
  export const UncordonMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2177
2307
  app_name: S.String.pipe(T.Label()),
2178
2308
  machine_id: S.String.pipe(T.Label()),
2309
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
2179
2310
  }).pipe(T.Http({
2180
2311
  method: "POST",
2181
2312
  uri: "/v1/apps/{app_name}/machines/{machine_id}/uncordon",
@@ -2198,6 +2329,7 @@ export const UpdateMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2198
2329
  skip_launch: S.optional(S.Boolean),
2199
2330
  skip_secrets: S.optional(S.Boolean),
2200
2331
  skip_service_registration: S.optional(S.Boolean),
2332
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
2201
2333
  }).pipe(T.Http({
2202
2334
  method: "POST",
2203
2335
  uri: "/v1/apps/{app_name}/machines/{machine_id}",
@@ -2205,23 +2337,6 @@ export const UpdateMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2205
2337
  }))).annotate({
2206
2338
  identifier: "UpdateMachineRequest",
2207
2339
  });
2208
- export const UpdateMachineMetadataRequestMetadataMap = /*@__PURE__*/ S.Record(S.String, S.String);
2209
- export const UpdateMachineMetadataRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2210
- app_name: S.String.pipe(T.Label()),
2211
- machine_id: S.String.pipe(T.Label()),
2212
- machine_version: S.optional(S.String),
2213
- metadata: S.optional(UpdateMachineMetadataRequestMetadataMap),
2214
- updated_at: S.optional(S.String),
2215
- }).pipe(T.Http({
2216
- method: "PUT",
2217
- uri: "/v1/apps/{app_name}/machines/{machine_id}/metadata",
2218
- code: 200,
2219
- }))).annotate({
2220
- identifier: "UpdateMachineMetadataRequest",
2221
- });
2222
- export const UpdateMachineMetadataResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
2223
- identifier: "UpdateMachineMetadataResponse",
2224
- });
2225
2340
  export const UpdatePostgresUserRoleRequestRole = S.String;
2226
2341
  export const UpdatePostgresUserRoleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2227
2342
  postgres_cluster_id: S.String.pipe(T.Label()),
@@ -2348,7 +2463,7 @@ export const checkAppCertificate = /*@__PURE__*/ API.make(() => ({
2348
2463
  export const cordonMachine = /*@__PURE__*/ API.make(() => ({
2349
2464
  input: CordonMachineRequest,
2350
2465
  output: CordonMachineResponse,
2351
- errors: [BadRequest, Forbidden, NotFound],
2466
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
2352
2467
  protocol: FlyIoProtocol,
2353
2468
  retry: Retry.Retry,
2354
2469
  }));
@@ -2388,7 +2503,7 @@ export const createAppDeployToken = /*@__PURE__*/ API.make(() => ({
2388
2503
  export const createAppIPAssignment = /*@__PURE__*/ API.make(() => ({
2389
2504
  input: CreateAppIPAssignmentRequest,
2390
2505
  output: AssignIPResponse,
2391
- errors: [BadRequest, Forbidden, NotFound, Conflict],
2506
+ errors: [BadRequest, Forbidden, NotFound, Conflict, NetworkNotFound],
2392
2507
  protocol: FlyIoProtocol,
2393
2508
  retry: Retry.Retry,
2394
2509
  }));
@@ -2403,12 +2518,12 @@ export const createMachine = /*@__PURE__*/ API.make(() => ({
2403
2518
  /** Create Lease Create a lease for a specific Machine within an app using the details provided in the request body. Machine leases can be used to obtain an exclusive lock on modifying a Machine. */
2404
2519
  export const createMachineLease = /*@__PURE__*/ API.make(() => ({
2405
2520
  input: CreateMachineLeaseRequest,
2406
- output: Lease,
2407
- errors: [BadRequest, Forbidden, NotFound],
2521
+ output: MachineLease,
2522
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
2408
2523
  protocol: FlyIoProtocol,
2409
2524
  retry: Retry.Retry,
2410
2525
  }));
2411
- /** Create Postgres Cluster Create a Managed Postgres cluster for the organization named in the request body. Provisioning is asynchronous, and a name is generated when one is not supplied. */
2526
+ /** Create Postgres Cluster Create a Managed Postgres cluster for the organization named in the request body. Provisioning is asynchronous: poll `GET /v1/postgres/{id}` until `status == ready` before calling database, user, extension, or credential endpoints. */
2412
2527
  export const createPostgres = /*@__PURE__*/ API.make(() => ({
2413
2528
  input: CreatePostgresRequest,
2414
2529
  output: ShowPostgresClusterResponse,
@@ -2416,7 +2531,7 @@ export const createPostgres = /*@__PURE__*/ API.make(() => ({
2416
2531
  protocol: FlyIoProtocol,
2417
2532
  retry: Retry.Retry,
2418
2533
  }));
2419
- /** Attach Cluster to App Attach a specific cluster to a Fly app. The attachment is created if it does not already exist. */
2534
+ /** Attach Cluster to App Record an attachment between a cluster and a Fly app. This endpoint records the relationship but does not set DATABASE_URL or other app secrets; configure the connection string separately. The attachment is created if it does not already exist. */
2420
2535
  export const createPostgresAttachment = /*@__PURE__*/ API.make(() => ({
2421
2536
  input: CreatePostgresAttachmentRequest,
2422
2537
  output: CreatePostgresAttachmentResponse,
@@ -2588,7 +2703,7 @@ export const deleteSecretKey = /*@__PURE__*/ API.make(() => ({
2588
2703
  export const deleteVolume = /*@__PURE__*/ API.make(() => ({
2589
2704
  input: DeleteVolumeRequest,
2590
2705
  output: Volume,
2591
- errors: [Forbidden, NotFound, Conflict],
2706
+ errors: [Forbidden, NotFound, Conflict, VolumeAttached],
2592
2707
  protocol: FlyIoProtocol,
2593
2708
  retry: Retry.Retry,
2594
2709
  }));
@@ -2620,7 +2735,7 @@ export const encryptSecretKey = /*@__PURE__*/ API.make(() => ({
2620
2735
  export const execMachine = /*@__PURE__*/ API.make(() => ({
2621
2736
  input: ExecMachineRequest,
2622
2737
  output: Flydv1ExecResponse,
2623
- errors: [BadRequest, Forbidden, NotFound],
2738
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
2624
2739
  protocol: FlyIoProtocol,
2625
2740
  retry: Retry.Retry,
2626
2741
  }));
@@ -2683,7 +2798,7 @@ export const getMachine = /*@__PURE__*/ API.make(() => ({
2683
2798
  /** Get Lease Retrieve the current lease of a specific Machine within an app. Machine leases can be used to obtain an exclusive lock on modifying a Machine. */
2684
2799
  export const getMachineLease = /*@__PURE__*/ API.make(() => ({
2685
2800
  input: GetMachineLeaseRequest,
2686
- output: Lease,
2801
+ output: MachineLease,
2687
2802
  errors: [Forbidden, NotFound],
2688
2803
  protocol: FlyIoProtocol,
2689
2804
  retry: Retry.Retry,
@@ -2828,7 +2943,7 @@ export const listMachineVersions = /*@__PURE__*/ API.make(() => ({
2828
2943
  export const listPostgres = /*@__PURE__*/ API.make(() => ({
2829
2944
  input: ListPostgresRequest,
2830
2945
  output: ListPostgresClustersResponse,
2831
- errors: [NotFound, UnprocessableEntity],
2946
+ errors: [BadRequest, NotFound, UnprocessableEntity],
2832
2947
  protocol: FlyIoProtocol,
2833
2948
  retry: Retry.Retry,
2834
2949
  }));
@@ -2912,11 +3027,27 @@ export const machinesReleaseLease = /*@__PURE__*/ API.make(() => ({
2912
3027
  protocol: FlyIoProtocol,
2913
3028
  retry: Retry.Retry,
2914
3029
  }));
2915
- /** Update Metadata (set/remove multiple keys) Update multiple metadata keys at once. Null values and empty strings remove keys. + If `machine_version` is provided and no longer matches the current machine version, returns 412 Precondition Failed. */
3030
+ /** Update Metadata (set/remove multiple keys) Update multiple metadata keys at once. Keys that are not in the request are left untouched. Null values and empty strings remove keys. + If `machine_version` is provided and no longer matches the current machine version, returns 412 Precondition Failed. */
2916
3031
  export const patchMachineMetadata = /*@__PURE__*/ API.make(() => ({
2917
3032
  input: PatchMachineMetadataRequest,
2918
3033
  output: PatchMachineMetadataResponse,
2919
- errors: [BadRequest],
3034
+ errors: [BadRequest, Forbidden, NotFound],
3035
+ protocol: FlyIoProtocol,
3036
+ retry: Retry.Retry,
3037
+ }));
3038
+ /** List Active Queries List active queries in the supplied database. The database query parameter is required and must not be empty or whitespace-only. Returns full query text and durations in seconds. */
3039
+ export const postgresQueriesActive = /*@__PURE__*/ API.make(() => ({
3040
+ input: PostgresQueriesActiveRequest,
3041
+ output: ListPostgresActiveQueriesResponse,
3042
+ errors: [NotFound, UnprocessableEntity],
3043
+ protocol: FlyIoProtocol,
3044
+ retry: Retry.Retry,
3045
+ }));
3046
+ /** List Slow Queries List the top 20 queries by cumulative total execution time, excluding the postgres database. Uses the latest available metrics within the lookback range; statistics are cumulative PostgreSQL counters, not deltas over that range. Returns full query text and execution times in seconds. */
3047
+ export const postgresQueriesSlow = /*@__PURE__*/ API.make(() => ({
3048
+ input: PostgresQueriesSlowRequest,
3049
+ output: ListPostgresSlowQueriesResponse,
3050
+ errors: [NotFound, UnprocessableEntity],
2920
3051
  protocol: FlyIoProtocol,
2921
3052
  retry: Retry.Retry,
2922
3053
  }));
@@ -2956,7 +3087,7 @@ export const requestOidcToken = /*@__PURE__*/ API.make(() => ({
2956
3087
  export const restartMachine = /*@__PURE__*/ API.make(() => ({
2957
3088
  input: RestartMachineRequest,
2958
3089
  output: RestartMachineResponse,
2959
- errors: [BadRequest, Forbidden, NotFound],
3090
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
2960
3091
  protocol: FlyIoProtocol,
2961
3092
  retry: Retry.Retry,
2962
3093
  }));
@@ -3018,6 +3149,7 @@ export const startMachine = /*@__PURE__*/ API.make(() => ({
3018
3149
  NotFound,
3019
3150
  Conflict,
3020
3151
  MachineStartFromCreatedState,
3152
+ MachineReplacing,
3021
3153
  ],
3022
3154
  protocol: FlyIoProtocol,
3023
3155
  retry: Retry.Retry,
@@ -3026,7 +3158,7 @@ export const startMachine = /*@__PURE__*/ API.make(() => ({
3026
3158
  export const stopMachine = /*@__PURE__*/ API.make(() => ({
3027
3159
  input: StopMachineRequest,
3028
3160
  output: StopMachineResponse,
3029
- errors: [BadRequest, Forbidden, NotFound],
3161
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
3030
3162
  protocol: FlyIoProtocol,
3031
3163
  retry: Retry.Retry,
3032
3164
  }));
@@ -3034,7 +3166,7 @@ export const stopMachine = /*@__PURE__*/ API.make(() => ({
3034
3166
  export const suspendMachine = /*@__PURE__*/ API.make(() => ({
3035
3167
  input: SuspendMachineRequest,
3036
3168
  output: SuspendMachineResponse,
3037
- errors: [BadRequest, Forbidden, NotFound],
3169
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
3038
3170
  protocol: FlyIoProtocol,
3039
3171
  retry: Retry.Retry,
3040
3172
  }));
@@ -3042,7 +3174,7 @@ export const suspendMachine = /*@__PURE__*/ API.make(() => ({
3042
3174
  export const uncordonMachine = /*@__PURE__*/ API.make(() => ({
3043
3175
  input: UncordonMachineRequest,
3044
3176
  output: UncordonMachineResponse,
3045
- errors: [BadRequest, Forbidden, NotFound],
3177
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
3046
3178
  protocol: FlyIoProtocol,
3047
3179
  retry: Retry.Retry,
3048
3180
  }));
@@ -3054,14 +3186,6 @@ export const updateMachine = /*@__PURE__*/ API.make(() => ({
3054
3186
  protocol: FlyIoProtocol,
3055
3187
  retry: Retry.Retry,
3056
3188
  }));
3057
- /** Update Metadata (set/remove multiple keys) Update multiple metadata keys at once. Null values and empty strings remove keys. + If `machine_version` is provided and no longer matches the current machine version, returns 412 Precondition Failed. */
3058
- export const updateMachineMetadata = /*@__PURE__*/ API.make(() => ({
3059
- input: UpdateMachineMetadataRequest,
3060
- output: UpdateMachineMetadataResponse,
3061
- errors: [BadRequest, Forbidden, NotFound],
3062
- protocol: FlyIoProtocol,
3063
- retry: Retry.Retry,
3064
- }));
3065
3189
  /** Update User Role Update a specific Postgres user's role within a cluster. */
3066
3190
  export const updatePostgresUserRole = /*@__PURE__*/ API.make(() => ({
3067
3191
  input: UpdatePostgresUserRoleRequest,