Skip to content

checkPublishStatus

checkPublishStatus(connection, jobId, requestTimeout?): () => Promise<StatusResult>

Defined in: checkPublishStatus.ts:44

Builds a PollingClient-compatible poll() function for a community publish job.

BackgroundOperation.FinishedAt (populated once the job reaches a terminal state) is used as the completion signal rather than matching specific Status picklist values, since that’s a reliable signal regardless of exact status wording. Error (populated on failure) determines success vs. failure once finished.

Connection

The org connection to poll against.

string

The jobId returned by POST /connect/communities/{id}/publish.

Duration = DEFAULT_PUBLISH_REQUEST_TIMEOUT

Bounds each status-check attempt. Defaults to DEFAULT_PUBLISH_REQUEST_TIMEOUT; overridable mainly so tests don’t have to wait out the real default.

A poll() function for PollingClient.create({ poll, ... }).

() => Promise<StatusResult>

CommunityPublishFailedError if the job reaches a terminal failure state.