@distilled.cloud/fly-io 1.0.0-rc.11 → 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,52 @@ 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
+ }
18
+ export class MachineStartFromCreatedState extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
19
+ /*@__PURE__*/ S.TaggedError()("MachineStartFromCreatedState", {
20
+ message: S.String,
21
+ }), [
22
+ {
23
+ message: "failed_precondition: unable to start machine from current state: 'created'",
24
+ },
25
+ ]) {
26
+ }
27
+ export class MachineWaitTimeout extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
28
+ /*@__PURE__*/ S.TaggedError()("MachineWaitTimeout", {
29
+ message: S.String,
30
+ }), [
31
+ {
32
+ message: {
33
+ matches: "^deadline_exceeded: machine failed to reach desired state, [a-z_]+, currently [a-z_]+$",
34
+ },
35
+ },
36
+ ]) {
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
+ }
8
54
  export const AuthenticateTokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
9
55
  header: S.optional(S.String),
10
56
  }).pipe(T.Http({ method: "POST", uri: "/v1/tokens/authenticate", code: 200 }))).annotate({
@@ -187,6 +233,7 @@ export const CertificateCheckResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
187
233
  export const CordonMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
188
234
  app_name: S.String.pipe(T.Label()),
189
235
  machine_id: S.String.pipe(T.Label()),
236
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
190
237
  }).pipe(T.Http({
191
238
  method: "POST",
192
239
  uri: "/v1/apps/{app_name}/machines/{machine_id}/cordon",
@@ -199,13 +246,17 @@ export const CordonMachineResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}))
199
246
  });
200
247
  export const CreateAppRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
201
248
  enable_subdomains: S.optional(S.Boolean),
249
+ idempotency_key: S.optional(S.String),
202
250
  name: S.optional(S.String),
203
251
  network: S.optional(S.String),
204
252
  org_slug: S.optional(S.String),
205
253
  }).pipe(T.Http({ method: "POST", uri: "/v1/apps", code: 200 }))).annotate({
206
254
  identifier: "CreateAppRequest",
207
255
  });
208
- 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({
209
260
  identifier: "CreateAppResponse",
210
261
  });
211
262
  export const CreateAppAcmeCertificateRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
