mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
make all fields optional but nonnullable
This commit is contained in:
@@ -46,11 +46,6 @@ function makeTask(
|
|||||||
const job: JobListItem = {
|
const job: JobListItem = {
|
||||||
id,
|
id,
|
||||||
priority,
|
priority,
|
||||||
execution_start_time: null,
|
|
||||||
execution_end_time: null,
|
|
||||||
preview_output: null,
|
|
||||||
outputs_count: null,
|
|
||||||
workflow_id: null,
|
|
||||||
...overrides
|
...overrides
|
||||||
}
|
}
|
||||||
return new TaskItemImpl(job)
|
return new TaskItemImpl(job)
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ const zExecutionError = z
|
|||||||
exception_message: z.string(),
|
exception_message: z.string(),
|
||||||
exception_type: z.string(),
|
exception_type: z.string(),
|
||||||
traceback: z.array(z.string()),
|
traceback: z.array(z.string()),
|
||||||
current_inputs: z.unknown(),
|
current_inputs: z.record(z.string(), z.unknown()),
|
||||||
current_outputs: z.unknown()
|
current_outputs: z.record(z.string(), z.unknown())
|
||||||
})
|
})
|
||||||
.passthrough()
|
.passthrough()
|
||||||
|
|
||||||
@@ -53,12 +53,12 @@ const zRawJobListItem = z
|
|||||||
id: z.string(),
|
id: z.string(),
|
||||||
status: zJobStatus,
|
status: zJobStatus,
|
||||||
create_time: z.number(),
|
create_time: z.number(),
|
||||||
execution_start_time: z.number().nullable(),
|
execution_start_time: z.number().optional(),
|
||||||
execution_end_time: z.number().nullable(),
|
execution_end_time: z.number().optional(),
|
||||||
preview_output: zPreviewOutput.nullable(),
|
preview_output: zPreviewOutput.optional(),
|
||||||
outputs_count: z.number().nullable(),
|
outputs_count: z.number().optional(),
|
||||||
execution_error: zExecutionError.optional(),
|
execution_error: zExecutionError.optional(),
|
||||||
workflow_id: z.string().nullable(),
|
workflow_id: z.string().optional(),
|
||||||
priority: z.number().optional()
|
priority: z.number().optional()
|
||||||
})
|
})
|
||||||
.passthrough()
|
.passthrough()
|
||||||
|
|||||||
@@ -26,11 +26,7 @@ const createMockJob = (id: string, outputsCount = 1): JobListItem => ({
|
|||||||
id,
|
id,
|
||||||
status: 'completed',
|
status: 'completed',
|
||||||
create_time: Date.now(),
|
create_time: Date.now(),
|
||||||
execution_start_time: null,
|
|
||||||
execution_end_time: null,
|
|
||||||
preview_output: null,
|
|
||||||
outputs_count: outputsCount,
|
outputs_count: outputsCount,
|
||||||
workflow_id: null,
|
|
||||||
priority: 0
|
priority: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,6 @@ function createJob(id: string, createTime = 0, priority?: number): JobListItem {
|
|||||||
id,
|
id,
|
||||||
status: 'completed',
|
status: 'completed',
|
||||||
create_time: createTime,
|
create_time: createTime,
|
||||||
execution_start_time: null,
|
|
||||||
execution_end_time: null,
|
|
||||||
preview_output: null,
|
|
||||||
outputs_count: null,
|
|
||||||
workflow_id: null,
|
|
||||||
priority: priority ?? createTime
|
priority: priority ?? createTime
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,11 +23,6 @@ function createMockJob(
|
|||||||
id,
|
id,
|
||||||
status,
|
status,
|
||||||
create_time: Date.now(),
|
create_time: Date.now(),
|
||||||
execution_start_time: null,
|
|
||||||
execution_end_time: null,
|
|
||||||
preview_output: null,
|
|
||||||
outputs_count: 0,
|
|
||||||
workflow_id: null,
|
|
||||||
...overrides
|
...overrides
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,15 +95,11 @@ describe('assetsStore - Refactored (Option A)', () => {
|
|||||||
id: `prompt_${index}`,
|
id: `prompt_${index}`,
|
||||||
status: 'completed',
|
status: 'completed',
|
||||||
create_time: 1000 + index,
|
create_time: 1000 + index,
|
||||||
execution_start_time: null,
|
|
||||||
execution_end_time: null,
|
|
||||||
preview_output: {
|
preview_output: {
|
||||||
filename: `output_${index}.png`,
|
filename: `output_${index}.png`,
|
||||||
subfolder: '',
|
subfolder: '',
|
||||||
type: 'output'
|
type: 'output'
|
||||||
},
|
},
|
||||||
outputs_count: null,
|
|
||||||
workflow_id: null,
|
|
||||||
priority: 1000 + index
|
priority: 1000 + index
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -17,11 +17,6 @@ function createJob(
|
|||||||
id,
|
id,
|
||||||
status,
|
status,
|
||||||
create_time: createTime,
|
create_time: createTime,
|
||||||
execution_start_time: null,
|
|
||||||
execution_end_time: null,
|
|
||||||
preview_output: null,
|
|
||||||
outputs_count: null,
|
|
||||||
workflow_id: null,
|
|
||||||
priority: priority ?? createTime
|
priority: priority ?? createTime
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,11 +35,6 @@ const mockJobDetail = {
|
|||||||
id: 'test-prompt-id',
|
id: 'test-prompt-id',
|
||||||
status: 'completed' as const,
|
status: 'completed' as const,
|
||||||
create_time: Date.now(),
|
create_time: Date.now(),
|
||||||
execution_start_time: null,
|
|
||||||
execution_end_time: null,
|
|
||||||
preview_output: null,
|
|
||||||
outputs_count: null,
|
|
||||||
workflow_id: null,
|
|
||||||
workflow: {
|
workflow: {
|
||||||
extra_data: {
|
extra_data: {
|
||||||
extra_pnginfo: {
|
extra_pnginfo: {
|
||||||
@@ -58,11 +53,6 @@ function createHistoryJob(id: string): JobListItem {
|
|||||||
id,
|
id,
|
||||||
status: 'completed',
|
status: 'completed',
|
||||||
create_time: now,
|
create_time: now,
|
||||||
execution_start_time: null,
|
|
||||||
execution_end_time: null,
|
|
||||||
preview_output: null,
|
|
||||||
outputs_count: null,
|
|
||||||
workflow_id: null,
|
|
||||||
priority: now
|
priority: now
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -73,11 +63,6 @@ function createRunningJob(id: string): JobListItem {
|
|||||||
id,
|
id,
|
||||||
status: 'in_progress',
|
status: 'in_progress',
|
||||||
create_time: now,
|
create_time: now,
|
||||||
execution_start_time: null,
|
|
||||||
execution_end_time: null,
|
|
||||||
preview_output: null,
|
|
||||||
outputs_count: null,
|
|
||||||
workflow_id: null,
|
|
||||||
priority: now
|
priority: now
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user