downloadJobOutput is the Node-only large-output fetcher supplied by the
platform defaults (absent in the browser build — see
JobOutputDownloader). Optional so a caller constructing the client
directly keeps the one-argument form; resolveOutputReference then
fails loudly rather than silently.
OptionaldownloadJobOutput: JobOutputDownloaderCancel a pending/sent job. 400s if the job already reached a terminal state.
Optionalopts: RequestOptionsDispatch a job to a device. Async by default (202) — poll get
for completion. With fulfillImmediately: true the call blocks until
the job finishes and the result includes output.
Optionalopts: RequestOptionsGet a job's status and result. This is the natural poll target for a
job waiter: poll until status reaches a terminal state ('completed',
'failed', 'timeout', 'cancelled') and read output/error.
Throws NotFoundError if the job does not exist.
Returns JobWithOutputAccess: this route is the one that enriches a
reference-shaped output with a presigned outputDownloadUrl, and surfacing
that is what lets a browser hand the user a download link for an output it
cannot itself fetch and hash. The reference stays on the row alongside it —
the URL is an addition, never a substitution.
Optionalopts: RequestOptionsList jobs in an organization, optionally filtered by device/status.
Backend pagination (nextKey/startKey) is not surfaced yet; raise
limit if the default page (50) is too small.
Optionalopts: RequestOptionsReturn a job's output with any JobOutputReference resolved into the
payload it points at — the generic counterpart to the diagnostics-specific
resolution in devices.collectDiagnostics.
An INLINE output passes straight through, untouched and without a single
extra request, so a caller can hand every job through this method and render
one code path. A reference output is re-read (GET /jobs/{jobId} mints the
presigned URL — the job passed in may carry a stale one, or none at all
because POST /jobs returns the stored output verbatim), downloaded through
the injected seam, and verified against BOTH the byte count and the SHA-256
the device posted before it is parsed.
The resolved value is typed AnyJobOutput because the uploaded object is by
construction the SAME envelope the device would have posted inline — a
plugin job's reference resolves to a PluginJobOutput, a
collect_diagnostics one to a CollectDiagnosticsOutput. This method
asserts only that it is a JSON object; narrow it with the guard for the job
type you dispatched (e.g. isPluginJobOutput).
Node only. The hash check needs node:crypto and the job-outputs bucket
carries no CORS, so the browser build wires no downloader and this raises
JOB_OUTPUT_REFERENCE_UNSUPPORTED rather than degrading — a browser should
link the user at outputDownloadUrl from get instead of fetching.
Optionalopts: RequestOptions
Dispatch jobs to devices and track their lifecycle (see module doc).