@krovacloud/sdk 0.5.5 → 0.5.7

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,18 +7,56 @@ All notable changes to `@krovacloud/sdk` are documented here. This project adher
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ The sections below are grouped by the release that first shipped each change, taken from the `@krovacloud/sdk@<version>` git tags. Versions up to 0.5.5 are published to npm.
11
+
12
+ ### Changed
13
+
14
+ - `Webhook.description` and the `description` field of the `webhooks.create()` body now come from the generated OpenAPI types, because krova-cloud declares them in its spec. The `Webhook` and `CreateWebhookInput` types keep the same shape, with `description` optional.
15
+
16
+ ### Documentation
17
+
18
+ - README: Node.js 22 or later; `code` and `requestId` on `KrovaError` come from response headers the Krova API does not send today, so they are normally `undefined` (only `TerminationProtectedError` carries a code); `DnsRecord`, `DnsRecordStatus` and the webhook types are reached through `components["schemas"]`, not exported by name; the full `Cube` shape, `imports.cancel`, TCP mapping `label` and `udpEnabled`, the other custom-domain settings, the 600 requests per minute per key limit and the per-plan hourly cap on Cube creates (a `429` with `Retry-After`); `cubes.update` is the SSH port only and RAM is in whole GB. Comment-only changes in the source.
19
+
20
+ ## 0.5.4
21
+
10
22
  ### Added
11
23
 
12
24
  - `baseUrl` on `new KrovaClient()` is optional and now falls back to the `KROVA_BASE_URL` environment variable (where `process.env` exists; browsers and edge runtimes just use the default), then to `https://krova.cloud/api/v1`. An empty or whitespace value counts as unset, trailing slashes are removed, and a bare origin such as `https://krova.cloud` gets `/api/v1` appended; any other path is kept as given. `client.baseUrl` shows the resolved value.
13
25
 
14
- - `cubes.setIdleTimeout(spaceId, cubeId, minutes | null)`, `idleTimeoutMinutes?: number | null` on the `cubes.create()` body, and `idleTimeoutMinutes` and `lastActiveAt` on `Cube`: Krova powers a Cube off after that many minutes without activity (10 to 10080, or `null` for off). These need a server with the idle-timeout feature, which krova-cloud has not deployed yet: `setIdleTimeout` gets a `400` from an older server, `create` is silently ignored there, and both `Cube` fields are absent. The OpenAPI snapshot and generated types include them, and `packages/sdk/openapi-pending.json` lists them so the drift check stays green until the deploy.
26
+ ### Changed
15
27
 
16
- - `cubes.rename(spaceId, cubeId, name)` and `cubes.resize(spaceId, cubeId, { vcpu?, ramGb?, diskGb? }, opts?)`, with the exported types `ResizeCubeInput` and `ResizeCubeResult`. `resize` resolves to `{ success, state: "queued", jobId, isLive, requiresRestart, previous, requested }`; the Cube keeps its size until the worker applies the change. `getSpace()` now returns `apiKey: { name, expiresAt } | null` (`expiresAt` is `null` for a key that never expires; `apiKey` is `null` for an OAuth token and absent on an older server). The OpenAPI snapshot and generated types include these API changes, which krova-cloud has not deployed yet: until it does, `packages/sdk/openapi-pending.json` lists them so the drift check stays green.
28
+ - `Cube.idleTimeoutMinutes` and `Cube.lastActiveAt` are now always present (`number | null` and `string | null`), because krova-cloud has deployed the idle-timeout feature. The OpenAPI snapshot and generated types match the live API again.
29
+
30
+ ## 0.5.2
31
+
32
+ ### Added
33
+
34
+ - `cubes.setIdleTimeout(spaceId, cubeId, minutes | null)`, `idleTimeoutMinutes?: number | null` on the `cubes.create()` body, and `idleTimeoutMinutes` and `lastActiveAt` on `Cube`: Krova powers a Cube off after that many minutes without activity (10 to 10080, or `null` for off). The OpenAPI snapshot and generated types include them. krova-cloud has since deployed the feature, so the live API serves them.
35
+
36
+ - `cubes.rename(spaceId, cubeId, name)` and `cubes.resize(spaceId, cubeId, { vcpu?, ramGb?, diskGb? }, opts?)`, with the exported types `ResizeCubeInput` and `ResizeCubeResult`. `resize` resolves to `{ success, state: "queued", jobId, isLive, requiresRestart, previous, requested }`; the Cube keeps its size until the worker applies the change. `getSpace()` now returns `apiKey: { name, expiresAt } | null` (`expiresAt` is `null` for a key that never expires; `apiKey` is `null` for an OAuth token and absent on an older server). The OpenAPI snapshot and generated types include these API changes, and the live API serves them.
37
+
38
+ ## 0.5.1
39
+
40
+ ### Added
17
41
 
18
42
  - `@krovacloud/sdk/ssh`, a Node-only entry for running commands and moving files on a Cube over its own SSH with a private key you supply: `connectCube(krova, spaceId, cubeId, { privateKey, passphrase?, readyTimeoutMs?, hostKeys? })` returns a shell with `run()`, `files.write/read/upload/download` and `close()`. The host key is checked against the keys from `cubes.ssh()` and a mismatch throws `HostKeyMismatchError`; there is no way to skip the check. Also exports `shellQuote`, `RunTimeoutError` and `SshError`. Adds the `ssh2` dependency; the main entry does not load it.
