@krovacloud/sdk 0.3.10 → 0.3.11

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
@@ -49,6 +49,14 @@ const cube = await krova.cubes.create("space_123", {
49
49
  console.log(`Created cube ${cube.id} (${cube.state})`);
50
50
  console.log(` ${cube.resources.vcpu} vCPU / ${cube.resources.ramGb} GB RAM, image ${cube.image}`);
51
51
 
52
+ // Everything needed to SSH in — including WHICH USER to log in as.
53
+ // Read `user`; do not derive it from `image`. It is "ubuntu" or "debian" on
54
+ // Cubes from images that ship a default user (both with passwordless sudo)
55
+ // and "root" on Cubes created before that change, so the image id cannot
56
+ // tell you. `cube.sshUser` on the Cube object carries the same value.
57
+ const ssh = await krova.cubes.ssh("space_123", cube.id);
58
+ console.log(`ssh ${ssh.user}@${ssh.host} -p ${ssh.port}`);
59
+
52
60
  // Power it off, then start it again
53
61
  await krova.cubes.powerOff("space_123", cube.id);
54
62
  await krova.cubes.wake("space_123", cube.id);
package/dist/index.d.cts CHANGED
@@ -366,7 +366,7 @@ interface paths {
366
366
  ramGb: number;
367
367
  diskGb: number;
368
368
  };
369
- /** @description SSH public key written to /root/.ssh/authorized_keys at boot. Must start with ssh-ed25519, ssh-rsa, ecdsa-sha2-*, ssh-dss, or sk-*@openssh.com. */
369
+ /** @description SSH public key written to the Cube login user's authorized_keys at boot (~/.ssh/authorized_keys for the ubuntu or debian user; /root/.ssh/authorized_keys on Cubes created before the default-user change). GET /cubes/{cubeId}/ssh reports the login user for a given Cube. Must start with ssh-ed25519, ssh-rsa, ecdsa-sha2-*, ssh-dss, or sk-*@openssh.com. */
370
370
  sshPublicKey: string;
371
371
  /** @description Region slug from /v1/regions (optional). */
372
372
  region?: string;
@@ -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 any captured SSH host public keys. `hostKeys` is empty until Krova captures cube host keys clients fall back to trust-on-first-use until then.
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.
658
658
  */
659
659
  get: {
660
660
  parameters: {
@@ -1323,10 +1323,12 @@ interface paths {
1323
1323
  name: string;
1324
1324
  fileSizeBytes: number;
1325
1325
  /**
1326
+ * @description What to do with SSH access on the imported rootfs. `replace` (default) writes `sshPublicKey` to the login user's authorized_keys and requires `sshPublicKey` to be set. `keep` leaves the image's own authorized_keys and sshd configuration completely untouched — nothing is written — so you must already hold a private key that the image accepts, or you will not be able to log in.
1326
1327
  * @default replace
1327
1328
  * @enum {string}
1328
1329
  */
1329
1330
  sshKeyMode?: "replace" | "keep";
1331
+ /** @description Public key to install when `sshKeyMode` is `replace`. Written to the login user's `~/.ssh/authorized_keys` — which user that is comes from the imported rootfs itself, so an image without a Krova default user keeps logging in as root. Ignored when `sshKeyMode` is `keep`. */
1330
1332
  sshPublicKey?: string | null;
1331
1333
  region?: string | null;
1332
1334
  vcpusOverride?: number | null;
@@ -1766,6 +1768,7 @@ interface components {
1766
1768
  diskGb: number;
1767
1769
  };
1768
1770
  image: string;
1771
+ sshUser: string;
1769
1772
  costPerHour: number;
1770
1773
  /** Format: date-time */
1771
1774
  createdAt: string;
@@ -1788,6 +1791,7 @@ interface components {
1788
1791
  name: string;
1789
1792
  version: string;
1790
1793
  description: string;
1794
+ defaultUser: string;
1791
1795
  };
1792
1796
  PricingTier: {
1793
1797
  minVcpus: number;
@@ -2038,6 +2042,7 @@ declare class KrovaClient {
2038
2042
  diskGb: number;
2039
2043
  };
2040
2044
  image: string;
2045
+ sshUser: string;
2041
2046
  costPerHour: number;
2042
2047
  createdAt: string;
2043
2048
  updatedAt: string;
@@ -2229,6 +2234,7 @@ declare class KrovaClient {
2229
2234
  name: string;
2230
2235
  version: string;
2231
2236
  description: string;
2237
+ defaultUser: string;
2232
2238
  }[];
2233
2239
  }>;
2234
2240
  /** Per-resource hourly rates and volume pricing tiers. */
package/dist/index.d.ts CHANGED
@@ -366,7 +366,7 @@ interface paths {
366
366
  ramGb: number;
367
367
  diskGb: number;
368
368
  };
369
- /** @description SSH public key written to /root/.ssh/authorized_keys at boot. Must start with ssh-ed25519, ssh-rsa, ecdsa-sha2-*, ssh-dss, or sk-*@openssh.com. */
369
+ /** @description SSH public key written to the Cube login user's authorized_keys at boot (~/.ssh/authorized_keys for the ubuntu or debian user; /root/.ssh/authorized_keys on Cubes created before the default-user change). GET /cubes/{cubeId}/ssh reports the login user for a given Cube. Must start with ssh-ed25519, ssh-rsa, ecdsa-sha2-*, ssh-dss, or sk-*@openssh.com. */
370
370
  sshPublicKey: string;
371
371
  /** @description Region slug from /v1/regions (optional). */
372
372
  region?: string;
@@ -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 any captured SSH host public keys. `hostKeys` is empty until Krova captures cube host keys clients fall back to trust-on-first-use until then.
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.
658
658
  */
659
659
  get: {
660
660
  parameters: {
@@ -1323,10 +1323,12 @@ interface paths {
1323
1323
  name: string;
1324
1324
  fileSizeBytes: number;
1325
1325
  /**
1326
+ * @description What to do with SSH access on the imported rootfs. `replace` (default) writes `sshPublicKey` to the login user's authorized_keys and requires `sshPublicKey` to be set. `keep` leaves the image's own authorized_keys and sshd configuration completely untouched — nothing is written — so you must already hold a private key that the image accepts, or you will not be able to log in.
1326
1327
  * @default replace
1327
1328
  * @enum {string}
1328
1329
  */
1329
1330
  sshKeyMode?: "replace" | "keep";
1331
+ /** @description Public key to install when `sshKeyMode` is `replace`. Written to the login user's `~/.ssh/authorized_keys` — which user that is comes from the imported rootfs itself, so an image without a Krova default user keeps logging in as root. Ignored when `sshKeyMode` is `keep`. */
1330
1332
  sshPublicKey?: string | null;
1331
1333
  region?: string | null;
1332
1334
  vcpusOverride?: number | null;
@@ -1766,6 +1768,7 @@ interface components {
1766
1768
  diskGb: number;
1767
1769
  };
1768
1770
  image: string;
1771
+ sshUser: string;
1769
1772
  costPerHour: number;
1770
1773
  /** Format: date-time */
1771
1774
  createdAt: string;
@@ -1788,6 +1791,7 @@ interface components {
1788
1791
  name: string;
1789
1792
  version: string;
1790
1793
  description: string;
1794
+ defaultUser: string;
1791
1795
  };
1792
1796
  PricingTier: {
1793
1797
  minVcpus: number;
@@ -2038,6 +2042,7 @@ declare class KrovaClient {
2038
2042
  diskGb: number;
2039
2043
  };
2040
2044
  image: string;
2045
+ sshUser: string;
2041
2046
  costPerHour: number;
2042
2047
  createdAt: string;
2043
2048
  updatedAt: string;
@@ -2229,6 +2234,7 @@ declare class KrovaClient {
2229
2234
  name: string;
2230
2235
  version: string;
2231
2236
  description: string;
2237
+ defaultUser: string;
2232
2238
  }[];
2233
2239
  }>;
2234
2240
  /** Per-resource hourly rates and volume pricing tiers. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krovacloud/sdk",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
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",
@@ -61,7 +61,7 @@
61
61
  "openapi-fetch": "^0.17.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@types/node": "^26.1.1",
64
+ "@types/node": "^26.1.2",
65
65
  "openapi-typescript": "^7.13.0",
66
66
  "tsup": "^8.5.1",
67
67
  "tsx": "^4.23.1",