@edgible-team/sdk
    Preparing search index...

    Class JobsClient

    Dispatch jobs to devices and track their lifecycle (see module doc).

    Index

    Constructors

    Methods

    • Get 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.

      Parameters

      Returns Promise<JobWithOutputAccess>

    • Return 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.

      Parameters

      Returns Promise<AnyJobOutput>

      ServerError JOB_OUTPUT_ABSENT if the job has no output at all (still running, or failed before producing one), and the JOB_OUTPUT_REFERENCE_* family for every way resolving a reference fails.