@krovacloud/sdk 0.4.1 → 0.4.2
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 +17 -0
- package/README.md +30 -2
- package/dist/index.d.cts +22 -22
- package/dist/index.d.ts +22 -22
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ All notable changes to `@krovacloud/sdk` are documented here. This project adher
|
|
|
5
5
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format.
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
## 0.4.2
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Docs-only republish: the `domains.create()` example now destructures the
|
|
13
|
+
`{ domain, records }` result (the 0.4.0 shape), and `domains.records()` plus
|
|
14
|
+
the `DnsRecord`/`DnsRecordStatus` types are documented in the README. No code
|
|
15
|
+
change.
|
|
16
|
+
|
|
17
|
+
## 0.4.1
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Automated patch republish (2026-08-27, PR #46): the package is now built with
|
|
22
|
+
**tsdown** (replacing the unmaintained tsup) and formatted with **oxfmt**
|
|
23
|
+
(replacing Prettier). No API change.
|
|
24
|
+
|
|
8
25
|
## 0.4.0
|
|
9
26
|
|
|
10
27
|
### Changed
|
package/README.md
CHANGED
|
@@ -181,12 +181,15 @@ const pricing = await krova.catalog.pricing(); // per-resource hourly rates + vo
|
|
|
181
181
|
Typed helpers for a Cube's attached resources — each unwraps the response and throws `KrovaError` on failure.
|
|
182
182
|
|
|
183
183
|
```ts
|
|
184
|
-
// Custom domains
|
|
184
|
+
// Custom domains — create() resolves to { domain, records } (BREAKING in 0.4.0).
|
|
185
|
+
// The records are the DNS entries you must publish for the domain to work, so
|
|
186
|
+
// you can create them in the same run: a wildcard needs three, an exact host one.
|
|
185
187
|
const domains = await krova.domains.list("space_123", "cube_123");
|
|
186
|
-
const domain = await krova.domains.create("space_123", "cube_123", {
|
|
188
|
+
const { domain, records } = await krova.domains.create("space_123", "cube_123", {
|
|
187
189
|
domain: "app.example.com",
|
|
188
190
|
port: 8080,
|
|
189
191
|
});
|
|
192
|
+
for (const r of records) console.log(`${r.type} ${r.host} → ${r.value}`);
|
|
190
193
|
await krova.domains.update("space_123", "cube_123", domain.id, { responseCompression: true });
|
|
191
194
|
await krova.domains.delete("space_123", "cube_123", domain.id);
|
|
192
195
|
|
|
@@ -207,6 +210,31 @@ await krova.tcpMappings.delete("space_123", "cube_123", mapping.id);
|
|
|
207
210
|
|
|
208
211
|
`Domain`, `Snapshot`, and `TcpMapping` are exported for your own signatures.
|
|
209
212
|
|
|
213
|
+
### `domains.records` — the DNS records a domain needs
|
|
214
|
+
|
|
215
|
+
The same records `domains.create()` returns, but each one **checked against live
|
|
216
|
+
DNS**. Poll it after publishing them — `summary.complete` turns true only once
|
|
217
|
+
every record is `found`. Each call performs real DNS lookups and is rate
|
|
218
|
+
limited, so poll on an interval rather than in a tight loop.
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
const status = await krova.domains.records("space_123", "cube_123", domain.id);
|
|
222
|
+
// { domain, isWildcard, records: DnsRecordStatus[], summary: { found, total, complete }, checkedAt }
|
|
223
|
+
for (const r of status.records) console.log(`${r.host}: ${r.state}`); // found | missing | mismatch | unknown
|
|
224
|
+
if (status.summary.complete) console.log("all records resolve — the domain can go live");
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Two record states are worth knowing before you alert on them: `missing` means
|
|
228
|
+
NOT PUBLISHED YET — the expected state before the records are created, never an
|
|
229
|
+
error — and `unknown` means the lookup itself could not complete, which says
|
|
230
|
+
nothing about your DNS. Each record also carries `mustBeGrey` and `proxyOk`:
|
|
231
|
+
the routing record may sit behind Cloudflare's proxy, the `_acme-challenge`
|
|
232
|
+
record must not — automation needs both flags, one alone would let you
|
|
233
|
+
orange-cloud the single record that has to stay grey.
|
|
234
|
+
|
|
235
|
+
`DnsRecord` (what `create` returns) and `DnsRecordStatus` (the checked variant,
|
|
236
|
+
adding `state`, `detail`, `observed`) are exported for your own signatures.
|
|
237
|
+
|
|
210
238
|
### Imports & backups
|
|
211
239
|
|
|
212
240
|
Move `.cube` archives in and out. `imports.create` returns a multipart upload target; upload the archive to the presigned parts, then call `imports.complete`.
|
package/dist/index.d.cts
CHANGED
|
@@ -2320,27 +2320,27 @@ declare class KrovaClient {
|
|
|
2320
2320
|
* archive to those URLs, then call {@link imports.complete}.
|
|
2321
2321
|
*/
|
|
2322
2322
|
create: (spaceId: string, body: NonNullable<paths["/spaces/{spaceId}/cubes/imports"]["post"]["requestBody"]>["content"]["application/json"]) => Promise<{
|
|
2323
|
-
importId?: string
|
|
2324
|
-
uploadId?: string
|
|
2325
|
-
key?: string
|
|
2326
|
-
chunkSizeBytes?: number
|
|
2323
|
+
importId?: string;
|
|
2324
|
+
uploadId?: string;
|
|
2325
|
+
key?: string;
|
|
2326
|
+
chunkSizeBytes?: number;
|
|
2327
2327
|
parts?: {
|
|
2328
|
-
partNumber?: number
|
|
2329
|
-
url?: string
|
|
2328
|
+
partNumber?: number;
|
|
2329
|
+
url?: string;
|
|
2330
2330
|
}[] | undefined;
|
|
2331
|
-
expiresAt?: string
|
|
2331
|
+
expiresAt?: string;
|
|
2332
2332
|
} | undefined>;
|
|
2333
2333
|
/** Get an in-progress or completed import by id. */
|
|
2334
2334
|
get: (spaceId: string, importId: string) => Promise<{
|
|
2335
2335
|
import?: {
|
|
2336
|
-
id?: string
|
|
2337
|
-
name?: string
|
|
2338
|
-
status?: "uploading" | "finalizing" | "provisioning" | "complete" | "failed" | "expired"
|
|
2339
|
-
cubeId?: string | null
|
|
2340
|
-
error?: string | null
|
|
2341
|
-
createdAt?: string
|
|
2342
|
-
updatedAt?: string
|
|
2343
|
-
completedAt?: string | null
|
|
2336
|
+
id?: string;
|
|
2337
|
+
name?: string;
|
|
2338
|
+
status?: "uploading" | "finalizing" | "provisioning" | "complete" | "failed" | "expired";
|
|
2339
|
+
cubeId?: string | null;
|
|
2340
|
+
error?: string | null;
|
|
2341
|
+
createdAt?: string;
|
|
2342
|
+
updatedAt?: string;
|
|
2343
|
+
completedAt?: string | null;
|
|
2344
2344
|
} | undefined;
|
|
2345
2345
|
}>;
|
|
2346
2346
|
/**
|
|
@@ -2349,9 +2349,9 @@ declare class KrovaClient {
|
|
|
2349
2349
|
* `config`.
|
|
2350
2350
|
*/
|
|
2351
2351
|
complete: (spaceId: string, importId: string, body: NonNullable<paths["/spaces/{spaceId}/cubes/imports/{importId}/complete"]["post"]["requestBody"]>["content"]["application/json"]) => Promise<{
|
|
2352
|
-
importId?: string
|
|
2353
|
-
cubeId?: string
|
|
2354
|
-
status?: "provisioning"
|
|
2352
|
+
importId?: string;
|
|
2353
|
+
cubeId?: string;
|
|
2354
|
+
status?: "provisioning";
|
|
2355
2355
|
} | undefined>;
|
|
2356
2356
|
/** Cancel an in-progress import. */
|
|
2357
2357
|
cancel: (spaceId: string, importId: string) => Promise<{
|
|
@@ -2361,10 +2361,10 @@ declare class KrovaClient {
|
|
|
2361
2361
|
readonly backups: {
|
|
2362
2362
|
/** Get a time-limited download URL for a backup `.cube` archive. */
|
|
2363
2363
|
download: (spaceId: string, backupId: string) => Promise<{
|
|
2364
|
-
url?: string
|
|
2365
|
-
filename?: string
|
|
2366
|
-
sizeBytes?: number | null
|
|
2367
|
-
expiresAt?: string
|
|
2364
|
+
url?: string;
|
|
2365
|
+
filename?: string;
|
|
2366
|
+
sizeBytes?: number | null;
|
|
2367
|
+
expiresAt?: string;
|
|
2368
2368
|
} | undefined>;
|
|
2369
2369
|
};
|
|
2370
2370
|
readonly catalog: {
|
package/dist/index.d.ts
CHANGED
|
@@ -2320,27 +2320,27 @@ declare class KrovaClient {
|
|
|
2320
2320
|
* archive to those URLs, then call {@link imports.complete}.
|
|
2321
2321
|
*/
|
|
2322
2322
|
create: (spaceId: string, body: NonNullable<paths["/spaces/{spaceId}/cubes/imports"]["post"]["requestBody"]>["content"]["application/json"]) => Promise<{
|
|
2323
|
-
importId?: string
|
|
2324
|
-
uploadId?: string
|
|
2325
|
-
key?: string
|
|
2326
|
-
chunkSizeBytes?: number
|
|
2323
|
+
importId?: string;
|
|
2324
|
+
uploadId?: string;
|
|
2325
|
+
key?: string;
|
|
2326
|
+
chunkSizeBytes?: number;
|
|
2327
2327
|
parts?: {
|
|
2328
|
-
partNumber?: number
|
|
2329
|
-
url?: string
|
|
2328
|
+
partNumber?: number;
|
|
2329
|
+
url?: string;
|
|
2330
2330
|
}[] | undefined;
|
|
2331
|
-
expiresAt?: string
|
|
2331
|
+
expiresAt?: string;
|
|
2332
2332
|
} | undefined>;
|
|
2333
2333
|
/** Get an in-progress or completed import by id. */
|
|
2334
2334
|
get: (spaceId: string, importId: string) => Promise<{
|
|
2335
2335
|
import?: {
|
|
2336
|
-
id?: string
|
|
2337
|
-
name?: string
|
|
2338
|
-
status?: "uploading" | "finalizing" | "provisioning" | "complete" | "failed" | "expired"
|
|
2339
|
-
cubeId?: string | null
|
|
2340
|
-
error?: string | null
|
|
2341
|
-
createdAt?: string
|
|
2342
|
-
updatedAt?: string
|
|
2343
|
-
completedAt?: string | null
|
|
2336
|
+
id?: string;
|
|
2337
|
+
name?: string;
|
|
2338
|
+
status?: "uploading" | "finalizing" | "provisioning" | "complete" | "failed" | "expired";
|
|
2339
|
+
cubeId?: string | null;
|
|
2340
|
+
error?: string | null;
|
|
2341
|
+
createdAt?: string;
|
|
2342
|
+
updatedAt?: string;
|
|
2343
|
+
completedAt?: string | null;
|
|
2344
2344
|
} | undefined;
|
|
2345
2345
|
}>;
|
|
2346
2346
|
/**
|
|
@@ -2349,9 +2349,9 @@ declare class KrovaClient {
|
|
|
2349
2349
|
* `config`.
|
|
2350
2350
|
*/
|
|
2351
2351
|
complete: (spaceId: string, importId: string, body: NonNullable<paths["/spaces/{spaceId}/cubes/imports/{importId}/complete"]["post"]["requestBody"]>["content"]["application/json"]) => Promise<{
|
|
2352
|
-
importId?: string
|
|
2353
|
-
cubeId?: string
|
|
2354
|
-
status?: "provisioning"
|
|
2352
|
+
importId?: string;
|
|
2353
|
+
cubeId?: string;
|
|
2354
|
+
status?: "provisioning";
|
|
2355
2355
|
} | undefined>;
|
|
2356
2356
|
/** Cancel an in-progress import. */
|
|
2357
2357
|
cancel: (spaceId: string, importId: string) => Promise<{
|
|
@@ -2361,10 +2361,10 @@ declare class KrovaClient {
|
|
|
2361
2361
|
readonly backups: {
|
|
2362
2362
|
/** Get a time-limited download URL for a backup `.cube` archive. */
|
|
2363
2363
|
download: (spaceId: string, backupId: string) => Promise<{
|
|
2364
|
-
url?: string
|
|
2365
|
-
filename?: string
|
|
2366
|
-
sizeBytes?: number | null
|
|
2367
|
-
expiresAt?: string
|
|
2364
|
+
url?: string;
|
|
2365
|
+
filename?: string;
|
|
2366
|
+
sizeBytes?: number | null;
|
|
2367
|
+
expiresAt?: string;
|
|
2368
2368
|
} | undefined>;
|
|
2369
2369
|
};
|
|
2370
2370
|
readonly catalog: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krovacloud/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
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",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"openapi-typescript": "^7.13.0",
|
|
66
66
|
"tsdown": "0.22.14",
|
|
67
67
|
"tsx": "^4.23.12",
|
|
68
|
-
"typescript": "^
|
|
68
|
+
"typescript": "^7.0.2"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
71
|
"gen": "openapi-typescript openapi.json -o src/generated/types.ts",
|