u
This commit is contained in:
@@ -7,7 +7,6 @@ import * as printerDb from '../../../db/printer.js';
|
||||
import * as agentprinterDb from '../../../db/agentprinter.js';
|
||||
import * as labeltemplateDb from '../../../db/labeltemplate.js';
|
||||
import * as printerjobDb from '../../../db/printerjob.js';
|
||||
import { emit } from '../../sse.js';
|
||||
import { notifyAgentJob } from '../../agent/index.js';
|
||||
import { pngToZpl } from '../../../services/zplService.js';
|
||||
import { applyZplCopies } from '../zpljob.js';
|
||||
@@ -481,7 +480,6 @@ export function register(app, basePath = '') {
|
||||
notifyAgentJob(job.printeragentId, 'created', job);
|
||||
}
|
||||
|
||||
emit('printerjob', { companyId, data: { job } });
|
||||
return res.status(200).json({ success: true, printerjob: job });
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ export function register(app, basePath = '') {
|
||||
* | `printer` | `{}` | `POST /printer`, `PUT /printer/{id}`, `PATCH /printer/{id}`, `DELETE /printer/{id}` |
|
||||
* | `printeragent` | `{}` | `PUT /printeragent`, `PATCH /printeragent/{id}`, `DELETE /printeragent/{id}`, printer agent connect/disconnect/state |
|
||||
* | `agentprinter` | `{ printers }` or `{}` | `PATCH /agentprinter/{id}`, `PUT /agentprinter/order`, `DELETE /agentprinter/{id}`, agent state updates / printer discovery |
|
||||
* | `printerjob` | `{ job }` or `{ jobId, state }` | `POST /zpljob`, `POST /printerjob`, `POST /printerjob/{id}/cancel`, `DELETE /printerjob/{id}`, agent job state updates |
|
||||
* | `warehouse` | `{}` | `POST /warehouse`, `PUT /warehouse/{id}`, `PATCH /warehouse/{id}`, `DELETE /warehouse/{id}` |
|
||||
* | `supplier` | `{}` | `POST /supplier`, `PATCH /supplier/{id}`, `DELETE /supplier/{id}` |
|
||||
* | `vfs` | `{}` | VFS uploads and filesystem mutations such as `POST /vfs/upload`, `POST /vfs/mkdir`, `POST /vfs/rename`, `PUT /vfs/{*path}`, `DELETE /vfs/{*path}` |
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as printerjobDb from '../../db/printerjob.js';
|
||||
import { emit } from '../sse.js';
|
||||
import { notifyAgentJob } from '../agent/index.js';
|
||||
|
||||
// #region Helpers
|
||||
@@ -188,7 +187,6 @@ export function register(app, basePath = '') {
|
||||
* description: Creates a new print job for an agent printer. Notifies the agent in real time.
|
||||
* security:
|
||||
* - cookieAuth: []
|
||||
* x-signals: [printerjob]
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
@@ -249,7 +247,6 @@ export function register(app, basePath = '') {
|
||||
notifyAgentJob(job.printeragentId, 'created', job);
|
||||
}
|
||||
|
||||
emit('printerjob', { companyId: selected.companyId, data: { job } });
|
||||
res.status(201).json({ printerjob: job });
|
||||
} catch (error) {
|
||||
const status = printerjobErrorStatus(error);
|
||||
@@ -271,7 +268,6 @@ export function register(app, basePath = '') {
|
||||
* Notifies connected agents in real time.
|
||||
* security:
|
||||
* - cookieAuth: []
|
||||
* x-signals: [printerjob]
|
||||
* requestBody:
|
||||
* content:
|
||||
* application/json:
|
||||
@@ -318,7 +314,6 @@ export function register(app, basePath = '') {
|
||||
if (job.printeragentId) {
|
||||
notifyAgentJob(job.printeragentId, 'cancelled', job);
|
||||
}
|
||||
emit('printerjob', { companyId: selected.companyId, data: { job } });
|
||||
cancelledJobs.push(job);
|
||||
} catch (e) {
|
||||
console.error(`Failed to cancel printerjob #${j.id}:`, e);
|
||||
@@ -348,7 +343,6 @@ export function register(app, basePath = '') {
|
||||
* description: Marks a print job as cancelled and notifies the connected agent in real time.
|
||||
* security:
|
||||
* - cookieAuth: []
|
||||
* x-signals: [printerjob]
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: id
|
||||
@@ -388,7 +382,6 @@ export function register(app, basePath = '') {
|
||||
notifyAgentJob(job.printeragentId, 'cancelled', job);
|
||||
}
|
||||
|
||||
emit('printerjob', { companyId: selected.companyId, data: { job } });
|
||||
res.status(200).json({ success: true, printerjob: job });
|
||||
} catch (error) {
|
||||
const status = printerjobErrorStatus(error);
|
||||
@@ -410,7 +403,6 @@ export function register(app, basePath = '') {
|
||||
* event to the connected printer agent before deletion.
|
||||
* security:
|
||||
* - cookieAuth: []
|
||||
* x-signals: [printerjob]
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: id
|
||||
@@ -450,10 +442,6 @@ export function register(app, basePath = '') {
|
||||
notifyAgentJob(job.printeragentId, 'cancelled', job);
|
||||
}
|
||||
|
||||
emit('printerjob', {
|
||||
companyId: selected.companyId,
|
||||
data: { jobId: job.id, state: 'cancelled' },
|
||||
});
|
||||
res.status(200).json({ success: true, deletedJob: job });
|
||||
} catch (error) {
|
||||
const status = printerjobErrorStatus(error);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as printerjobDb from '../../db/printerjob.js';
|
||||
import { emit } from '../sse.js';
|
||||
import { notifyAgentJob } from '../agent/index.js';
|
||||
|
||||
// #region Helpers
|
||||
@@ -73,7 +72,6 @@ export function register(app, basePath = '') {
|
||||
* is automatically applied. The connected printer agent receives an immediate real-time event.
|
||||
* security:
|
||||
* - cookieAuth: []
|
||||
* x-signals: [printerjob]
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
@@ -162,7 +160,6 @@ export function register(app, basePath = '') {
|
||||
notifyAgentJob(job.printeragentId, 'created', job);
|
||||
}
|
||||
|
||||
emit('printerjob', { companyId: selected.companyId, data: { job } });
|
||||
res.status(201).json({ printerjob: job });
|
||||
} catch (error) {
|
||||
const status = printerjobErrorStatus(error);
|
||||
|
||||
Reference in New Issue
Block a user