1
0
Fork 0

add types for cancelled and running jobs

This commit is contained in:
Sean Sube 2024-01-03 20:29:09 -06:00
parent 492bc1e992
commit 6f0adcbae3
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 15 additions and 2 deletions

View File

@ -60,14 +60,22 @@ export interface BaseJobResponse {
tiles: Progress;
}
export interface CancelledJobResponse extends BaseJobResponse {
status: JobStatus.CANCELLED;
}
/**
* Pending image job.
*/
export interface PendingJobResponse extends BaseJobResponse {
status: JobStatus.PENDING | JobStatus.RUNNING;
status: JobStatus.PENDING;
queue: Progress;
}
export interface RunningJobResponse extends BaseJobResponse {
status: JobStatus.RUNNING;
}
/**
* Failed image job with error information.
*/
@ -144,7 +152,12 @@ export type SuccessJobResponse
| SuccessBlendJobResponse
| SuccessChainJobResponse;
export type JobResponse = PendingJobResponse | FailedJobResponse | SuccessJobResponse;
export type JobResponse
= CancelledJobResponse
| PendingJobResponse
| RunningJobResponse
| FailedJobResponse
| SuccessJobResponse;
/**
* Status response from the job endpoint, with parameters to retry the job if it fails.