@krovacloud/sdk 0.4.11 → 0.4.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.
package/CHANGELOG.md CHANGED
@@ -7,8 +7,19 @@ All notable changes to `@krovacloud/sdk` are documented here. This project adher
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ### Added
11
+
12
+ - `proxyProtocol` (`"v1"`, `"v2"` or `null`) on `domains.create()` and
13
+ `domains.update()`, and on every returned `Domain`, which now also carries
14
+ `originScheme`. `confirmMixedProxyProtocol: true` saves a setting that differs
15
+ from other domains on the same Cube port; without it that save is a `409`
16
+ naming them. Types regenerated from the API's spec.
17
+
10
18
  ### Changed
11
19
 
20
+ - The README no longer says HTTPS to the Cube is verified before it applies: the
21
+ API now applies it as saved.
22
+
12
23
  - **BREAKING** — `KrovaErrorBody` no longer has an open `[key: string]: unknown`
13
24
  index signature; only `error?: string` is part of the public shape. The
14
25
  documented API contract (`components.schemas.Error` in the bundled OpenAPI
@@ -17,6 +28,10 @@ All notable changes to `@krovacloud/sdk` are documented here. This project adher
17
28
  arbitrary record should narrow to `body?.error` (or cast the body to a
18
29
  concrete shape they actually expect).
19
30
 
31
+ ### Documentation
32
+
33
+ - README documents `cubes.setTerminationProtection` (and `TerminationProtectedError`), `terminationProtection` on `cubes.create()` and on `Cube`, the `resizing` state, and `client.webhooks`. It no longer says webhooks need `client.raw`.
34
+
20
35
  ## 0.4.2
21
36
 
22
37
  ### Changed
package/README.md CHANGED
@@ -10,7 +10,7 @@ The official TypeScript SDK for the [Krova Cloud](https://krova.cloud) API — a
10
10
  ## Highlights
11
11
 
12
12
  - **Fully typed** — request bodies, responses, and path params are generated from the Krova Cloud OpenAPI spec via [`openapi-typescript`](https://github.com/openapi-ts/openapi-typescript) + [`openapi-fetch`](https://github.com/openapi-ts/openapi-typescript/tree/main/packages/openapi-fetch).
13
- - **Ergonomic helpers** — `client.cubes.*` and `client.catalog.*` unwrap the response body and throw a typed `KrovaError` on failure.
13
+ - **Ergonomic helpers** — `client.cubes`, `domains`, `snapshots`, `tcpMappings`, `imports`, `backups`, `webhooks` and `catalog` unwrap the response body and throw a typed `KrovaError` on failure.
14
14
  - **Full escape hatch** — `client.raw` exposes the underlying typed client for every operation in the bundled OpenAPI spec (Domains, TCP mappings, Snapshots, Backups, Imports, Webhooks, and more).
15
15
  - **Zero-config resilience** — automatic retries on `429` / `503`, honoring `Retry-After`.
16
16
  - **ESM + CJS** — ships both, with bundled `.d.ts` declarations. No runtime dependencies beyond `openapi-fetch`.
@@ -118,7 +118,8 @@ Ergonomic helpers for the Cube lifecycle. Each unwraps the response body and thr
118
118
  | `list` | `(spaceId: string)` | the Cube list body |
119
119
  | `create` | `(spaceId, body, opts?)` | the created `Cube` |
120
120
  | `get` | `(spaceId, cubeId)` | the Cube body |
121
- | `update` | `(spaceId, cubeId, body)` | updates the Cube's SSH port |
121
+ | `update` | `(spaceId, cubeId, body)` | changes the port sshd listens on inside the Cube |
122
+ | `setTerminationProtection` | `(spaceId, cubeId, enabled)` | the updated `Cube`. While protection is on, `delete` throws `TerminationProtectedError` (a `KrovaError` for the API's `409`) |
122
123
  | `delete` | `(spaceId, cubeId)` | enqueues deletion |
123
124
  | `powerOff` | `(spaceId, cubeId)` | enqueues a power-off |
124
125
  | `wake` | `(spaceId, cubeId)` | enqueues a start |
@@ -137,6 +138,7 @@ const cube = await krova.cubes.create(
137
138
  sshPublicKey: "ssh-ed25519 AAAA... you@host",
138
139
  region: "us", // optional — slug from catalog.regions()
139
140
  userData: "#cloud-config\n", // optional — cloud-init (max 16 KB)
141
+ terminationProtection: true, // optional — refuse deletes until turned off
140
142
  },
141
143
  { idempotencyKey: "deploy-2026-07-01" },
142
144
  );
@@ -145,9 +147,12 @@ const cube = await krova.cubes.create(
145
147
  const one = await krova.cubes.get("space_123", cube.id);
146
148
  const all = await krova.cubes.list("space_123");
147
149
 
148
- // update — the only mutable Cube field over the public API is the SSH port
150
+ // update — the port sshd listens on inside the Cube
149
151
  await krova.cubes.update("space_123", cube.id, { cubePort: 2222 });
150
152
 
153
+ // termination protection — delete is refused until it is turned off
154
+ await krova.cubes.setTerminationProtection("space_123", cube.id, false);
155
+
151
156
  // lifecycle — powerOff, wake, delete are asynchronous (enqueued)
152
157
  await krova.cubes.powerOff("space_123", cube.id);
153
158
  await krova.cubes.wake("space_123", cube.id);
@@ -165,10 +170,11 @@ The `Cube` type is exported for your own signatures:
165
170
  import type { Cube } from "@krovacloud/sdk";
166
171
  // {
167
172
  // id: string; name: string;
168
- // state: "pending" | "booting" | "running" | "stopped" | "stopping" | "error" | "deleted";
173
+ // state: "pending" | "booting" | "running" | "stopped" | "stopping" | "resizing" | "error" | "deleted";
169
174
  // publicIpv4: string | null;
170
175
  // resources: { vcpu: number; ramGb: number; diskGb: number };
171
176
  // image: string; costPerHour: number;
177
+ // terminationProtection: boolean;
172
178
  // createdAt: string; updatedAt: string;
173
179
  // }
174
180
  ```
@@ -261,18 +267,35 @@ const status = await krova.imports.get("space_123", start.importId);
261
267
  const dl = await krova.backups.download("space_123", "backup_123");
262
268
  ```
263
269
 
270
+ ### Webhooks
271
+
272
+ `client.webhooks` manages a space's webhook endpoints. `create` is the only call that returns the signing secret, so store it straight away. To verify deliveries, use [`@krovacloud/webhook`](https://www.npmjs.com/package/@krovacloud/webhook).
273
+
274
+ ```ts
275
+ const endpoint = await krova.webhooks.create("space_123", {
276
+ url: "https://example.com/hook",
277
+ events: ["cube.running", "cube.stopped"],
278
+ description: "deploy notifier", // optional
279
+ });
280
+ // endpoint.secret is returned only here: store it now
281
+
282
+ await krova.webhooks.list("space_123");
283
+ await krova.webhooks.get("space_123", endpoint.id);
284
+ await krova.webhooks.deliveries("space_123", endpoint.id, { limit: 20 }); // last 30 days
285
+ await krova.webhooks.delete("space_123", endpoint.id);
286
+ ```
287
+
264
288
  ### `client.raw` — every endpoint
265
289
 
266
- The helpers cover Cubes, the catalog, domains, snapshots, TCP mappings, imports, and backups. For anything else — e.g. Webhooks — use `client.raw`, the fully typed [`openapi-fetch`](https://github.com/openapi-ts/openapi-typescript/tree/main/packages/openapi-fetch) client. It returns `{ data, error, response }` and **never throws**:
290
+ The helpers cover Cubes, the catalog, domains, snapshots, TCP mappings, imports, backups, and webhooks. When you would rather handle the error yourself than catch an exception, use `client.raw`, the fully typed [`openapi-fetch`](https://github.com/openapi-ts/openapi-typescript/tree/main/packages/openapi-fetch) client. It returns `{ data, error, response }` and **never throws**:
267
291
 
268
292
  ```ts
269
- const { data, error } = await krova.raw.POST("/spaces/{spaceId}/webhooks", {
270
- params: { path: { spaceId: "space_123" } },
271
- body: { url: "https://example.com/hook", events: ["cube.running"] },
293
+ const { data, error } = await krova.raw.GET("/spaces/{spaceId}/cubes/{cubeId}", {
294
+ params: { path: { spaceId: "space_123", cubeId: "cube_123" } },
272
295
  });
273
296
 
274
297
  if (error) {
275
- console.error("Webhook create failed:", error.error);
298
+ console.error("Cube lookup failed:", error.error);
276
299
  } else {
277
300
  console.log(data);
278
301
  }
@@ -287,7 +310,7 @@ type Domain = components["schemas"]["Domain"];
287
310
 
288
311
  ### `KrovaError`
289
312
 
290
- Thrown by the `cubes.*` / `catalog.*` helpers on any non-2xx response. (`client.raw` never throws — it returns the error in `{ error }`.)
313
+ Thrown by every helper on any non-2xx response. (`client.raw` never throws — it returns the error in `{ error }`.)
291
314
 
292
315
  | Field | Type | Source |
293
316
  | --- | --- | --- |
@@ -373,9 +396,28 @@ await krova.domains.update(spaceId, cubeId, mappingId, {
373
396
  ```
374
397
 
375
398
  The dial port is derived: `https` on the default port 80 connects on 443, and a
376
- deliberate custom port is honoured exactly. The setting is verified against the
377
- Cube before it is applied — if the domain does not serve, the route is left on
378
- `http`.
399
+ deliberate custom port is honored exactly. The setting applies as saved, with no
400
+ check: if nothing in the Cube answers HTTPS for the domain, visitors get an
401
+ error page until you set it back to `http`.
402
+
403
+ ## Custom domains: the visitor's address on the connection
404
+
405
+ The edge always passes the visitor's address in the `X-Real-IP` and
406
+ `X-Forwarded-For` headers. For software that reads it from the TCP connection
407
+ instead, set `proxyProtocol` to `"v1"` (a line of text) or `"v2"` (binary): the
408
+ edge then sends a PROXY protocol header naming the visitor at the start of every
409
+ connection to the Cube. `null` turns it off.
410
+
411
+ ```ts
412
+ await krova.domains.update(spaceId, cubeId, mappingId, { proxyProtocol: "v2" });
413
+ ```
414
+
415
+ The app must accept the PROXY protocol on that port before you turn it on, or
416
+ every request to the domain fails. An app accepts it per port, so every domain
417
+ mapped to the same Cube port needs the same setting: a create or update that
418
+ would mix them is rejected with a `409` whose message names the other domains.
419
+ Send `confirmMixedProxyProtocol: true` to save anyway, when the app handles both
420
+ on that port.
379
421
 
380
422
  ## License
381
423
 
package/dist/index.d.cts CHANGED
@@ -918,6 +918,8 @@ interface paths {
918
918
  basicAuthPassword?: string;
919
919
  /** @description HTTP Basic Auth username. Null/empty clears Basic Auth. Setting it requires basicAuthPassword. */
920
920
  basicAuthUser?: string | null;
921
+ /** @description Accept a save that leaves domains on the same cube port with different proxyProtocol settings (for an app that handles both on one port, or mid-migration). Not stored. */
922
+ confirmMixedProxyProtocol?: boolean;
921
923
  /** @description Per-domain CORS policy, applied at the edge. Null (default) = CORS disabled and no Access-Control-* header is emitted anywhere. When set, the proxy answers OPTIONS preflight itself (204, the cube is never involved) and adds the headers to normal AND error responses, so a cross-origin request to a failing or stopped cube is never CORS-masked. */
922
924
  corsConfig?: {
923
925
  /** @description Send Access-Control-Allow-Credentials: true. Rejected together with the "*" origin. */
@@ -942,12 +944,17 @@ interface paths {
942
944
  /** @description Max request body size (MB). Null = unlimited (default). */
943
945
  maxRequestBodyMb?: number | null;
944
946
  /**
945
- * @description Scheme the edge speaks to the CUBE on the backend hop. http (default) = cleartext. https = the cube terminates TLS itself (a control panel holding its own certificate, or an app listening on HTTPS) and answers plain HTTP with a redirect, so it cannot be reached over cleartext at all. Visitors are on HTTPS either way. The dial port is derived: https on the default port 80 connects on 443; a deliberate custom port is honoured exactly. Verified against the cube before it is applied — if the domain does not serve, the route is left on http.
947
+ * @description Scheme the edge speaks to the CUBE on the backend hop. http (default) = cleartext. https = the cube terminates TLS itself (a control panel holding its own certificate, or an app listening on HTTPS) and answers plain HTTP with a redirect, so it cannot be reached over cleartext at all. Visitors are on HTTPS either way. The dial port is derived: https on the default port 80 connects on 443; a deliberate custom port is honored exactly. Applied as saved: if the cube does not serve this hostname over HTTPS, requests to the domain fail until you set it back to http.
946
948
  * @enum {string}
947
949
  */
948
950
  originScheme?: "http" | "https";
949
951
  /** @description Cube port the domain proxies to. */
950
952
  port: number;
953
+ /**
954
+ * @description Send a PROXY protocol header (v1 text or v2 binary) at the start of every connection to the cube, so the app reads the visitor's address from the connection itself, as on a plain VPS. Null (default) = off. The app must accept PROXY protocol on this port, or every request to the domain fails; it is applied as saved. Every domain on the same cube port must use the same setting: a save that would mix them is refused with 409 unless confirmMixedProxyProtocol is true.
955
+ * @enum {string|null}
956
+ */
957
+ proxyProtocol?: "v1" | "v2" | null;
951
958
  /** @description Header rewrites: `set` adds/overwrites, `remove` deletes. Null clears all. */
952
959
  requestHeaderOverrides?: {
953
960
  remove?: string[];
@@ -988,6 +995,13 @@ interface paths {
988
995
  };
989
996
  };
990
997
  400: components["responses"]["BadRequest"];
998
+ /** @description Refused. Among other reasons (the domain is in use, or is being removed): the save would leave domains on the same cube port with different proxyProtocol settings. Then `errorMeta.code` is `proxy_protocol_port_mismatch`, with `errorMeta.port` and `errorMeta.domains` naming the other domains. Change them together, or resend with confirmMixedProxyProtocol: true. */
999
+ 409: {
1000
+ headers: {
1001
+ [name: string]: unknown;
1002
+ };
1003
+ content?: never;
1004
+ };
991
1005
  429: components["responses"]["RateLimited"];
992
1006
  };
993
1007
  };
@@ -1059,6 +1073,8 @@ interface paths {
1059
1073
  basicAuthPassword?: string;
1060
1074
  /** @description HTTP Basic Auth username. Null/empty clears Basic Auth. Setting it requires basicAuthPassword. */
1061
1075
  basicAuthUser?: string | null;
1076
+ /** @description Accept a save that leaves domains on the same cube port with different proxyProtocol settings (for an app that handles both on one port, or mid-migration). Not stored. */
1077
+ confirmMixedProxyProtocol?: boolean;
1062
1078
  /** @description Per-domain CORS policy, applied at the edge. Null (default) = CORS disabled and no Access-Control-* header is emitted anywhere. When set, the proxy answers OPTIONS preflight itself (204, the cube is never involved) and adds the headers to normal AND error responses, so a cross-origin request to a failing or stopped cube is never CORS-masked. */
1063
1079
  corsConfig?: {
1064
1080
  /** @description Send Access-Control-Allow-Credentials: true. Rejected together with the "*" origin. */
@@ -1081,10 +1097,15 @@ interface paths {
1081
1097
  /** @description Max request body size (MB). Null = unlimited (default). */
1082
1098
  maxRequestBodyMb?: number | null;
1083
1099
  /**
1084
- * @description Scheme the edge speaks to the CUBE on the backend hop. http (default) = cleartext. https = the cube terminates TLS itself (a control panel holding its own certificate, or an app listening on HTTPS) and answers plain HTTP with a redirect, so it cannot be reached over cleartext at all. Visitors are on HTTPS either way. The dial port is derived: https on the default port 80 connects on 443; a deliberate custom port is honoured exactly. Verified against the cube before it is applied — if the domain does not serve, the route is left on http.
1100
+ * @description Scheme the edge speaks to the CUBE on the backend hop. http (default) = cleartext. https = the cube terminates TLS itself (a control panel holding its own certificate, or an app listening on HTTPS) and answers plain HTTP with a redirect, so it cannot be reached over cleartext at all. Visitors are on HTTPS either way. The dial port is derived: https on the default port 80 connects on 443; a deliberate custom port is honored exactly. Applied as saved: if the cube does not serve this hostname over HTTPS, requests to the domain fail until you set it back to http.
1085
1101
  * @enum {string}
1086
1102
  */
1087
1103
  originScheme?: "http" | "https";
1104
+ /**
1105
+ * @description Send a PROXY protocol header (v1 text or v2 binary) at the start of every connection to the cube, so the app reads the visitor's address from the connection itself, as on a plain VPS. Null (default) = off. The app must accept PROXY protocol on this port, or every request to the domain fails; it is applied as saved. Every domain on the same cube port must use the same setting: a save that would mix them is refused with 409 unless confirmMixedProxyProtocol is true.
1106
+ * @enum {string|null}
1107
+ */
1108
+ proxyProtocol?: "v1" | "v2" | null;
1088
1109
  /** @description Header rewrites: `set` adds/overwrites, `remove` deletes. Null clears all. */
1089
1110
  requestHeaderOverrides?: {
1090
1111
  remove?: string[];
@@ -1125,6 +1146,13 @@ interface paths {
1125
1146
  };
1126
1147
  400: components["responses"]["BadRequest"];
1127
1148
  404: components["responses"]["NotFound"];
1149
+ /** @description Refused. Among other reasons (the domain is in use, or is being removed): the save would leave domains on the same cube port with different proxyProtocol settings. Then `errorMeta.code` is `proxy_protocol_port_mismatch`, with `errorMeta.port` and `errorMeta.domains` naming the other domains. Change them together, or resend with confirmMixedProxyProtocol: true. */
1150
+ 409: {
1151
+ headers: {
1152
+ [name: string]: unknown;
1153
+ };
1154
+ content?: never;
1155
+ };
1128
1156
  429: components["responses"]["RateLimited"];
1129
1157
  };
1130
1158
  };
@@ -1960,7 +1988,11 @@ interface components {
1960
1988
  ipDenyList: string[] | null;
1961
1989
  isWildcard: boolean;
1962
1990
  maxRequestBodyMb: number | null;
1991
+ /** @enum {string} */
1992
+ originScheme: "http" | "https";
1963
1993
  port: number | null;
1994
+ /** @enum {string|null} */
1995
+ proxyProtocol: "v1" | "v2" | null;
1964
1996
  /** @description Header rewrites: `set` adds/overwrites, `remove` deletes. Null clears all. */
1965
1997
  requestHeaderOverrides: {
1966
1998
  remove?: string[];
package/dist/index.d.ts CHANGED
@@ -918,6 +918,8 @@ interface paths {
918
918
  basicAuthPassword?: string;
919
919
  /** @description HTTP Basic Auth username. Null/empty clears Basic Auth. Setting it requires basicAuthPassword. */
920
920
  basicAuthUser?: string | null;
921
+ /** @description Accept a save that leaves domains on the same cube port with different proxyProtocol settings (for an app that handles both on one port, or mid-migration). Not stored. */
922
+ confirmMixedProxyProtocol?: boolean;
921
923
  /** @description Per-domain CORS policy, applied at the edge. Null (default) = CORS disabled and no Access-Control-* header is emitted anywhere. When set, the proxy answers OPTIONS preflight itself (204, the cube is never involved) and adds the headers to normal AND error responses, so a cross-origin request to a failing or stopped cube is never CORS-masked. */
922
924
  corsConfig?: {
923
925
  /** @description Send Access-Control-Allow-Credentials: true. Rejected together with the "*" origin. */
@@ -942,12 +944,17 @@ interface paths {
942
944
  /** @description Max request body size (MB). Null = unlimited (default). */
943
945
  maxRequestBodyMb?: number | null;
944
946
  /**
945
- * @description Scheme the edge speaks to the CUBE on the backend hop. http (default) = cleartext. https = the cube terminates TLS itself (a control panel holding its own certificate, or an app listening on HTTPS) and answers plain HTTP with a redirect, so it cannot be reached over cleartext at all. Visitors are on HTTPS either way. The dial port is derived: https on the default port 80 connects on 443; a deliberate custom port is honoured exactly. Verified against the cube before it is applied — if the domain does not serve, the route is left on http.
947
+ * @description Scheme the edge speaks to the CUBE on the backend hop. http (default) = cleartext. https = the cube terminates TLS itself (a control panel holding its own certificate, or an app listening on HTTPS) and answers plain HTTP with a redirect, so it cannot be reached over cleartext at all. Visitors are on HTTPS either way. The dial port is derived: https on the default port 80 connects on 443; a deliberate custom port is honored exactly. Applied as saved: if the cube does not serve this hostname over HTTPS, requests to the domain fail until you set it back to http.
946
948
  * @enum {string}
947
949
  */
948
950
  originScheme?: "http" | "https";
949
951
  /** @description Cube port the domain proxies to. */
950
952
  port: number;
953
+ /**
954
+ * @description Send a PROXY protocol header (v1 text or v2 binary) at the start of every connection to the cube, so the app reads the visitor's address from the connection itself, as on a plain VPS. Null (default) = off. The app must accept PROXY protocol on this port, or every request to the domain fails; it is applied as saved. Every domain on the same cube port must use the same setting: a save that would mix them is refused with 409 unless confirmMixedProxyProtocol is true.
955
+ * @enum {string|null}
956
+ */
957
+ proxyProtocol?: "v1" | "v2" | null;
951
958
  /** @description Header rewrites: `set` adds/overwrites, `remove` deletes. Null clears all. */
952
959
  requestHeaderOverrides?: {
953
960
  remove?: string[];
@@ -988,6 +995,13 @@ interface paths {
988
995
  };
989
996
  };
990
997
  400: components["responses"]["BadRequest"];
998
+ /** @description Refused. Among other reasons (the domain is in use, or is being removed): the save would leave domains on the same cube port with different proxyProtocol settings. Then `errorMeta.code` is `proxy_protocol_port_mismatch`, with `errorMeta.port` and `errorMeta.domains` naming the other domains. Change them together, or resend with confirmMixedProxyProtocol: true. */
999
+ 409: {
1000
+ headers: {
1001
+ [name: string]: unknown;
1002
+ };
1003
+ content?: never;
1004
+ };
991
1005
  429: components["responses"]["RateLimited"];
992
1006
  };
993
1007
  };
@@ -1059,6 +1073,8 @@ interface paths {
1059
1073
  basicAuthPassword?: string;
1060
1074
  /** @description HTTP Basic Auth username. Null/empty clears Basic Auth. Setting it requires basicAuthPassword. */
1061
1075
  basicAuthUser?: string | null;
1076
+ /** @description Accept a save that leaves domains on the same cube port with different proxyProtocol settings (for an app that handles both on one port, or mid-migration). Not stored. */
1077
+ confirmMixedProxyProtocol?: boolean;
1062
1078
  /** @description Per-domain CORS policy, applied at the edge. Null (default) = CORS disabled and no Access-Control-* header is emitted anywhere. When set, the proxy answers OPTIONS preflight itself (204, the cube is never involved) and adds the headers to normal AND error responses, so a cross-origin request to a failing or stopped cube is never CORS-masked. */
1063
1079
  corsConfig?: {
1064
1080
  /** @description Send Access-Control-Allow-Credentials: true. Rejected together with the "*" origin. */
@@ -1081,10 +1097,15 @@ interface paths {
1081
1097
  /** @description Max request body size (MB). Null = unlimited (default). */
1082
1098
  maxRequestBodyMb?: number | null;
1083
1099
  /**
1084
- * @description Scheme the edge speaks to the CUBE on the backend hop. http (default) = cleartext. https = the cube terminates TLS itself (a control panel holding its own certificate, or an app listening on HTTPS) and answers plain HTTP with a redirect, so it cannot be reached over cleartext at all. Visitors are on HTTPS either way. The dial port is derived: https on the default port 80 connects on 443; a deliberate custom port is honoured exactly. Verified against the cube before it is applied — if the domain does not serve, the route is left on http.
1100
+ * @description Scheme the edge speaks to the CUBE on the backend hop. http (default) = cleartext. https = the cube terminates TLS itself (a control panel holding its own certificate, or an app listening on HTTPS) and answers plain HTTP with a redirect, so it cannot be reached over cleartext at all. Visitors are on HTTPS either way. The dial port is derived: https on the default port 80 connects on 443; a deliberate custom port is honored exactly. Applied as saved: if the cube does not serve this hostname over HTTPS, requests to the domain fail until you set it back to http.
1085
1101
  * @enum {string}
1086
1102
  */
1087
1103
  originScheme?: "http" | "https";
1104
+ /**
1105
+ * @description Send a PROXY protocol header (v1 text or v2 binary) at the start of every connection to the cube, so the app reads the visitor's address from the connection itself, as on a plain VPS. Null (default) = off. The app must accept PROXY protocol on this port, or every request to the domain fails; it is applied as saved. Every domain on the same cube port must use the same setting: a save that would mix them is refused with 409 unless confirmMixedProxyProtocol is true.
1106
+ * @enum {string|null}
1107
+ */
1108
+ proxyProtocol?: "v1" | "v2" | null;
1088
1109
  /** @description Header rewrites: `set` adds/overwrites, `remove` deletes. Null clears all. */
1089
1110
  requestHeaderOverrides?: {
1090
1111
  remove?: string[];
@@ -1125,6 +1146,13 @@ interface paths {
1125
1146
  };
1126
1147
  400: components["responses"]["BadRequest"];
1127
1148
  404: components["responses"]["NotFound"];
1149
+ /** @description Refused. Among other reasons (the domain is in use, or is being removed): the save would leave domains on the same cube port with different proxyProtocol settings. Then `errorMeta.code` is `proxy_protocol_port_mismatch`, with `errorMeta.port` and `errorMeta.domains` naming the other domains. Change them together, or resend with confirmMixedProxyProtocol: true. */
1150
+ 409: {
1151
+ headers: {
1152
+ [name: string]: unknown;
1153
+ };
1154
+ content?: never;
1155
+ };
1128
1156
  429: components["responses"]["RateLimited"];
1129
1157
  };
1130
1158
  };
@@ -1960,7 +1988,11 @@ interface components {
1960
1988
  ipDenyList: string[] | null;
1961
1989
  isWildcard: boolean;
1962
1990
  maxRequestBodyMb: number | null;
1991
+ /** @enum {string} */
1992
+ originScheme: "http" | "https";
1963
1993
  port: number | null;
1994
+ /** @enum {string|null} */
1995
+ proxyProtocol: "v1" | "v2" | null;
1964
1996
  /** @description Header rewrites: `set` adds/overwrites, `remove` deletes. Null clears all. */
1965
1997
  requestHeaderOverrides: {
1966
1998
  remove?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krovacloud/sdk",
3
- "version": "0.4.11",
3
+ "version": "0.4.13",
4
4
  "description": "Official TypeScript SDK for Krova Cloud — a typed client for provisioning and managing Cubes (Firecracker microVMs) with dedicated resources.",
5
5
  "license": "MIT",
6
6
  "type": "module",