@warmhub/sdk-ts 0.120.0

Historical changelog shipped with this version. It may include earlier releases.

Changelog — @warmhub/sdk-ts

0.120.0

Repository export v3.

Breaking

Checkpoint generation is retired — take an export instead

What it was. Producing a fresh snapshot of a repository meant asking the server to mint a checkpoint, polling until the job completed, requesting a short-lived signed URL for the archive, downloading it outside the SDK, and verifying the bytes locally.

What it is now. One call that streams verified rows, with the header, per-row canonical decode, ordering and trailer checks applied as the bytes arrive. There is no job to start, no state to poll, and no separate verify step — a row that reaches you has already been proven.

Migration.

Before:

import { createReadStream } from 'node:fs'
import { writeFile } from 'node:fs/promises'
import { Readable } from 'node:stream'
import { verifyRepositoryCheckpointArchive } from '@warmhub/sdk-ts/checkpoint'

let status = await client.repo.checkpoint.generate('acme', 'catalog')
while (status.state !== 'complete') {
  await new Promise((resolve) => setTimeout(resolve, 1_000))
  status = await client.repo.checkpoint.status('acme', 'catalog', {
    checkpointId: status.checkpointId,
  })
}

const access = await client.repo.checkpoint.getAccess('acme', 'catalog', {
  checkpoint: 'latest',
  artifact: 'archive',
})
// Signed URL: fetched WITHOUT the WarmHub bearer token.
const archive = await fetch(access.url)
await writeFile('catalog.zip', Readable.fromWeb(archive.body))
await verifyRepositoryCheckpointArchive(createReadStream('catalog.zip'))

After:

for await (const row of client.repo.export('acme', 'catalog')) {
  console.log(row.kind, row.durableId, row.version)
}

If you were relying on generate returning before the download — starting the build in one process and fetching it in another, or on another machine — that shape survives as the async token flow:

// Process A: ask for it, get a token, do not read a byte.
const prepared = await client.repo.exportPrepare('acme', 'catalog')
console.log(prepared.exportToken, prepared.atRepoSeq)

// Process B: redeem it. `export` polls while the fold is still running.
for await (const row of client.repo.export('acme', 'catalog', {
  token: prepared.exportToken,
})) {
  // ...
}

The token is redeemable only at that repository's URL, by a principal holding checkpoint read there.

Why. Export format v3 replaces checkpoint generation outright; the whole generation pipeline is deleted server-side (PR #10020).

client.repo.checkpoint.generate and .retry are gone

What it was. generate(orgName, repoName, { atLeastRepoSeq }) minted a checkpoint; retry(orgName, repoName, checkpointId) re-ran a failed one. Both returned a RepositoryCheckpointStatus.

What it is now. Neither method exists, and the tRPC procedures behind them (repo.checkpoint.generate, repo.checkpoint.retry) are no longer served. The repo:checkpoint-generate scope no longer buys anything.

Migration. Replace both with client.repo.export.

Before:

const fresh = await client.repo.checkpoint.generate('acme', 'catalog', {
  atLeastRepoSeq: 42,
})
const recovered = await client.repo.checkpoint.retry(
  'acme',
  'catalog',
  failed.checkpointId,
)

After:

// `atRepoSeq` pins the fence the way `atLeastRepoSeq` asked for a floor.
// Omit it and the server pins current and echoes it back in the header.
for await (const row of client.repo.export('acme', 'catalog', {
  atRepoSeq: 42,
})) {
  // ...
}

There is no retry to replace: an export is a read, so a failed one is re-read, not re-queued.

Why. Same retirement (PR #10020).

Failed checkpoint statuses now all answer nextAction: 'none'

What it was. RepositoryCheckpointStatus carried nextAction: 'retry' for deadline_exceeded and attempts_exhausted, and nextAction: 'generate' for invalid_source. Each named a procedure a reader could call.

What it is now. Those three failure codes join repository_deleted in a single variant with nextAction: 'none'. The 'retry' and 'generate' members are gone from the union, so a switch over nextAction that had cases for them will no longer typecheck against them.

Migration.

Before:

if (status.state === 'failed') {
  switch (status.nextAction) {
    case 'retry':
      await client.repo.checkpoint.retry('acme', 'catalog', status.checkpointId)
      break
    case 'generate':
      await client.repo.checkpoint.generate('acme', 'catalog')
      break
    case 'contact_support':
      report(status.checkpointId, status.failureCode)
      break
  }
}

After:

if (status.state === 'failed') {
  if (status.nextAction === 'contact_support') {
    report(status.checkpointId, status.failureCode)
  } else {
    // Terminal. Take an export instead of trying to revive the checkpoint.
    for await (const row of client.repo.export('acme', 'catalog')) {
      // ...
    }
  }
}

Why. Each retired value pointed at a route the server no longer serves; leaving them in the vocabulary would send readers to a 404 (PR #10020).

Added

Behavior worth knowing

Still supported

The checkpoint read plane is untouched: client.repo.checkpoint.status, .latest, .getAccess, and verifyRepositoryCheckpointArchive from @warmhub/sdk-ts/checkpoint all continue to work against archives already in object storage. Nothing mints new ones.

Deprecation horizon: those read surfaces are supported until the announced cleanup, 30 days after GA. Their removal is a separately-filed post-GA change. Move download-and-verify workflows to client.repo.export before then.