From 6f0adcbae3d3098a8b0287236226e6438d8d7d46 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Wed, 3 Jan 2024 20:29:09 -0600 Subject: [PATCH] add types for cancelled and running jobs --- gui/src/types/api-v2.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gui/src/types/api-v2.ts b/gui/src/types/api-v2.ts index d7a993d7..875a84ee 100644 --- a/gui/src/types/api-v2.ts +++ b/gui/src/types/api-v2.ts @@ -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.