19
43
 
44
+ ## 0.4.14
45
+
46
+ ### Added
47
+
20
48
  - Backups and sharing them between spaces: `backups.list()`, `backups.get()` and `backups.share()` (with an optional `idempotencyKey`), and a new `backupShares` group with `list()`, `accept()`, `decline()` and `cancel()`. New exported types `Backup`, `BackupShare`, `BackupShareList` and `AcceptedBackupShare`. These endpoints read the Backups permissions (`backup.view`, `backup.manage`), not the Cube ones. The OpenAPI snapshot is refreshed from the live API and the types regenerated.
21
49
 
50
+ ## 0.4.13
51
+
52
+ ### Documentation
53
+
54
+ - 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`.
55
+
56
+ ## 0.4.12
57
+
58
+ ### Added
59
+
22
60
  - `proxyProtocol` (`"v1"`, `"v2"` or `null`) on `domains.create()` and
23
61
  `domains.update()`, and on every returned `Domain`, which now also carries
24
62
  `originScheme`. `confirmMixedProxyProtocol: true` saves a setting that differs
@@ -27,11 +65,13 @@ All notable changes to `@krovacloud/sdk` are documented here. This project adher
27
65
 
28
66
  ### Changed
29
67
 
30
- - `Cube.idleTimeoutMinutes` and `Cube.lastActiveAt` are now always present (`number | null` and `string | null`), because krova-cloud has deployed the idle-timeout feature. The OpenAPI snapshot and generated types match the live API again.
31
-
32
68
  - The README no longer says HTTPS to the Cube is verified before it applies: the
33
69
  API now applies it as saved.
34
70
 
71
+ ## 0.4.3
72
+
73
+ ### Changed
74
+
35
75
  - **BREAKING** — `KrovaErrorBody` no longer has an open `[key: string]: unknown`
36
76
  index signature; only `error?: string` is part of the public shape. The
37
77
  documented API contract (`components.schemas.Error` in the bundled OpenAPI
@@ -40,10 +80,6 @@ All notable changes to `@krovacloud/sdk` are documented here. This project adher
40
80
  arbitrary record should narrow to `body?.error` (or cast the body to a
41
81
  concrete shape they actually expect).
42
82
 
43
- ### Documentation
44
-
45
- - 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`.
46
-
47
83
  ## 0.4.2
48
84
 
49
85
  ### Changed
package/README.md CHANGED
@@ -23,7 +23,7 @@ npm i @krovacloud/sdk
23
23
  # or: yarn add @krovacloud/sdk
24
24
  ```
25
25
 
26
- Requires **Node.js ≥ 18** (uses the global `fetch`).
26
+ Requires **Node.js ≥ 22** (uses the global `fetch`).
27
27
 
28
28
  ## Quickstart
29
29
 
@@ -98,7 +98,7 @@ new KrovaClient({
98
98
  });
99
99
  ```
100
100
 
101
- Throws if `apiKey` is missing. Exposes `client.baseUrl` (the resolved base URL), `client.getSpace()`, and the resource helpers `client.cubes`, `client.domains`, `client.snapshots`, `client.tcpMappings`, `client.imports`, `client.backups`, `client.catalog` (each documented in its section below), plus the raw typed client `client.raw`.
101
+ Throws if `apiKey` is missing. Exposes `client.baseUrl` (the resolved base URL), `client.getSpace()`, and the resource helpers `client.cubes`, `client.domains`, `client.snapshots`, `client.tcpMappings`, `client.imports`, `client.backups`, `client.backupShares`, `client.webhooks`, `client.catalog` (each documented in its section below), plus the raw typed client `client.raw`.
102
102
 
103
103
  ### `client.getSpace()`
104
104
 
@@ -122,10 +122,10 @@ Ergonomic helpers for the Cube lifecycle. Each unwraps the response body and thr
122
122
  | `list` | `(spaceId: string)` | the Cube list body |
123
123
  | `create` | `(spaceId, body, opts?)` | the created `Cube` |
124
124
  | `get` | `(spaceId, cubeId)` | the Cube body |
