|
@@ -6402,11 +6402,8 @@ export const api = {
|
|
|
request<SlicerSettingDeleteResponse>(`/cloud/settings/${settingId}`, {
|
|
request<SlicerSettingDeleteResponse>(`/cloud/settings/${settingId}`, {
|
|
|
method: 'DELETE',
|
|
method: 'DELETE',
|
|
|
}),
|
|
}),
|
|
|
- getCloudDevices: () => request<CloudDevice[]>('/cloud/devices'),
|
|
|
|
|
getCloudFields: (presetType: 'filament' | 'print' | 'process' | 'printer') =>
|
|
getCloudFields: (presetType: 'filament' | 'print' | 'process' | 'printer') =>
|
|
|
request<FieldDefinitionsResponse>(`/cloud/fields/${presetType}`),
|
|
request<FieldDefinitionsResponse>(`/cloud/fields/${presetType}`),
|
|
|
- getAllCloudFields: () =>
|
|
|
|
|
- request<Record<string, FieldDefinitionsResponse>>('/cloud/fields'),
|
|
|
|
|
getFilamentInfo: (settingIds: string[]) =>
|
|
getFilamentInfo: (settingIds: string[]) =>
|
|
|
request<Record<string, { name: string; k: number | null }>>('/cloud/filament-info', {
|
|
request<Record<string, { name: string; k: number | null }>>('/cloud/filament-info', {
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
@@ -6516,7 +6513,6 @@ export const api = {
|
|
|
if (targetModel) params.set('target_model', targetModel);
|
|
if (targetModel) params.set('target_model', targetModel);
|
|
|
return request<PrintQueueItem[]>(`/queue/?${params}`);
|
|
return request<PrintQueueItem[]>(`/queue/?${params}`);
|
|
|
},
|
|
},
|
|
|
- getQueueItem: (id: number) => request<PrintQueueItem>(`/queue/${id}`),
|
|
|
|
|
addToQueue: (data: PrintQueueItemCreate) =>
|
|
addToQueue: (data: PrintQueueItemCreate) =>
|
|
|
request<PrintQueueItem>('/queue/', {
|
|
request<PrintQueueItem>('/queue/', {
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
@@ -6578,7 +6574,6 @@ export const api = {
|
|
|
const params = status ? `?status=${status}` : '';
|
|
const params = status ? `?status=${status}` : '';
|
|
|
return request<PrintBatch[]>(`/queue/batches${params}`);
|
|
return request<PrintBatch[]>(`/queue/batches${params}`);
|
|
|
},
|
|
},
|
|
|
- getBatch: (id: number) => request<PrintBatch>(`/queue/batches/${id}`),
|
|
|
|
|
cancelBatch: (id: number) =>
|
|
cancelBatch: (id: number) =>
|
|
|
request<{ message: string }>(`/queue/batches/${id}`, { method: 'DELETE' }),
|
|
request<{ message: string }>(`/queue/batches/${id}`, { method: 'DELETE' }),
|
|
|
createBatch: (data: PrintBatchCreate) =>
|
|
createBatch: (data: PrintBatchCreate) =>
|
|
@@ -6586,11 +6581,6 @@ export const api = {
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
body: JSON.stringify(data),
|
|
body: JSON.stringify(data),
|
|
|
}),
|
|
}),
|
|
|
- updateBatch: (id: number, data: PrintBatchUpdate) =>
|
|
|
|
|
- request<PrintBatch>(`/queue/batches/${id}`, {
|
|
|
|
|
- method: 'PATCH',
|
|
|
|
|
- body: JSON.stringify(data),
|
|
|
|
|
- }),
|
|
|
|
|
dispatchBatch: (id: number, data: PrintBatchDispatchRequest = {}) =>
|
|
dispatchBatch: (id: number, data: PrintBatchDispatchRequest = {}) =>
|
|
|
request<PrintBatch>(`/queue/batches/${id}/dispatch`, {
|
|
request<PrintBatch>(`/queue/batches/${id}/dispatch`, {
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
@@ -7469,8 +7459,6 @@ export const api = {
|
|
|
withStreamToken(`${API_BASE}/printers/${printerId}/camera/stream?fps=${fps}`),
|
|
withStreamToken(`${API_BASE}/printers/${printerId}/camera/stream?fps=${fps}`),
|
|
|
getCameraSnapshotUrl: (printerId: number) =>
|
|
getCameraSnapshotUrl: (printerId: number) =>
|
|
|
withStreamToken(`${API_BASE}/printers/${printerId}/camera/snapshot`),
|
|
withStreamToken(`${API_BASE}/printers/${printerId}/camera/snapshot`),
|
|
|
- testCameraConnection: (printerId: number) =>
|
|
|
|
|
- request<{ success: boolean; message?: string; error?: string }>(`/printers/${printerId}/camera/test`),
|
|
|
|
|
getCameraStatus: (printerId: number) =>
|
|
getCameraStatus: (printerId: number) =>
|
|
|
request<{ active: boolean; stalled: boolean }>(`/printers/${printerId}/camera/status`),
|
|
request<{ active: boolean; stalled: boolean }>(`/printers/${printerId}/camera/status`),
|
|
|
diagnoseCamera: (printerId: number) =>
|
|
diagnoseCamera: (printerId: number) =>
|
|
@@ -7501,11 +7489,6 @@ export const api = {
|
|
|
`/printers/${printerId}/camera/check-plate?${params.toString()}`
|
|
`/printers/${printerId}/camera/check-plate?${params.toString()}`
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
- getPlateDetectionStatus: (printerId: number) => {
|
|
|
|
|
- return request<PlateDetectionStatus & { chamber_light?: boolean }>(
|
|
|
|
|
- `/printers/${printerId}/camera/plate-detection/status`
|
|
|
|
|
- );
|
|
|
|
|
- },
|
|
|
|
|
calibratePlateDetection: (printerId: number, options?: { label?: string; useExternal?: boolean }) => {
|
|
calibratePlateDetection: (printerId: number, options?: { label?: string; useExternal?: boolean }) => {
|
|
|
const params = new URLSearchParams();
|
|
const params = new URLSearchParams();
|
|
|
if (options?.label) params.set('label', options.label);
|
|
if (options?.label) params.set('label', options.label);
|
|
@@ -7517,12 +7500,6 @@ export const api = {
|
|
|
{ method: 'POST' }
|
|
{ method: 'POST' }
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
- deletePlateCalibration: (printerId: number) => {
|
|
|
|
|
- return request<CalibrationResult>(
|
|
|
|
|
- `/printers/${printerId}/camera/plate-detection/calibrate`,
|
|
|
|
|
- { method: 'DELETE' }
|
|
|
|
|
- );
|
|
|
|
|
- },
|
|
|
|
|
getPlateReferences: (printerId: number) => {
|
|
getPlateReferences: (printerId: number) => {
|
|
|
return request<{
|
|
return request<{
|
|
|
references: PlateReference[];
|
|
references: PlateReference[];
|
|
@@ -8416,8 +8393,6 @@ export const api = {
|
|
|
// Local Presets (OrcaSlicer imports)
|
|
// Local Presets (OrcaSlicer imports)
|
|
|
getLocalPresets: () =>
|
|
getLocalPresets: () =>
|
|
|
request<LocalPresetsResponse>('/local-presets/'),
|
|
request<LocalPresetsResponse>('/local-presets/'),
|
|
|
- getLocalPresetDetail: (id: number) =>
|
|
|
|
|
- request<LocalPresetDetail>(`/local-presets/${id}`),
|
|
|
|
|
importLocalPresets: (formData: FormData) =>
|
|
importLocalPresets: (formData: FormData) =>
|
|
|
fetch(`${API_BASE}/local-presets/import`, {
|
|
fetch(`${API_BASE}/local-presets/import`, {
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
@@ -8430,20 +8405,8 @@ export const api = {
|
|
|
}
|
|
}
|
|
|
return res.json() as Promise<ImportResponse>;
|
|
return res.json() as Promise<ImportResponse>;
|
|
|
}),
|
|
}),
|
|
|
- createLocalPreset: (data: { name: string; preset_type: string; setting: Record<string, unknown> }) =>
|
|
|
|
|
- request<LocalPreset>('/local-presets/', {
|
|
|
|
|
- method: 'POST',
|
|
|
|
|
- body: JSON.stringify(data),
|
|
|
|
|
- }),
|
|
|
|
|
- updateLocalPreset: (id: number, data: { name?: string; setting?: Record<string, unknown> }) =>
|
|
|
|
|
- request<LocalPreset>(`/local-presets/${id}`, {
|
|
|
|
|
- method: 'PUT',
|
|
|
|
|
- body: JSON.stringify(data),
|
|
|
|
|
- }),
|
|
|
|
|
deleteLocalPreset: (id: number) =>
|
|
deleteLocalPreset: (id: number) =>
|
|
|
request<{ success: boolean }>(`/local-presets/${id}`, { method: 'DELETE' }),
|
|
request<{ success: boolean }>(`/local-presets/${id}`, { method: 'DELETE' }),
|
|
|
- refreshBaseProfileCache: () =>
|
|
|
|
|
- request<{ refreshed: number; failed: number; total: number }>('/local-presets/base-cache/refresh', { method: 'POST' }),
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// AMS History types
|
|
// AMS History types
|