@@ -280,11 +331,18 @@ export const IPPair = /*@__PURE__*/ S.suspend(() => S.Struct({
280
331
  v4: S.optional(S.String),
281
332
  v6: S.optional(S.String),
282
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
+ });
283
340
  export const AssignIPResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
284
341
  created_at: S.optional(S.String),
285
342
  egress: S.optional(S.Boolean),
286
343
  ip: S.optional(S.String),
287
344
  ip_pair: S.optional(IPPair),
345
+ network: S.optional(S.NullOr(IPAssignmentNetwork)),
288
346
  region: S.optional(S.String),
289
347
  service_name: S.optional(S.String),
290
348
  shared: S.optional(S.Boolean),
@@ -392,7 +450,6 @@ export const FlyContainerHealthcheck = /*@__PURE__*/ S.suspend(() => S.Struct({
392
450
  export const FlyContainerConfigHealthchecksList = /*@__PURE__*/ S.Array(FlyContainerHealthcheck);
393
451
  export const FlyMachineRestartPolicy = S.String;
394
452
  export const FlyMachineRestart = /*@__PURE__*/ S.suspend(() => S.Struct({
395
- gpu_bid_price: S.optional(S.Number),
396
453
  max_retries: S.optional(S.Number),
397
454
  policy: S.optional(FlyMachineRestartPolicy),
398
455
  })).annotate({
@@ -456,6 +513,7 @@ export const FlyMachineConfigEnvMap = /*@__PURE__*/ S.Record(S.String, S.String)
456
513
  export const FlyMachineConfigFilesList = /*@__PURE__*/ S.Array(FlyFile);
457
514
  export const FlyMachineGuestKernelArgsList = /*@__PURE__*/ S.Array(S.String);
458
515
  export const FlyMachineGuestPersistRootfs = S.String;
516
+ export const FlyMachineGuestRequiredHostFeaturesList = /*@__PURE__*/ S.Array(S.String);
459
517
  export const FlyMachineGuest = /*@__PURE__*/ S.suspend(() => S.Struct({
460
518
  cpu_kind: S.optional(S.String),
461
519
  cpus: S.optional(S.Number),
@@ -466,6 +524,7 @@ export const FlyMachineGuest = /*@__PURE__*/ S.suspend(() => S.Struct({
466
524
  max_memory_mb: S.optional(S.Number),
467
525
  memory_mb: S.optional(S.Number),
468
526
  persist_rootfs: S.optional(FlyMachineGuestPersistRootfs),
527
+ required_host_features: S.optional(FlyMachineGuestRequiredHostFeaturesList),
469
528
  })).annotate({
470
529
  identifier: "FlyMachineGuest",
471
530
  });
@@ -491,8 +550,10 @@ export const FlyMachineMetrics = /*@__PURE__*/ S.suspend(() => S.Struct({
491
550
  });
492
551
  export const FlyMachineMount = /*@__PURE__*/ S.suspend(() => S.Struct({
493
552
  add_size_gb: S.optional(S.Number),
553
+ add_size_percent: S.optional(S.Number),
494
554
  encrypted: S.optional(S.Boolean),
495
555
  extend_threshold_percent: S.optional(S.Number),
556
+ min_add_size_gb: S.optional(S.Number),
496
557
  name: S.optional(S.String),
497
558
  path: S.optional(S.String),
498
559
  size_gb: S.optional(S.Number),
@@ -528,7 +589,9 @@ export const FlyMachineRootfs = /*@__PURE__*/ S.suspend(() => S.Struct({
528
589
  })).annotate({
529
590
  identifier: "FlyMachineRootfs",
530
591
  });
531
- export const FlyMachineServiceAutostop = S.String;
592
+ export const FlyMachineServiceAutostopMode = S.String;
593
+ export const FlyMachineServiceAutostop =
594
+ /*@__PURE__*/ S.Union([FlyMachineServiceAutostopMode, S.Boolean]);
532
595
  export const FlyMachineServiceCheckHeadersList = /*@__PURE__*/ S.Array(FlyMachineHTTPHeader);
533
596
  export const FlyMachineServiceCheck = /*@__PURE__*/ S.suspend(() => S.Struct({
534
597
  grace_period: S.optional(S.String),
@@ -684,6 +747,7 @@ export const MachineEvent = /*@__PURE__*/ S.suspend(() => S.Struct({
684
747
  type: S.optional(S.String),
685
748
  })).annotate({ identifier: "MachineEvent" });
686
749
  export const MachineEventsList = /*@__PURE__*/ S.Array(MachineEvent);
750
+ export const MachineHostFeaturesList = /*@__PURE__*/ S.Array(S.String);
687
751
  export const MachineHostStatus = S.String;
688
752
  export const ImageRefLabelsMap = /*@__PURE__*/ S.Record(S.String, S.String);
689
753
  export const ImageRef = /*@__PURE__*/ S.suspend(() => S.Struct({
@@ -704,6 +768,7 @@ export const Machine = /*@__PURE__*/ S.suspend(() => S.Struct({
704
768
  cordoned: S.optional(S.Boolean),
705
769
  created_at: S.optional(S.String),
706
770
  events: S.optional(MachineEventsList),
771
+ host_features: S.optional(MachineHostFeaturesList),
707
772
  host_status: S.optional(MachineHostStatus),
708
773
  id: S.optional(S.String),
709
774
  image_ref: S.optional(ImageRef),
@@ -716,12 +781,14 @@ export const Machine = /*@__PURE__*/ S.suspend(() => S.Struct({
716
781
  region: S.optional(S.String),
717
782
  state: S.optional(S.String),
718
783
  updated_at: S.optional(S.String),
784
+ version: S.optional(S.String),
719
785
  })).annotate({ identifier: "Machine" });
720
786
  export const CreateMachineLeaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
721
787
  app_name: S.String.pipe(T.Label()),
722
788
  machine_id: S.String.pipe(T.Label()),
723
789
  description: S.optional(S.String),
724
- 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"))),
725
792
  }).pipe(T.Http({
726
793
  method: "POST",
727
794
  uri: "/v1/apps/{app_name}/machines/{machine_id}/lease",
@@ -736,6 +803,10 @@ export const Lease = /*@__PURE__*/ S.suspend(() => S.Struct({
736
803
  owner: S.optional(S.String),
737
804
  version: S.optional(S.String),
738
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" });
739
810
  export const CreatePostgresRequestPgMajorVersion = S.String;
740
811
  export const CreatePostgresRequestPlan = S.String;
741
812
  export const CreatePostgresRequestPoolMode = S.String;
@@ -801,6 +872,8 @@ export const PostgresCluster = /*@__PURE__*/ S.suspend(() => S.Struct({
801
872
  region: S.optional(S.String),
802
873
  replicas: S.optional(S.Number),
803
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)),
804
877
  })).annotate({
805
878
  identifier: "PostgresCluster",
806
879
  });
@@ -927,7 +1000,9 @@ export const CreateVolumeRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
927
1000
  }).pipe(T.Http({ method: "POST", uri: "/v1/apps/{app_name}/volumes", code: 200 }))).annotate({
928
1001
  identifier: "CreateVolumeRequest",
929
1002
  });
1003
+ export const VolumeHostFeaturesList = /*@__PURE__*/ S.Array(S.String);
930
1004
  export const VolumeHostStatus = S.String;
1005
+ export const VolumeRequiredHostFeaturesList = /*@__PURE__*/ S.Array(S.String);
931
1006
  export const VolumeType = S.String;
932
1007
  export const Volume = /*@__PURE__*/ S.suspend(() => S.Struct({
933
1008
  attached_alloc_id: S.optional(S.String),
@@ -942,10 +1017,12 @@ export const Volume = /*@__PURE__*/ S.suspend(() => S.Struct({
942
1017
  created_at: S.optional(S.String),
943
1018
  encrypted: S.optional(S.Boolean),
944
1019
  fstype: S.optional(S.String),
1020
+ host_features: S.optional(VolumeHostFeaturesList),
945
1021
  host_status: S.optional(VolumeHostStatus),
946
1022
  id: S.optional(S.String),
947
1023
  name: S.optional(S.String),
948
1024
  region: S.optional(S.String),
1025
+ required_host_features: S.optional(VolumeRequiredHostFeaturesList),
949
1026
  size_gb: S.optional(S.Number),
950
1027
  snapshot_retention: S.optional(S.Number),
951
1028
  state: S.optional(S.String),
@@ -1060,6 +1137,7 @@ export const DeleteMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1060
1137
  app_name: S.String.pipe(T.Label()),
1061
1138
  machine_id: S.String.pipe(T.Label()),
1062
1139
  force: S.optional(S.Boolean.pipe(T.Query())),
1140
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
1063
1141
  }).pipe(T.Http({
1064
1142
  method: "DELETE",
1065
1143
  uri: "/v1/apps/{app_name}/machines/{machine_id}",
@@ -1352,6 +1430,7 @@ export const CurrentTokenResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
1352
1430
  export const GetMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1353
1431
  app_name: S.String.pipe(T.Label()),
1354
1432
  machine_id: S.String.pipe(T.Label()),
1433
+ version: S.optional(S.String.pipe(T.Query())),
1355
1434
  include_leases: S.optional(S.Boolean.pipe(T.Query())),
1356
1435
  }).pipe(T.Http({
1357
1436
  method: "GET",
@@ -1568,6 +1647,7 @@ export const IPAssignment = /*@__PURE__*/ S.suspend(() => S.Struct({
1568
1647
  created_at: S.optional(S.String),
1569
1648
  egress: S.optional(S.Boolean),
1570
1649
  ip: S.optional(S.String),
1650
+ network: S.optional(S.NullOr(IPAssignmentNetwork)),
1571
1651
  region: S.optional(S.String),
1572
1652
  service_name: S.optional(S.String),
1573
1653
  shared: S.optional(S.Boolean),
@@ -1646,6 +1726,8 @@ export const ListMachinesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1646
1726
  state: S.optional(S.String.pipe(T.Query())),
1647
1727
  summary: S.optional(S.Boolean.pipe(T.Query())),
1648
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())),
1649
1731
  }).pipe(T.Http({ method: "GET", uri: "/v1/apps/{app_name}/machines", code: 200 }))).annotate({
1650
1732
  identifier: "ListMachinesRequest",
1651
1733
  });
@@ -1790,16 +1872,16 @@ export const ListPostgresExtensionsRequest = /*@__PURE__*/ S.suspend(() => S.Str
1790
1872
  }))).annotate({
1791
1873
  identifier: "ListPostgresExtensionsRequest",
1792
1874
  });
1793
- export const PostgresInstalledExtension = /*@__PURE__*/ S.suspend(() => S.Struct({
1875
+ export const PostgresExtensionInstalled = /*@__PURE__*/ S.suspend(() => S.Struct({
1794
1876
  schema: S.optional(S.String),
1795
1877
  version: S.optional(S.String),
1796
1878
  })).annotate({
1797
- identifier: "PostgresInstalledExtension",
1879
+ identifier: "PostgresExtensionInstalled",
1798
1880
  });
1799
1881
  export const PostgresExtension = /*@__PURE__*/ S.suspend(() => S.Struct({
1800
1882
  default_version: S.optional(S.String),
1801
1883
  description: S.optional(S.String),
1802
- installed: S.optional(PostgresInstalledExtension),
1884
+ installed: S.optional(S.NullOr(PostgresExtensionInstalled)),
1803
1885
  name: S.optional(S.String),
1804
1886
  system: S.optional(S.Boolean),
1805
1887
  })).annotate({
@@ -1893,7 +1975,9 @@ export const ListVolumesOrgRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1893
1975
  }).pipe(T.Http({ method: "GET", uri: "/v1/orgs/{org_slug}/volumes", code: 200 }))).annotate({
1894
1976
  identifier: "ListVolumesOrgRequest",
1895
1977
  });
1978
+ export const OrgVolumeHostFeaturesList = /*@__PURE__*/ S.Array(S.String);
1896
1979
  export const OrgVolumeHostStatus = S.String;
1980
+ export const OrgVolumeRequiredHostFeaturesList = /*@__PURE__*/ S.Array(S.String);
1897
1981
  export const OrgVolumeType = S.String;
1898
1982
  export const OrgVolume = /*@__PURE__*/ S.suspend(() => S.Struct({
1899
1983
  app_name: S.optional(S.String),
@@ -1909,10 +1993,12 @@ export const OrgVolume = /*@__PURE__*/ S.suspend(() => S.Struct({
1909
1993
  created_at: S.optional(S.String),
1910
1994
  encrypted: S.optional(S.Boolean),
1911
1995
  fstype: S.optional(S.String),
1996
+ host_features: S.optional(OrgVolumeHostFeaturesList),
1912
1997
  host_status: S.optional(OrgVolumeHostStatus),
1913
1998
  id: S.optional(S.String),
1914
1999
  name: S.optional(S.String),
1915
2000
  region: S.optional(S.String),
2001
+ required_host_features: S.optional(OrgVolumeRequiredHostFeaturesList),
1916
2002
  size_gb: S.optional(S.Number),
1917
2003
  snapshot_retention: S.optional(S.Number),
1918
2004
  state: S.optional(S.String),
@@ -1932,6 +2018,7 @@ export const OrgVolumesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
1932
2018
  export const MachinesReleaseLeaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1933
2019
  app_name: S.String.pipe(T.Label()),
1934
2020
  machine_id: S.String.pipe(T.Label()),
2021
+ lease_nonce: S.String.pipe(T.Header("fly-machine-lease-nonce")),
1935
2022
  }).pipe(T.Http({
1936
2023
  method: "DELETE",
1937
2024
  uri: "/v1/apps/{app_name}/machines/{machine_id}/lease",
@@ -1959,6 +2046,65 @@ export const PatchMachineMetadataRequest = /*@__PURE__*/ S.suspend(() => S.Struc
1959
2046
  export const PatchMachineMetadataResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
1960
2047
  identifier: "PatchMachineMetadataResponse",
1961
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
+ });
1962
2108
  export const PostgresUsersCredentialsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
1963
2109
  postgres_cluster_id: S.String.pipe(T.Label()),
1964
2110
  username: S.String.pipe(T.Label()),
@@ -2017,6 +2163,7 @@ export const RestartMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2017
2163
  machine_id: S.String.pipe(T.Label()),
2018
2164
  timeout: S.optional(S.String.pipe(T.Query())),
2019
2165
  signal: S.optional(RestartMachineRequestSignal.pipe(T.Query())),
2166
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
2020
2167
  }).pipe(T.Http({
2021
2168
  method: "POST",
2022
2169
  uri: "/v1/apps/{app_name}/machines/{machine_id}/restart",
@@ -2114,6 +2261,7 @@ export const SignSecretkeyResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
2114
2261
  export const StartMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2115
2262
  app_name: S.String.pipe(T.Label()),
2116
2263
  machine_id: S.String.pipe(T.Label()),
2264
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
2117
2265
  }).pipe(T.Http({
2118
2266
  method: "POST",
2119
2267
  uri: "/v1/apps/{app_name}/machines/{machine_id}/start",
@@ -2130,6 +2278,7 @@ export const StopMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2130
2278
  machine_id: S.String.pipe(T.Label()),
2131
2279
  signal: S.optional(StopMachineRequestSignal),
2132
2280
  timeout: S.optional(S.String),
2281
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
2133
2282
  }).pipe(T.Http({
2134
2283
  method: "POST",
2135
2284
  uri: "/v1/apps/{app_name}/machines/{machine_id}/stop",
@@ -2143,6 +2292,7 @@ export const StopMachineResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).a
2143
2292
  export const SuspendMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2144
2293
  app_name: S.String.pipe(T.Label()),
2145
2294
  machine_id: S.String.pipe(T.Label()),
2295
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
2146
2296
  }).pipe(T.Http({
2147
2297
  method: "POST",
2148
2298
  uri: "/v1/apps/{app_name}/machines/{machine_id}/suspend",
@@ -2156,6 +2306,7 @@ export const SuspendMachineResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})
2156
2306
  export const UncordonMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2157
2307
  app_name: S.String.pipe(T.Label()),
2158
2308
  machine_id: S.String.pipe(T.Label()),
2309
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
2159
2310
  }).pipe(T.Http({
2160
2311
  method: "POST",
2161
2312
  uri: "/v1/apps/{app_name}/machines/{machine_id}/uncordon",
@@ -2178,6 +2329,7 @@ export const UpdateMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2178
2329
  skip_launch: S.optional(S.Boolean),
2179
2330
  skip_secrets: S.optional(S.Boolean),
2180
2331
  skip_service_registration: S.optional(S.Boolean),
2332
+ lease_nonce: S.optional(S.String.pipe(T.Header("fly-machine-lease-nonce"))),
2181
2333
  }).pipe(T.Http({
2182
2334
  method: "POST",
2183
2335
  uri: "/v1/apps/{app_name}/machines/{machine_id}",
@@ -2185,23 +2337,6 @@ export const UpdateMachineRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2185
2337
  }))).annotate({
2186
2338
  identifier: "UpdateMachineRequest",
2187
2339
  });
2188
- export const UpdateMachineMetadataRequestMetadataMap = /*@__PURE__*/ S.Record(S.String, S.String);
2189
- export const UpdateMachineMetadataRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2190
- app_name: S.String.pipe(T.Label()),
2191
- machine_id: S.String.pipe(T.Label()),
2192
- machine_version: S.optional(S.String),
2193
- metadata: S.optional(UpdateMachineMetadataRequestMetadataMap),
2194
- updated_at: S.optional(S.String),
2195
- }).pipe(T.Http({
2196
- method: "PUT",
2197
- uri: "/v1/apps/{app_name}/machines/{machine_id}/metadata",
2198
- code: 200,
2199
- }))).annotate({
2200
- identifier: "UpdateMachineMetadataRequest",
2201
- });
2202
- export const UpdateMachineMetadataResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
2203
- identifier: "UpdateMachineMetadataResponse",
2204
- });
2205
2340
  export const UpdatePostgresUserRoleRequestRole = S.String;
2206
2341
  export const UpdatePostgresUserRoleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
2207
2342
  postgres_cluster_id: S.String.pipe(T.Label()),
@@ -2328,7 +2463,7 @@ export const checkAppCertificate = /*@__PURE__*/ API.make(() => ({
2328
2463
  export const cordonMachine = /*@__PURE__*/ API.make(() => ({
2329
2464
  input: CordonMachineRequest,
2330
2465
  output: CordonMachineResponse,
2331
- errors: [BadRequest, Forbidden, NotFound],
2466
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
2332
2467
  protocol: FlyIoProtocol,
2333
2468
  retry: Retry.Retry,
2334
2469
  }));
@@ -2368,7 +2503,7 @@ export const createAppDeployToken = /*@__PURE__*/ API.make(() => ({
2368
2503
  export const createAppIPAssignment = /*@__PURE__*/ API.make(() => ({
2369
2504
  input: CreateAppIPAssignmentRequest,
2370
2505
  output: AssignIPResponse,
2371
- errors: [BadRequest, Forbidden, NotFound, Conflict],
2506
+ errors: [BadRequest, Forbidden, NotFound, Conflict, NetworkNotFound],
2372
2507
  protocol: FlyIoProtocol,
2373
2508
  retry: Retry.Retry,
2374
2509
  }));
@@ -2383,12 +2518,12 @@ export const createMachine = /*@__PURE__*/ API.make(() => ({
2383
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. */
2384
2519
  export const createMachineLease = /*@__PURE__*/ API.make(() => ({
2385
2520
  input: CreateMachineLeaseRequest,
2386
- output: Lease,
2387
- errors: [BadRequest, Forbidden, NotFound],
2521
+ output: MachineLease,
2522
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
2388
2523
  protocol: FlyIoProtocol,
2389
2524
  retry: Retry.Retry,
2390
2525
  }));
2391
- /** 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. */
2392
2527
  export const createPostgres = /*@__PURE__*/ API.make(() => ({
2393
2528
  input: CreatePostgresRequest,
2394
2529
  output: ShowPostgresClusterResponse,
@@ -2396,7 +2531,7 @@ export const createPostgres = /*@__PURE__*/ API.make(() => ({
2396
2531
  protocol: FlyIoProtocol,
2397
2532
  retry: Retry.Retry,
2398
2533
  }));
2399
- /** 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. */
2400
2535
  export const createPostgresAttachment = /*@__PURE__*/ API.make(() => ({
2401
2536
  input: CreatePostgresAttachmentRequest,
2402
2537
  output: CreatePostgresAttachmentResponse,
@@ -2568,7 +2703,7 @@ export const deleteSecretKey = /*@__PURE__*/ API.make(() => ({
2568
2703
  export const deleteVolume = /*@__PURE__*/ API.make(() => ({
2569
2704
  input: DeleteVolumeRequest,
2570
2705
  output: Volume,
2571
- errors: [Forbidden, NotFound, Conflict],
2706
+ errors: [Forbidden, NotFound, Conflict, VolumeAttached],
2572
2707
  protocol: FlyIoProtocol,
2573
2708
  retry: Retry.Retry,
2574
2709
  }));
@@ -2600,7 +2735,7 @@ export const encryptSecretKey = /*@__PURE__*/ API.make(() => ({
2600
2735
  export const execMachine = /*@__PURE__*/ API.make(() => ({
2601
2736
  input: ExecMachineRequest,
2602
2737
  output: Flydv1ExecResponse,
2603
- errors: [BadRequest, Forbidden, NotFound],
2738
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
2604
2739
  protocol: FlyIoProtocol,
2605
2740
  retry: Retry.Retry,
2606
2741
  }));
@@ -2663,7 +2798,7 @@ export const getMachine = /*@__PURE__*/ API.make(() => ({
2663
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. */
2664
2799
  export const getMachineLease = /*@__PURE__*/ API.make(() => ({
2665
2800
  input: GetMachineLeaseRequest,
2666
- output: Lease,
2801
+ output: MachineLease,
2667
2802
  errors: [Forbidden, NotFound],
2668
2803
  protocol: FlyIoProtocol,
2669
2804
  retry: Retry.Retry,
@@ -2808,7 +2943,7 @@ export const listMachineVersions = /*@__PURE__*/ API.make(() => ({
2808
2943
  export const listPostgres = /*@__PURE__*/ API.make(() => ({
2809
2944
  input: ListPostgresRequest,
2810
2945
  output: ListPostgresClustersResponse,
2811
- errors: [NotFound, UnprocessableEntity],
2946
+ errors: [BadRequest, NotFound, UnprocessableEntity],
2812
2947
  protocol: FlyIoProtocol,
2813
2948
  retry: Retry.Retry,
2814
2949
  }));
@@ -2892,11 +3027,27 @@ export const machinesReleaseLease = /*@__PURE__*/ API.make(() => ({
2892
3027
  protocol: FlyIoProtocol,
2893
3028
  retry: Retry.Retry,
2894
3029
  }));
2895
- /** 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. */
2896
3031
  export const patchMachineMetadata = /*@__PURE__*/ API.make(() => ({
2897
3032
  input: PatchMachineMetadataRequest,
2898
3033
  output: PatchMachineMetadataResponse,
2899
- 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],
2900
3051
  protocol: FlyIoProtocol,
2901
3052
  retry: Retry.Retry,
2902
3053
  }));
@@ -2936,7 +3087,7 @@ export const requestOidcToken = /*@__PURE__*/ API.make(() => ({
2936
3087
  export const restartMachine = /*@__PURE__*/ API.make(() => ({
2937
3088
  input: RestartMachineRequest,
2938
3089
  output: RestartMachineResponse,
2939
- errors: [BadRequest, Forbidden, NotFound],
3090
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
2940
3091
  protocol: FlyIoProtocol,
2941
3092
  retry: Retry.Retry,
2942
3093
  }));
@@ -2992,7 +3143,14 @@ export const signSecretKey = /*@__PURE__*/ API.make(() => ({
2992
3143
  export const startMachine = /*@__PURE__*/ API.make(() => ({
2993
3144
  input: StartMachineRequest,
2994
3145
  output: StartMachineResponse,
2995
- errors: [BadRequest, Forbidden, NotFound, Conflict],
3146
+ errors: [
3147
+ BadRequest,
3148
+ Forbidden,
3149
+ NotFound,
3150
+ Conflict,
3151
+ MachineStartFromCreatedState,
3152
+ MachineReplacing,
3153
+ ],
2996
3154
  protocol: FlyIoProtocol,
2997
3155
  retry: Retry.Retry,
2998
3156
  }));
@@ -3000,7 +3158,7 @@ export const startMachine = /*@__PURE__*/ API.make(() => ({
3000
3158
  export const stopMachine = /*@__PURE__*/ API.make(() => ({
3001
3159
  input: StopMachineRequest,
3002
3160
  output: StopMachineResponse,
3003
- errors: [BadRequest, Forbidden, NotFound],
3161
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
3004
3162
  protocol: FlyIoProtocol,
3005
3163
  retry: Retry.Retry,
3006
3164
  }));
@@ -3008,7 +3166,7 @@ export const stopMachine = /*@__PURE__*/ API.make(() => ({
3008
3166
  export const suspendMachine = /*@__PURE__*/ API.make(() => ({
3009
3167
  input: SuspendMachineRequest,
3010
3168
  output: SuspendMachineResponse,
3011
- errors: [BadRequest, Forbidden, NotFound],
3169
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
3012
3170
  protocol: FlyIoProtocol,
3013
3171
  retry: Retry.Retry,
3014
3172
  }));
@@ -3016,7 +3174,7 @@ export const suspendMachine = /*@__PURE__*/ API.make(() => ({
3016
3174
  export const uncordonMachine = /*@__PURE__*/ API.make(() => ({
3017
3175
  input: UncordonMachineRequest,
3018
3176
  output: UncordonMachineResponse,
3019
- errors: [BadRequest, Forbidden, NotFound],
3177
+ errors: [BadRequest, Forbidden, NotFound, Conflict],
3020
3178
  protocol: FlyIoProtocol,
3021
3179
  retry: Retry.Retry,
3022
3180
  }));
@@ -3028,14 +3186,6 @@ export const updateMachine = /*@__PURE__*/ API.make(() => ({
3028
3186
  protocol: FlyIoProtocol,
3029
3187
  retry: Retry.Retry,
3030
3188
  }));
3031
- /** 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. */
3032
- export const updateMachineMetadata = /*@__PURE__*/ API.make(() => ({
3033
- input: UpdateMachineMetadataRequest,
3034
- output: UpdateMachineMetadataResponse,
3035
- errors: [BadRequest, Forbidden, NotFound],
3036
- protocol: FlyIoProtocol,
3037
- retry: Retry.Retry,
3038
- }));
3039
3189
  /** Update User Role Update a specific Postgres user's role within a cluster. */
3040
3190
  export const updatePostgresUserRole = /*@__PURE__*/ API.make(() => ({
3041
3191
  input: UpdatePostgresUserRoleRequest,
@@ -3080,7 +3230,7 @@ export const verifySecretKey = /*@__PURE__*/ API.make(() => ({
3080
3230
  export const waitMachine = /*@__PURE__*/ API.make(() => ({
3081
3231
  input: WaitMachineRequest,
3082
3232
  output: WaitMachineResponse,
3083
- errors: [BadRequest, Forbidden, NotFound, GatewayTimeout],
3233
+ errors: [BadRequest, Forbidden, NotFound, GatewayTimeout, MachineWaitTimeout],
3084
3234
  protocol: FlyIoProtocol,
3085
3235
  retry: Retry.Retry,
3086
3236
  }));