mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-21 10:15:04 +02:00
Add background print dispatching + tests
This commit is contained in:
@@ -1630,6 +1630,15 @@ export interface NotificationTestResponse {
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface BackgroundDispatchResponse {
|
||||
status: 'dispatched' | string;
|
||||
printer_id: number;
|
||||
archive_id?: number | null;
|
||||
filename: string;
|
||||
dispatch_job_id: number;
|
||||
dispatch_position: number;
|
||||
}
|
||||
|
||||
// Provider-specific config types for reference
|
||||
export interface CallMeBotConfig {
|
||||
phone: string;
|
||||
@@ -2937,6 +2946,7 @@ export const api = {
|
||||
printerId: number,
|
||||
options?: {
|
||||
plate_id?: number;
|
||||
plate_name?: string;
|
||||
ams_mapping?: number[];
|
||||
timelapse?: boolean;
|
||||
bed_levelling?: boolean;
|
||||
@@ -2946,7 +2956,7 @@ export const api = {
|
||||
use_ams?: boolean;
|
||||
}
|
||||
) =>
|
||||
request<{ status: string; printer_id: number; archive_id: number; filename: string }>(
|
||||
request<BackgroundDispatchResponse>(
|
||||
`/archives/${archiveId}/reprint?printer_id=${printerId}`,
|
||||
{
|
||||
method: 'POST',
|
||||
@@ -4008,6 +4018,7 @@ export const api = {
|
||||
printerId: number,
|
||||
options?: {
|
||||
plate_id?: number;
|
||||
plate_name?: string;
|
||||
ams_mapping?: number[];
|
||||
bed_levelling?: boolean;
|
||||
flow_cali?: boolean;
|
||||
@@ -4017,13 +4028,23 @@ export const api = {
|
||||
use_ams?: boolean;
|
||||
}
|
||||
) =>
|
||||
request<{ status: string; printer_id: number; archive_id: number; filename: string }>(
|
||||
request<BackgroundDispatchResponse>(
|
||||
`/library/files/${fileId}/print?printer_id=${printerId}`,
|
||||
{
|
||||
method: 'POST',
|
||||
body: options ? JSON.stringify(options) : undefined,
|
||||
}
|
||||
),
|
||||
cancelBackgroundDispatchJob: (jobId: number) =>
|
||||
request<{
|
||||
status: 'cancelled' | 'cancelling';
|
||||
job_id: number;
|
||||
source_name: string;
|
||||
printer_id: number;
|
||||
printer_name: string;
|
||||
}>(`/background-dispatch/${jobId}`, {
|
||||
method: 'DELETE',
|
||||
}),
|
||||
getLibraryFilePlates: (fileId: number) =>
|
||||
request<LibraryFilePlatesResponse>(`/library/files/${fileId}/plates`),
|
||||
getLibraryFileFilamentRequirements: (fileId: number, plateId?: number) =>
|
||||
|
||||
Reference in New Issue
Block a user