@krovacloud/sdk 0.4.5 → 0.4.6

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/README.md CHANGED
@@ -54,6 +54,13 @@ console.log(` ${cube.resources.vcpu} vCPU / ${cube.resources.ramGb} GB RAM, ima
54
54
  // Cubes from images that ship a default user (both with passwordless sudo)
55
55
  // and "root" on Cubes created before that change, so the image id cannot
56
56
  // tell you. `cube.sshUser` on the Cube object carries the same value.
57
+ //
58
+ // `ssh.host` is the Cube's own stable SSH hostname — it survives migration
59
+ // to another server, falling back to the server's public IPv4 only when the
60
+ // Cube has no DNS record yet. If you pin host keys in your own known_hosts
61
+ // (as the CLI does), expect a one-time re-pin for any Cube you'd previously
62
+ // connected to by IP: the host string changes from an IP to a name, so it's
63
+ // a new known_hosts entry, not a compromised host.
57
64
  const ssh = await krova.cubes.ssh("space_123", cube.id);
58
65
  console.log(`ssh ${ssh.user}@${ssh.host} -p ${ssh.port}`);
59
66
 
@@ -115,7 +122,7 @@ Ergonomic helpers for the Cube lifecycle. Each unwraps the response body and thr
115
122
  | `delete` | `(spaceId, cubeId)` | enqueues deletion |
116
123
  | `powerOff` | `(spaceId, cubeId)` | enqueues a power-off |
117
124
  | `wake` | `(spaceId, cubeId)` | enqueues a start |
118
- | `ssh` | `(spaceId, cubeId)` | the Cube's SSH connection info (`host`, `port`, `user`, `hostKeys`) |
125
+ | `ssh` | `(spaceId, cubeId)` | the Cube's SSH connection info `host` is its stable SSH hostname (falls back to the server's public IPv4 with no DNS record yet), plus `port`, `user`, `hostKeys` |
119
126
  | `restore` | `(spaceId, cubeId, snapshotId)` | enqueues a restore — replaces the Cube's disk from a snapshot |
120
127
 
121
128
  ```ts
package/dist/index.d.cts CHANGED
@@ -654,7 +654,7 @@ interface paths {
654
654
  };
655
655
  /**
656
656
  * Get a Cube's SSH connection info
657
- * @description Host (server public IPv4), host SSH port, login user, and the Cube's captured SSH host public keys. **Use `user` rather than assuming a username** — it is `ubuntu` or `debian` on Cubes created from images that ship a default user, and `root` on Cubes created before that change or imported from a rootfs without one. `hostKeys` is empty only until the reachability cron makes its first capture; clients fall back to trust-on-first-use until then, and pin strictly afterwards.
657
+ * @description `host` is the Cube's own stable SSH hostname, which survives migration to another server — it falls back to the server's public IPv4 when the Cube has no DNS record yet. Also returns the host SSH port, login user, and the Cube's captured SSH host public keys. **Use `user` rather than assuming a username** — it is `ubuntu` or `debian` on Cubes created from images that ship a default user, and `root` on Cubes created before that change or imported from a rootfs without one. `hostKeys` is empty only until the reachability cron makes its first capture; clients fall back to trust-on-first-use until then, and pin strictly afterwards.
658
658
  */
659
659
  get: {
660
660
  parameters: {
@@ -1072,13 +1072,17 @@ interface paths {
1072
1072
  cubePort: number;
1073
1073
  /** @description Optional human label for the mapping. */
1074
1074
  label?: string;
1075
- /** @description Whether the mapping also forwards UDP traffic on the same host port, in addition to TCP. Optional; defaults to true when omitted.
1076
- * @default true */
1075
+ /**
1076
+ * @description Whether the mapping also forwards UDP traffic on the same host port, in addition to TCP. Optional; defaults to true when omitted.
1077
+ * @default true
1078
+ */
1077
1079
  udpEnabled?: boolean;
1078
1080
  /** @description IPs/CIDRs allowed to reach the published port. Omit or send an empty array to leave the port open to the internet. */
1079
1081
  whitelistedIps?: string[];
1080
- /** @deprecated
1081
- * @description DEPRECATED alias for `whitelistedIps`, accepted for backwards compatibility. `whitelistedIps` wins if both are sent. Use `whitelistedIps` in new code. */
1082
+ /**
1083
+ * @deprecated
1084
+ * @description DEPRECATED alias for `whitelistedIps`, accepted for backwards compatibility. `whitelistedIps` wins if both are sent. Use `whitelistedIps` in new code.
1085
+ */
1082
1086
  whitelistIps?: string[];
1083
1087
  };
1084
1088
  };
@@ -1840,6 +1844,8 @@ interface components {
1840
1844
  image: string;
1841
1845
  sshUser: string;
1842
1846
  costPerHour: number;
1847
+ /** @description The hostname of the server currently hosting this Cube (e.g. `mango.krova.cloud`). This is NOT the Cube's own SSH target — use `host` from GET .../ssh for that, which is the Cube's own stable hostname and survives migration to another server. Null when the Cube has no server assigned. Only present on the single-Cube GET; list and create responses omit it. */
1848
+ serverDomain?: string | null;
1843
1849
  /** Format: date-time */
1844
1850
  createdAt: string;
1845
1851
  /** Format: date-time */
@@ -2171,6 +2177,7 @@ declare class KrovaClient {
2171
2177
  image: string;
2172
2178
  sshUser: string;
2173
2179
  costPerHour: number;
2180
+ serverDomain?: string | null;
2174
2181
  createdAt: string;
2175
2182
  updatedAt: string;
2176
2183
  }[];
package/dist/index.d.ts CHANGED
@@ -654,7 +654,7 @@ interface paths {
654
654
  };
655
655
  /**
656
656
  * Get a Cube's SSH connection info
657
- * @description Host (server public IPv4), host SSH port, login user, and the Cube's captured SSH host public keys. **Use `user` rather than assuming a username** — it is `ubuntu` or `debian` on Cubes created from images that ship a default user, and `root` on Cubes created before that change or imported from a rootfs without one. `hostKeys` is empty only until the reachability cron makes its first capture; clients fall back to trust-on-first-use until then, and pin strictly afterwards.
657
+ * @description `host` is the Cube's own stable SSH hostname, which survives migration to another server — it falls back to the server's public IPv4 when the Cube has no DNS record yet. Also returns the host SSH port, login user, and the Cube's captured SSH host public keys. **Use `user` rather than assuming a username** — it is `ubuntu` or `debian` on Cubes created from images that ship a default user, and `root` on Cubes created before that change or imported from a rootfs without one. `hostKeys` is empty only until the reachability cron makes its first capture; clients fall back to trust-on-first-use until then, and pin strictly afterwards.
658
658
  */
659
659
  get: {
660
660
  parameters: {
@@ -1072,13 +1072,17 @@ interface paths {
1072
1072
  cubePort: number;
1073
1073
  /** @description Optional human label for the mapping. */
1074
1074
  label?: string;
1075
- /** @description Whether the mapping also forwards UDP traffic on the same host port, in addition to TCP. Optional; defaults to true when omitted.
1076
- * @default true */
1075
+ /**
1076
+ * @description Whether the mapping also forwards UDP traffic on the same host port, in addition to TCP. Optional; defaults to true when omitted.
1077
+ * @default true
1078
+ */
1077
1079
  udpEnabled?: boolean;
1078
1080
  /** @description IPs/CIDRs allowed to reach the published port. Omit or send an empty array to leave the port open to the internet. */
1079
1081
  whitelistedIps?: string[];
1080
- /** @deprecated
1081
- * @description DEPRECATED alias for `whitelistedIps`, accepted for backwards compatibility. `whitelistedIps` wins if both are sent. Use `whitelistedIps` in new code. */
1082
+ /**
1083
+ * @deprecated
1084
+ * @description DEPRECATED alias for `whitelistedIps`, accepted for backwards compatibility. `whitelistedIps` wins if both are sent. Use `whitelistedIps` in new code.
1085
+ */
1082
1086
  whitelistIps?: string[];
1083
1087
  };
1084
1088
  };
@@ -1840,6 +1844,8 @@ interface components {
1840
1844
  image: string;
1841
1845
  sshUser: string;
1842
1846
  costPerHour: number;
1847
+ /** @description The hostname of the server currently hosting this Cube (e.g. `mango.krova.cloud`). This is NOT the Cube's own SSH target — use `host` from GET .../ssh for that, which is the Cube's own stable hostname and survives migration to another server. Null when the Cube has no server assigned. Only present on the single-Cube GET; list and create responses omit it. */
1848
+ serverDomain?: string | null;
1843
1849
  /** Format: date-time */
1844
1850
  createdAt: string;
1845
1851
  /** Format: date-time */
@@ -2171,6 +2177,7 @@ declare class KrovaClient {
2171
2177
  image: string;
2172
2178
  sshUser: string;
2173
2179
  costPerHour: number;
2180
+ serverDomain?: string | null;
2174
2181
  createdAt: string;
2175
2182
  updatedAt: string;
2176
2183
  }[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krovacloud/sdk",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
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",