125
- | `update` | `(spaceId, cubeId, body)` | changes the port sshd listens on inside the Cube |
125
+ | `update` | `(spaceId, cubeId, body)` | the API's response body. Changes the port sshd listens on inside the Cube (`body` is `{ cubePort }`) |
126
126
  | `setTerminationProtection` | `(spaceId, cubeId, enabled)` | the updated `Cube`. While protection is on, `delete` throws `TerminationProtectedError` (a `KrovaError` for the API's `409`) |
127
127
  | `rename` | `(spaceId, cubeId, name)` | the updated `Cube`. The name is trimmed, 1 to 64 printable characters, and does not have to be unique |
128
- | `setIdleTimeout` | `(spaceId, cubeId, minutes \| null)` | the updated `Cube`. Krova powers the Cube off after that many minutes without activity: an integer from 10 to 10080, or `null` for off. Needs a server with the idle-timeout feature (an older one answers `400`) |
128
+ | `setIdleTimeout` | `(spaceId, cubeId, minutes \| null)` | the updated `Cube`. Krova powers the Cube off after that many minutes without activity: an integer from 10 to 10080, or `null` for off. `Cube.lastActiveAt` shows the last activity Krova saw |
129
129
  | `resize` | `(spaceId, cubeId, { vcpu?, ramGb?, diskGb? }, opts?)` | enqueues a resize and returns `{ jobId, isLive, requiresRestart, previous, requested }`. `isLive` means no restart; `requiresRestart` is its inverse. Send only what changes; disk can only grow. `opts.idempotencyKey` makes retries safe |
130
130
  | `delete` | `(spaceId, cubeId)` | enqueues deletion |
131
131
  | `powerOff` | `(spaceId, cubeId)` | enqueues a power-off |
@@ -190,7 +190,13 @@ import type { Cube } from "@krovacloud/sdk";
190
190
  // publicIpv4: string | null;
191
191
  // resources: { vcpu: number; ramGb: number; diskGb: number };
192
192
  // image: string; costPerHour: number;
193
+ // sshUser: string; // "ubuntu" | "debian" | "root" (see client.cubes.ssh)
193
194
  // terminationProtection: boolean;
195
+ // terminationProtectionChangedAt: string | null;
196
+ // terminationProtectionChangedBy: string | null;
197
+ // idleTimeoutMinutes: number | null; // null = idle power-off is off
198
+ // lastActiveAt: string | null;
199
+ // serverDomain?: string | null; // the current physical host; changes when the Cube moves
194
200
  // createdAt: string; updatedAt: string;
195
201
  // }
196
202
  ```
@@ -210,7 +216,7 @@ const pricing = await krova.catalog.pricing(); // per-resource hourly rates + vo
210
216
  Typed helpers for a Cube's attached resources — each unwraps the response and throws `KrovaError` on failure.
211
217
 
212
218
  ```ts
213
- // Custom domains — create() resolves to { domain, records } (BREAKING in 0.4.0).
219
+ // Custom domains — create() resolves to { domain, records } (the 0.4.0 change: before 0.4.0 it resolved to the Domain alone).
214
220
  // The records are the DNS entries you must publish for the domain to work, so
215
221
  // you can create them in the same run: a wildcard needs three, an exact host one.
216
222
  const domains = await krova.domains.list("space_123", "cube_123");
@@ -231,7 +237,9 @@ await krova.snapshots.delete("space_123", "cube_123", snap.id);
231
237
  // TCP port mappings (expose a Cube port on the host)
232
238
  const mapping = await krova.tcpMappings.create("space_123", "cube_123", {
233
239
  cubePort: 5432,
234
- whitelistedIps: ["203.0.113.4/32"],
240
+ whitelistedIps: ["203.0.113.4/32"], // omit it and the port is open to the whole internet
241
+ label: "postgres", // optional
242
+ udpEnabled: true, // optional; UDP is forwarded on the same host port by default
235
243
  });
236
244
  // `mapping.host` is where to connect — the Cube's OWN stable hostname, which
237
245
  // survives migration to another server. Use it rather than the Cube's
@@ -242,7 +250,9 @@ await krova.tcpMappings.list("space_123", "cube_123");
242
250
  await krova.tcpMappings.delete("space_123", "cube_123", mapping.id);
243
251
  ```
244
252
 
245
- `Domain`, `Snapshot`, and `TcpMapping` are exported for your own signatures.
253
+ A TCP mapping forwards UDP as well as TCP on its host port unless you send `udpEnabled: false`. The allow-list, when you send one, applies to both protocols. Leave `whitelistedIps` out and the port is open to the internet.
254
+
255
+ `Domain`, `Snapshot`, and `TcpMapping` are exported for your own signatures. The other response and request shapes are in the generated spec types: for example `components["schemas"]["Webhook"]` and `components["schemas"]["WebhookDelivery"]` (`WebhookWithSecret` and `CreateWebhookInput` are not exported by name).
246
256
 
247
257
  ### `domains.records` — the DNS records a domain needs
248
258
 
@@ -264,10 +274,17 @@ error — and `unknown` means the lookup itself could not complete, which says
264
274
  nothing about your DNS. Each record also carries `mustBeGrey` and `proxyOk`:
265
275
  the routing record may sit behind Cloudflare's proxy, the `_acme-challenge`
266
276
  record must not — automation needs both flags, one alone would let you
267
- orange-cloud the single record that has to stay grey.
277
+ orange-cloud the single record that has to stay gray.
268
278
 
269
279
  `DnsRecord` (what `create` returns) and `DnsRecordStatus` (the checked variant,
270
- adding `state`, `detail`, `observed`) are exported for your own signatures.
280
+ adding `state`, `detail`, `observed`) are not exported by name. Use the generated
281
+ types when you need them in your own signatures:
282
+
283
+ ```ts
284
+ import type { components } from "@krovacloud/sdk";
285
+ type DnsRecord = components["schemas"]["DnsRecord"];
286
+ type DnsRecordStatus = components["schemas"]["DnsRecordStatus"];
287
+ ```
271
288
 
272
289
  ### Imports & backups
273
290
 
@@ -279,6 +296,9 @@ const start = await krova.imports.create("space_123", { name: "restored", fileSi
279
296
  await krova.imports.complete("space_123", start.importId, { parts, config });
280
297
  const status = await krova.imports.get("space_123", start.importId);
281
298
 
299
+ // Changed your mind before completing? Cancel the in-progress import.
300
+ await krova.imports.cancel("space_123", start.importId);
301
+
282
302
  // Export: get a time-limited download URL for a backup archive
283
303
  const dl = await krova.backups.download("space_123", "backup_123");
284
304
  ```
@@ -361,8 +381,8 @@ Thrown by every helper on any non-2xx response. (`client.raw` never throws — i
361
381
  | --- | --- | --- |
362
382
  | `status` | `number` | HTTP status code |
363
383
  | `message` | `string` | the API's `error` string, else `statusText` |
364
- | `code` | `string \| undefined` | `X-Error-Code` response header |
365
- | `requestId` | `string \| undefined` | `X-Request-Id` response header |
384
+ | `code` | `string \| undefined` | the `X-Error-Code` response header, when the server sends one. The Krova API does not send it today, so expect `undefined`. The one exception is `TerminationProtectedError`, whose `code` is `"termination_protected"`, read from the response body |
385
+ | `requestId` | `string \| undefined` | the `X-Request-Id` response header, when the server sends one. The Krova API does not send it today, so expect `undefined` |
366
386
  | `body` | `object \| undefined` | the parsed JSON error body |
367
387
  | `response` | `Response \| undefined` | the raw `Response` |
368
388
 
@@ -374,15 +394,23 @@ try {
374
394
  } catch (err) {
375
395
  if (err instanceof KrovaError) {
376
396
  console.error(`[${err.status}] ${err.message}`);
397
+ // `code` and `requestId` are filled in only when the response carries the
398
+ // matching header. Krova does not send either today, so test before you use them.
377
399
  if (err.code) console.error("code:", err.code);
378
- if (err.requestId) console.error("request id:", err.requestId); // quote this to support
400
+ if (err.requestId) console.error("request id:", err.requestId);
379
401
  } else {
380
402
  throw err;
381
403
  }
382
404
  }
383
405
  ```
384
406
 
385
- Mutating `POST` / `DELETE` endpoints are rate-limited (10 requests / 60s per client IP). The client automatically retries `429` and `503` up to `maxRetries` times, honoring the `Retry-After` header.
407
+ ### Rate limits
408
+
409
+ - Mutating `POST` / `DELETE` endpoints: 10 requests per 60 seconds per client IP.
410
+ - Every authenticated request, reads included: 600 requests per 60 seconds per API key.
411
+ - Creating Cubes: each plan allows a number of new Cubes per rolling hour, and every way of creating a Cube counts. `cubes.create`, `imports.create` and `imports.complete` are the SDK calls that answer `429` once it is used up; cloning a snapshot and redeploying a backup in the dashboard count too. Every Cube created in the last 60 minutes counts, including ones since deleted, so deleting a Cube does not free a slot. Past the allowance the API answers `429`. Its `Retry-After` header is the number of seconds until the oldest of those creates leaves the window, and is absent when the plan allows no new Cubes at all.
412
+
413
+ The client automatically retries `429` and `503` up to `maxRetries` times, honoring `Retry-After`, but never waits more than 10 seconds between attempts. A `Retry-After` of minutes or an hour (the Cube-creates allowance) therefore ends in a thrown `KrovaError` with `status` 429, and the header is on `err.response?.headers.get("retry-after")`.
386
414
 
387
415
  ## Run commands and move files
388
416
 
@@ -442,7 +470,7 @@ The package ships its own type declarations — no `@types/*` install needed. `C
442
470
 
443
471
  ## Requirements
444
472
 
445
- - **Node.js ≥ 18** (global `fetch`).
473
+ - **Node.js ≥ 22** (global `fetch`).
446
474
  - Works in any modern runtime with a WHATWG `fetch` (Deno, Bun, edge). Pass a custom `fetch` if the global isn't available.
447
475
 
448
476
  ## Contributing
@@ -496,6 +524,26 @@ would mix them is rejected with a `409` whose message names the other domains.
496
524
  Send `confirmMixedProxyProtocol: true` to save anyway, when the app handles both
497
525
  on that port.
498
526
 
527
+ ## Custom domains: other settings
528
+
529
+ `domains.create()` and `domains.update()` also take these optional settings, all applied at the edge. The API reference (the bundled OpenAPI spec, typed as `UpdateDomainInput`) has the exact shape of each.
530
+
531
+ - `responseCompression`: gzip and zstd on responses.
532
+ - `securityHeadersMode`: `"enforced"` (the default; the edge sets HSTS, X-Frame-Options and similar) or `"app_managed"` (your app's own headers pass through).
533
+ - `requestHeaderOverrides` and `responseHeaderOverrides`: `{ set?, remove? }` header rewrites; `null` clears them.
534
+ - `corsConfig`: a per-domain CORS policy; the edge answers preflight itself. `null` turns CORS off.
535
+ - `ipAllowList` and `ipDenyList`: visitor IPs or CIDRs; a visitor on the deny list gets a `403`.
536
+ - `basicAuthUser` and `basicAuthPassword`: HTTP Basic Auth. The password is hashed on the server and never returned; the `Domain` shows only `basicAuthEnabled`.
537
+ - `maxRequestBodyMb` and `responseHeaderTimeoutSecs`: request size and response-header limits.
538
+
539
+ ```ts
540
+ await krova.domains.update(spaceId, cubeId, mappingId, {
541
+ ipAllowList: ["203.0.113.0/24"],
542
+ corsConfig: { allowedOrigins: ["https://app.example.com"] },
543
+ securityHeadersMode: "app_managed",
544
+ });
545
+ ```
546
+
499
547
  ## License
500
548
 
501
549
  [MIT](./LICENSE) © 2026 Krova Inc.
@@ -805,7 +805,17 @@ interface paths {
805
805
  400: components["responses"]["BadRequest"];
806
806
  401: components["responses"]["Unauthorized"];
807
807
  403: components["responses"]["Forbidden"];
808
- 429: components["responses"]["RateLimited"];
808
+ /** @description Too many requests, or the space has used its plan's allowance of new Cubes per hour. The allowance counts every Cube created in the last 60 minutes, including ones since deleted, so deleting a Cube does not free a slot. `Retry-After` is the number of seconds until the oldest of those creates leaves the 60-minute window; it is absent when the plan allows no new Cubes at all. */
809
+ 429: {
810
+ headers: {
811
+ /** @description Seconds to wait before retrying. */
812
+ "Retry-After"?: number;
813
+ [name: string]: unknown;
814
+ };
815
+ content: {
816
+ "application/json": components["schemas"]["Error"];
817
+ };
818
+ };
809
819
  };
810
820
  };
