feat(nodejs): pause and resume jobs from the TypeScript SDK (#4113)

Companion to #4112: `pauseJob` and `resumeJob` on `Connection`, posting
to the server's `/v1/jobs/pause` and `/v1/jobs/resume` endpoints. A
pause parks the job until it is resumed: its workers drain and stop, and
a resume re-queues it to pick work back up from checkpoints.

The outcome strings mirror the server's answers — `"pausing"`,
`"already_paused"`, or `"committing"` (a job finalizing its results
cannot be parked; retry shortly), and `"resumed"`, `"still_pausing"`, or
`"not_paused"` — so a caller can retry the transient refusals rather
than treat them as failures.

Stacked on #4112 (shares the Rust core change); draft until the
server-side endpoints reach production.
This commit is contained in:
Wyatt Alt
2026-09-24 02:35:03 +08:00
committed by GitHub
parent 1fc72427e3
commit 2ebd6142e4
4 changed files with 119 additions and 0 deletions
+44
View File
@@ -798,6 +798,28 @@ abstract openTable(
***
### pauseJob()
```ts
abstract pauseJob(jobId): Promise<string>
```
Pause a server-side job by id.
The job's workers drain and it stays parked until resumed. Resolves to
"pausing", "already_paused", or "committing" -- a job finalizing its
results cannot be parked; retry shortly.
#### Parameters
* **jobId**: `string`
#### Returns
`Promise`&lt;`string`&gt;
***
### renameTable()
```ts
@@ -831,6 +853,28 @@ a "not supported" error.
***
### resumeJob()
```ts
abstract resumeJob(jobId): Promise<string>
```
Resume a paused server-side job by id.
Its workers pick their work back up from checkpoints. Resolves to
"resumed", "still_pausing" -- the pause's worker drain is not confirmed
yet; retry shortly -- or "not_paused".
#### Parameters
* **jobId**: `string`
#### Returns
`Promise`&lt;`string`&gt;
***
### ~~tableNames()~~
#### tableNames(options)