sinfactura-types 1.8.4 → 1.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/print.d.ts +70 -0
- package/package.json +1 -1
package/dist/print.d.ts
CHANGED
|
@@ -23,5 +23,75 @@ declare global {
|
|
|
23
23
|
detail?: string;
|
|
24
24
|
errorCode?: string;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* One Cloud Print agent connection in `PrintAgentStatus.agents` (api#612).
|
|
28
|
+
*
|
|
29
|
+
* Every field except `online` comes from the agent's own last heartbeat, so
|
|
30
|
+
* all of them are absent on a connection that has never reported — a
|
|
31
|
+
* pre-heartbeat agent build holds a live socket and still receives jobs.
|
|
32
|
+
* Distinguish "absent because never reported" from "reported as empty".
|
|
33
|
+
*/
|
|
34
|
+
interface PrintAgentSummary {
|
|
35
|
+
/**
|
|
36
|
+
* Stable per-install id the agent mints on first run and reuses. The right
|
|
37
|
+
* handle for list keys and future per-agent actions. Absent on
|
|
38
|
+
* pre-heartbeat builds, so a UI needs a fallback label.
|
|
39
|
+
*/
|
|
40
|
+
agentId?: string;
|
|
41
|
+
/** This connection's own liveness — NOT the store-wide aggregate. */
|
|
42
|
+
online: boolean;
|
|
43
|
+
/** `lastHeartbeatAt`, ms epoch. */
|
|
44
|
+
lastSeen?: number;
|
|
45
|
+
agentVersion?: string;
|
|
46
|
+
/** `process.platform` — `'win32' | 'darwin' | 'linux'`. NOT a hostname. */
|
|
47
|
+
platform?: string;
|
|
48
|
+
/** Jobs waiting in this agent's local queue at its last heartbeat. */
|
|
49
|
+
queueDepth?: number;
|
|
50
|
+
memoryMB?: number;
|
|
51
|
+
/** Agent process uptime in seconds. */
|
|
52
|
+
uptime?: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* `GET /print?mode=agent-status` response payload (api#612).
|
|
56
|
+
*
|
|
57
|
+
* Agent-LEVEL connectivity — "is a Cloud Print agent reachable for this store
|
|
58
|
+
* right now" — as distinct from the job-level `PrintJobTransition` timeline
|
|
59
|
+
* above ("was this specific job printed"). Derived read-only from the
|
|
60
|
+
* heartbeat fields the WSS `heartbeat` action already writes onto the store's
|
|
61
|
+
* SOCKET connection row; there is no stored `PrintAgentStatus` entity.
|
|
62
|
+
*
|
|
63
|
+
* The top-level `online`/`lastSeen`/`agentVersion`/`queueDepth` fields
|
|
64
|
+
* describe the freshest LIVE agent and exist so a simple status badge doesn't
|
|
65
|
+
* have to walk `agents`. Anything per-agent (a fleet list, an "N of M
|
|
66
|
+
* connected" indicator) reads `agents`.
|
|
67
|
+
*/
|
|
68
|
+
interface PrintAgentStatus {
|
|
69
|
+
/**
|
|
70
|
+
* Derived, never stored: at least one printer connection for the store is
|
|
71
|
+
* live. Independent of the SOCKET row's own 3h reaper TTL, which governs
|
|
72
|
+
* row cleanup rather than agent responsiveness.
|
|
73
|
+
*/
|
|
74
|
+
online: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Freshest LIVE connection's `lastHeartbeatAt`, ms epoch. Absent when a
|
|
77
|
+
* printer is connected but has never reported (pre-heartbeat agent builds).
|
|
78
|
+
*/
|
|
79
|
+
lastSeen?: number;
|
|
80
|
+
/** Absent unless the agent reported it on its last heartbeat. */
|
|
81
|
+
agentVersion?: string;
|
|
82
|
+
/** Jobs waiting in the agent's local queue, as of the last heartbeat. */
|
|
83
|
+
queueDepth?: number;
|
|
84
|
+
/** Count of entries in `agents` with `online: true`. */
|
|
85
|
+
onlineCount: number;
|
|
86
|
+
/**
|
|
87
|
+
* Every printer connection currently registered for the store, live or
|
|
88
|
+
* stale. ⚠️ This is CONNECTED agents, not INSTALLED ones: an agent that was
|
|
89
|
+
* never started, or whose socket row has been reaped (3h TTL), is invisible
|
|
90
|
+
* here. So `onlineCount` of `agents.length` answers "of the agents we can
|
|
91
|
+
* see, how many are live" — it cannot answer "are all my configured agents
|
|
92
|
+
* running".
|
|
93
|
+
*/
|
|
94
|
+
agents: PrintAgentSummary[];
|
|
95
|
+
}
|
|
26
96
|
}
|
|
27
97
|
export {};
|