811
821
  delete?: never;
@@ -894,6 +904,15 @@ interface paths {
894
904
  };
895
905
  content?: never;
896
906
  };
907
+ /** @description Too many requests, or the space has used its plan's allowance of new Cubes per hour. The allowance counts every Cube created in the last 60 minutes, including ones since deleted, so deleting a Cube does not free a slot. `Retry-After` is the number of seconds until the oldest of those creates leaves the 60-minute window; it is absent when the plan allows no new Cubes at all. */
908
+ 429: {
909
+ headers: {
910
+ /** @description Seconds to wait before retrying. */
911
+ "Retry-After"?: number;
912
+ [name: string]: unknown;
913
+ };
914
+ content?: never;
915
+ };
897
916
  /** @description No active storage backend */
898
917
  503: {
899
918
  headers: {
@@ -1067,6 +1086,15 @@ interface paths {
1067
1086
  };
1068
1087
  content?: never;
1069
1088
  };
1089
+ /** @description Too many requests, or the space has used its plan's allowance of new Cubes per hour. The allowance counts every Cube created in the last 60 minutes, including ones since deleted, so deleting a Cube does not free a slot. `Retry-After` is the number of seconds until the oldest of those creates leaves the 60-minute window; it is absent when the plan allows no new Cubes at all. */
1090
+ 429: {
1091
+ headers: {
1092
+ /** @description Seconds to wait before retrying. */
1093
+ "Retry-After"?: number;
1094
+ [name: string]: unknown;
1095
+ };
1096
+ content?: never;
1097
+ };
1070
1098
  /** @description S3 finalization failed */
1071
1099
  502: {
1072
1100
  headers: {
@@ -2272,6 +2300,8 @@ interface paths {
2272
2300
  requestBody: {
2273
2301
  content: {
2274
2302
  "application/json": {
2303
+ /** @description Optional label. Trimmed; an empty or non-string value is stored as null. */
2304
+ description?: string;
2275
2305
  events: ("cube.created" | "cube.running" | "cube.stopped" | "cube.error" | "cube.deleted" | "cube.cold_restarted" | "cube.transfer.started" | "cube.transfer.completed" | "cube.transfer.failed" | "cube.resize.started" | "cube.resize.completed" | "cube.resize.failed" | "resource.alert.memory" | "resource.alert.cpu" | "resource.alert.disk" | "domain.alert.error_4xx" | "domain.alert.error_5xx" | "cube.space_transferred" | "cube.space_transfer.requested" | "cube.space_transfer.accepted" | "cube.space_transfer.declined" | "cube.space_transfer.cancelled" | "cube.space_transfer.expired" | "snapshot.created" | "snapshot.restored" | "snapshot.deleted" | "snapshot.pinned" | "snapshot.promoted_to_backup" | "snapshot.exported" | "backup.created" | "backup.deleted" | "backup.redeployed" | "backup.share.requested" | "backup.share.accepted" | "backup.share.declined" | "backup.share.canceled" | "backup.share.expired" | "domain.added" | "domain.active" | "domain.removed" | "tcp_mapping.added" | "tcp_mapping.removed" | "tcp_mapping.updated" | "hosting.provisioned" | "hosting.suspended" | "hosting.unsuspended" | "hosting.deleted" | "hosting.plan_changed" | "hosting.renewed" | "hosting.cancellation_scheduled" | "hosting.suspended_for_non_payment" | "hosting.deleted_after_recovery" | "member.invited" | "member.joined" | "member.removed" | "member.role_changed")[];
2276
2306
  /** Format: uri */
2277
2307
  url: string;
@@ -2645,6 +2675,8 @@ interface components {
2645
2675
  Webhook: {
2646
2676
  /** Format: date-time */
2647
2677
  createdAt: string;
2678
+ /** @description Optional label for the endpoint. Returned by create and get-one; the list response omits it. */
2679
+ description?: string | null;
2648
2680
  enabled: boolean;
2649
2681
  events: string[];
2650
2682
  id: string;
@@ -2803,7 +2835,8 @@ type CreateCubeInput = NonNullable<paths["/spaces/{spaceId}/cubes"]["post"]["req
2803
2835
  };
2804
2836
  /**
2805
2837
  * The dimensions to change in a Cube resize, in the units `POST /cubes` takes:
2806
- * `vcpu` and `diskGb` are integers, `ramGb` may be fractional (`0.5`). Send only
2838
+ * `vcpu`, `ramGb` and `diskGb` are whole numbers: the server accepts RAM in whole
2839
+ * GB steps (1 GB) only, so a fraction such as `0.5` is refused. Send only
2807
2840
  * what changes; omitted dimensions keep their current value. Disk can only grow.
2808
2841
  */
2809
2842
  type ResizeCubeInput = NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/resize"]["post"]["requestBody"]>["content"]["application/json"]["resources"];
@@ -2819,28 +2852,19 @@ type ResizeCubeResult = paths["/spaces/{spaceId}/cubes/{cubeId}/resize"]["post"]
2819
2852
  /**
2820
2853
  * A webhook endpoint subscribed to Space events.
2821
2854
  *
2822
- * ⛔ Runtime discrepancy: the bundled OpenAPI spec does not declare
2823
- * `description`, but `GET /spaces/{spaceId}/webhooks/{endpointId}` includes
2824
- * it as `string | null`. The schema-derived type is extended here so callers
2825
- * reading a single webhook see the field; it is optional so list responses
2826
- * (which omit it) still typecheck.
2855
+ * `description` is the optional label. `GET /spaces/{spaceId}/webhooks/{endpointId}`
2856
+ * and the create response include it; the list response omits it.
2827
2857
  */
2828
- type Webhook = components["schemas"]["Webhook"] & {
2829
- description?: string | null;
2830
- };
2858
+ type Webhook = components["schemas"]["Webhook"];
2831
2859
  /** A recorded webhook delivery attempt (last 30 days of history). */
2832
2860
  type WebhookDelivery = components["schemas"]["WebhookDelivery"];
2833
2861
  /**
2834
2862
  * Request body for creating a webhook endpoint.
2835
2863
  *
2836
2864
  * Derived from `paths["/spaces/{spaceId}/webhooks"]["post"]` exactly like
2837
- * {@link CreateDomainInput}; `description` is intersected on because the
2838
- * bundled spec omits it but the runtime accepts it.
2865
+ * {@link CreateDomainInput}; `description` is the optional human-readable label.
2839
2866
  */
2840
- type CreateWebhookInput = NonNullable<paths["/spaces/{spaceId}/webhooks"]["post"]["requestBody"]>["content"]["application/json"] & {
2841
- /** Optional human-readable label shown on the endpoint. */
2842
- description?: string;
2843
- };
2867
+ type CreateWebhookInput = NonNullable<paths["/spaces/{spaceId}/webhooks"]["post"]["requestBody"]>["content"]["application/json"];
2844
2868
  /** A webhook plus its signing secret. Returned ONLY by {@link KrovaClient.webhooks}.create. */
2845
2869
  type WebhookWithSecret = Webhook & {
2846
2870
  secret: string;
@@ -2965,10 +2989,11 @@ declare class KrovaClient {
2965
2989
  * changed by this call. Pointing this at a port nothing is listening on
2966
2990
  * inside the Cube will silently make SSH unreachable; the default is 22.
2967
2991
  *
2968
- * The Krova Cloud API exposes no general Cube-mutation endpoint; the only
2969
- * mutable Cube field over the API is this port, via
2970
- * `PUT /spaces/{spaceId}/cubes/{cubeId}/ssh-port`. This helper maps to that
2971
- * endpoint. (Rename and resize have their own helpers: `cubes.rename` and `cubes.resize`.)
2992
+ * This helper maps to `PUT /spaces/{spaceId}/cubes/{cubeId}/ssh-port` and
2993
+ * changes only that port. The other mutable Cube fields have their own
2994
+ * helpers: `cubes.rename`, `cubes.setIdleTimeout` and
2995
+ * `cubes.setTerminationProtection` (all `PATCH /spaces/{spaceId}/cubes/{cubeId}`),
2996
+ * and `cubes.resize`.
2972
2997
  */
2973
2998
  update: (spaceId: string, cubeId: string, body: NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/ssh-port"]["put"]["requestBody"]>["content"]["application/json"]) => Promise<unknown>;
2974
2999
  /**
@@ -805,7 +805,17 @@ interface paths {
805
805
  400: components["responses"]["BadRequest"];
806
806
  401: components["responses"]["Unauthorized"];
807
807
  403: components["responses"]["Forbidden"];
808
- 429: components["responses"]["RateLimited"];
808
+ /** @description Too many requests, or the space has used its plan's allowance of new Cubes per hour. The allowance counts every Cube created in the last 60 minutes, including ones since deleted, so deleting a Cube does not free a slot. `Retry-After` is the number of seconds until the oldest of those creates leaves the 60-minute window; it is absent when the plan allows no new Cubes at all. */
809
+ 429: {
810
+ headers: {
811
+ /** @description Seconds to wait before retrying. */
812
+ "Retry-After"?: number;
813
+ [name: string]: unknown;
814
+ };
815
+ content: {
816
+ "application/json": components["schemas"]["Error"];
817
+ };
818
+ };
809
819
  };
810
820
  };
811
821
  delete?: never;
@@ -894,6 +904,15 @@ interface paths {
894
904
  };
895
905
  content?: never;
896
906
  };
907
+ /** @description Too many requests, or the space has used its plan's allowance of new Cubes per hour. The allowance counts every Cube created in the last 60 minutes, including ones since deleted, so deleting a Cube does not free a slot. `Retry-After` is the number of seconds until the oldest of those creates leaves the 60-minute window; it is absent when the plan allows no new Cubes at all. */
908
+ 429: {
909
+ headers: {
910
+ /** @description Seconds to wait before retrying. */
911
+ "Retry-After"?: number;
912
+ [name: string]: unknown;
913
+ };
914
+ content?: never;
915
+ };
897
916
  /** @description No active storage backend */
898
917
  503: {
899
918
  headers: {
@@ -1067,6 +1086,15 @@ interface paths {
1067
1086
  };
1068
1087
  content?: never;
1069
1088
  };
1089
+ /** @description Too many requests, or the space has used its plan's allowance of new Cubes per hour. The allowance counts every Cube created in the last 60 minutes, including ones since deleted, so deleting a Cube does not free a slot. `Retry-After` is the number of seconds until the oldest of those creates leaves the 60-minute window; it is absent when the plan allows no new Cubes at all. */
1090
+ 429: {
1091
+ headers: {
1092
+ /** @description Seconds to wait before retrying. */
1093
+ "Retry-After"?: number;
1094
+ [name: string]: unknown;
1095
+ };
1096
+ content?: never;
1097
+ };
1070
1098
  /** @description S3 finalization failed */
1071
1099
  502: {
1072
1100
  headers: {
@@ -2272,6 +2300,8 @@ interface paths {
2272
2300
  requestBody: {
2273
2301
  content: {
2274
2302
  "application/json": {
2303
+ /** @description Optional label. Trimmed; an empty or non-string value is stored as null. */
2304
+ description?: string;
2275
2305
  events: ("cube.created" | "cube.running" | "cube.stopped" | "cube.error" | "cube.deleted" | "cube.cold_restarted" | "cube.transfer.started" | "cube.transfer.completed" | "cube.transfer.failed" | "cube.resize.started" | "cube.resize.completed" | "cube.resize.failed" | "resource.alert.memory" | "resource.alert.cpu" | "resource.alert.disk" | "domain.alert.error_4xx" | "domain.alert.error_5xx" | "cube.space_transferred" | "cube.space_transfer.requested" | "cube.space_transfer.accepted" | "cube.space_transfer.declined" | "cube.space_transfer.cancelled" | "cube.space_transfer.expired" | "snapshot.created" | "snapshot.restored" | "snapshot.deleted" | "snapshot.pinned" | "snapshot.promoted_to_backup" | "snapshot.exported" | "backup.created" | "backup.deleted" | "backup.redeployed" | "backup.share.requested" | "backup.share.accepted" | "backup.share.declined" | "backup.share.canceled" | "backup.share.expired" | "domain.added" | "domain.active" | "domain.removed" | "tcp_mapping.added" | "tcp_mapping.removed" | "tcp_mapping.updated" | "hosting.provisioned" | "hosting.suspended" | "hosting.unsuspended" | "hosting.deleted" | "hosting.plan_changed" | "hosting.renewed" | "hosting.cancellation_scheduled" | "hosting.suspended_for_non_payment" | "hosting.deleted_after_recovery" | "member.invited" | "member.joined" | "member.removed" | "member.role_changed")[];
2276
2306
  /** Format: uri */
2277
2307
  url: string;
@@ -2645,6 +2675,8 @@ interface components {
2645
2675
  Webhook: {
2646
2676
  /** Format: date-time */
2647
2677
  createdAt: string;
2678
+ /** @description Optional label for the endpoint. Returned by create and get-one; the list response omits it. */
2679
+ description?: string | null;
2648
2680
  enabled: boolean;
2649
2681
  events: string[];
2650
2682
  id: string;
@@ -2803,7 +2835,8 @@ type CreateCubeInput = NonNullable<paths["/spaces/{spaceId}/cubes"]["post"]["req
2803
2835
  };
2804
2836
  /**
2805
2837
  * The dimensions to change in a Cube resize, in the units `POST /cubes` takes:
2806
- * `vcpu` and `diskGb` are integers, `ramGb` may be fractional (`0.5`). Send only
2838
+ * `vcpu`, `ramGb` and `diskGb` are whole numbers: the server accepts RAM in whole
2839
+ * GB steps (1 GB) only, so a fraction such as `0.5` is refused. Send only
2807
2840
  * what changes; omitted dimensions keep their current value. Disk can only grow.
2808
2841
  */
2809
2842
  type ResizeCubeInput = NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/resize"]["post"]["requestBody"]>["content"]["application/json"]["resources"];
@@ -2819,28 +2852,19 @@ type ResizeCubeResult = paths["/spaces/{spaceId}/cubes/{cubeId}/resize"]["post"]
2819
2852
  /**
2820
2853
  * A webhook endpoint subscribed to Space events.
2821
2854
  *
2822
- * ⛔ Runtime discrepancy: the bundled OpenAPI spec does not declare
2823
- * `description`, but `GET /spaces/{spaceId}/webhooks/{endpointId}` includes
2824
- * it as `string | null`. The schema-derived type is extended here so callers
2825
- * reading a single webhook see the field; it is optional so list responses
2826
- * (which omit it) still typecheck.
2855
+ * `description` is the optional label. `GET /spaces/{spaceId}/webhooks/{endpointId}`
2856
+ * and the create response include it; the list response omits it.
2827
2857
  */
2828
- type Webhook = components["schemas"]["Webhook"] & {
2829
- description?: string | null;
2830
- };
2858
+ type Webhook = components["schemas"]["Webhook"];
2831
2859
  /** A recorded webhook delivery attempt (last 30 days of history). */
2832
2860
  type WebhookDelivery = components["schemas"]["WebhookDelivery"];
2833
2861
  /**
2834
2862
  * Request body for creating a webhook endpoint.
2835
2863
  *
2836
2864
  * Derived from `paths["/spaces/{spaceId}/webhooks"]["post"]` exactly like
2837
- * {@link CreateDomainInput}; `description` is intersected on because the
2838
- * bundled spec omits it but the runtime accepts it.
2865
+ * {@link CreateDomainInput}; `description` is the optional human-readable label.
2839
2866
  */
2840
- type CreateWebhookInput = NonNullable<paths["/spaces/{spaceId}/webhooks"]["post"]["requestBody"]>["content"]["application/json"] & {
2841
- /** Optional human-readable label shown on the endpoint. */
2842
- description?: string;
2843
- };
2867
+ type CreateWebhookInput = NonNullable<paths["/spaces/{spaceId}/webhooks"]["post"]["requestBody"]>["content"]["application/json"];
2844
2868
  /** A webhook plus its signing secret. Returned ONLY by {@link KrovaClient.webhooks}.create. */
2845
2869
  type WebhookWithSecret = Webhook & {
2846
2870
  secret: string;
@@ -2965,10 +2989,11 @@ declare class KrovaClient {
2965
2989
  * changed by this call. Pointing this at a port nothing is listening on
2966
2990
  * inside the Cube will silently make SSH unreachable; the default is 22.
2967
2991
  *
2968
- * The Krova Cloud API exposes no general Cube-mutation endpoint; the only
2969
- * mutable Cube field over the API is this port, via
2970
- * `PUT /spaces/{spaceId}/cubes/{cubeId}/ssh-port`. This helper maps to that
2971
- * endpoint. (Rename and resize have their own helpers: `cubes.rename` and `cubes.resize`.)
2992
+ * This helper maps to `PUT /spaces/{spaceId}/cubes/{cubeId}/ssh-port` and
2993
+ * changes only that port. The other mutable Cube fields have their own
2994
+ * helpers: `cubes.rename`, `cubes.setIdleTimeout` and
2995
+ * `cubes.setTerminationProtection` (all `PATCH /spaces/{spaceId}/cubes/{cubeId}`),
2996
+ * and `cubes.resize`.
2972
2997
  */
2973
2998
  update: (spaceId: string, cubeId: string, body: NonNullable<paths["/spaces/{spaceId}/cubes/{cubeId}/ssh-port"]["put"]["requestBody"]>["content"]["application/json"]) => Promise<unknown>;
2974
2999
  /**
package/dist/index.cjs CHANGED
@@ -317,10 +317,11 @@ var KrovaClient = class {
317
317
  * changed by this call. Pointing this at a port nothing is listening on
318
318
  * inside the Cube will silently make SSH unreachable; the default is 22.
319
319
  *
320
- * The Krova Cloud API exposes no general Cube-mutation endpoint; the only
321
- * mutable Cube field over the API is this port, via
322
- * `PUT /spaces/{spaceId}/cubes/{cubeId}/ssh-port`. This helper maps to that
323
- * endpoint. (Rename and resize have their own helpers: `cubes.rename` and `cubes.resize`.)
320
+ * This helper maps to `PUT /spaces/{spaceId}/cubes/{cubeId}/ssh-port` and
321
+ * changes only that port. The other mutable Cube fields have their own
322
+ * helpers: `cubes.rename`, `cubes.setIdleTimeout` and
323
+ * `cubes.setTerminationProtection` (all `PATCH /spaces/{spaceId}/cubes/{cubeId}`),
324
+ * and `cubes.resize`.
324
325
  */
325
326
  update: async (spaceId, cubeId, body) => {
326
327
  const { data, error, response } = await this.raw.PUT("/spaces/{spaceId}/cubes/{cubeId}/ssh-port", {