@krovacloud/sdk 0.4.0 → 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 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`.