Skip to content

ScreenshotWorkerClient

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/packages/doc-automation/src/v2/stages/stage-12-screenshots/screenshot-worker.client.ts

Client for interacting with the screenshot-worker API

Methods

MethodSignatureReturns
submitBatchsubmitBatch(request: ScreenshotBatchRequest)Promise<BatchJobResponse>
getJobStatusgetJobStatus(jobId: string, organizationId: string)`Promise<BatchStatusResponse
waitForCompletionwaitForCompletion(jobId: string, organizationId: string, timeoutMs: number)Promise<BatchStatusResponse>

Where it refuses work

  • ScreenshotWorkerClient stops the work with Error when !response.ok, in 2 places.
  • ScreenshotWorkerClient stops the work with Error when status === null.
  • ScreenshotWorkerClient stops the work with an early return when response.status === 404.
  • ScreenshotWorkerClient stops the work with an early return when status.status === 'completed' || status.status === 'failed'.

Was this page helpful?

Download as PDF