@gohcltech/edge-print-client 2.0.70-develop → 2.0.71-develop
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/README.md +26 -7
- package/dist/edge-print.d.ts +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,6 +124,22 @@ Each `PrinterInfo` object includes:
|
|
|
124
124
|
| `orientations` | `string[]?` | Supported orientations (e.g. `["portrait", "landscape"]`) |
|
|
125
125
|
| `virtualPrinter` | `boolean?` | `true` for Developer (virtual) printers injected by the agent |
|
|
126
126
|
|
|
127
|
+
**On `paperSize`, `tray` and `mediaType`.** A value the printer does not
|
|
128
|
+
recognise now rejects the job rather than printing on the driver's default —
|
|
129
|
+
the substitution this release exists to remove. Three things soften it:
|
|
130
|
+
|
|
131
|
+
- **Only when the printer actually said.** If `papers`, `trays` or `mediaTypes`
|
|
132
|
+
is absent, the agent could not determine that capability and accepts whatever
|
|
133
|
+
you ask, with a `capability_unverified` warning on the response. Many printers
|
|
134
|
+
report nothing at all, so this is the common case.
|
|
135
|
+
- **Matching ignores case.** `"letter"` is accepted for `"Letter"`.
|
|
136
|
+
- **The rejection tells you what would work.** `unsupported_value` carries
|
|
137
|
+
`field` and a `supported` array of the printer's real values.
|
|
138
|
+
|
|
139
|
+
`paperSize` and `tray` are only checked on paths that can apply them; `raw`,
|
|
140
|
+
`html` and network targets never did, so they are left alone rather than
|
|
141
|
+
starting to fail.
|
|
142
|
+
|
|
127
143
|
**On `mediaTypes`.** The field is usually absent. Of eleven drivers surveyed,
|
|
128
144
|
eight listed no stock types at all, and a ninth listed them only under a
|
|
129
145
|
vendor-private key whose values are the driver's internal codes rather than
|
|
@@ -233,8 +249,8 @@ Two limits worth knowing before you build on this:
|
|
|
233
249
|
| `orientation` | `'portrait' \| 'landscape'?` | Page orientation |
|
|
234
250
|
| `jobName` | `string?` | Name shown in the OS print queue |
|
|
235
251
|
| `colorType` | `'color' \| 'grayscale' \| 'black-white'?` | Color mode |
|
|
236
|
-
| `paperSize` | `string?` | Paper size from `PrinterInfo.papers` (e.g. `"Letter"`) |
|
|
237
|
-
| `tray` | `string?` | Tray name from `TrayInfo.name` (e.g. `"Tray 1"`) |
|
|
252
|
+
| `paperSize` | `string?` | Paper size from `PrinterInfo.papers` (e.g. `"Letter"`). Rejects if the printer lists paper sizes and this is not one — see below |
|
|
253
|
+
| `tray` | `string?` | Tray name from `TrayInfo.name` (e.g. `"Tray 1"`). Rejects if the printer lists trays and this is not one — see below |
|
|
238
254
|
| `mediaType` | `string?` | Stock type from `PrinterInfo.mediaTypes` (e.g. `"Bond"`). Rejected for `raw`/`html` content and network targets |
|
|
239
255
|
|
|
240
256
|
**`data`** — `PrintData[]`
|
|
@@ -420,11 +436,14 @@ The four codes in the table above are never accepted *from* the agent. A frame
|
|
|
420
436
|
claiming `code: "timeout"` is read as `unknown`, so a failure the agent
|
|
421
437
|
considers final cannot arrive labelled retryable.
|
|
422
438
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
439
|
+
`unsupported_value` is raised when `paperSize`, `tray` or `mediaType` names a
|
|
440
|
+
value the printer does not list, and it is the one code that populates
|
|
441
|
+
`supported` — read that array rather than parsing the message, and offer the
|
|
442
|
+
values it names.
|
|
443
|
+
|
|
444
|
+
Two more are still **reserved**: `content_overflow` and `encrypted_pdf` are part
|
|
445
|
+
of the closed set and typed here, so code written today handles them, but no
|
|
446
|
+
agent sends them yet.
|
|
428
447
|
|
|
429
448
|
And `unknown`, the fallback for a code this client does not recognise — which
|
|
430
449
|
is what lets a client built today keep working against a future agent. Treat an
|
package/dist/edge-print.d.ts
CHANGED
|
@@ -58,12 +58,22 @@ export interface PrintConfig {
|
|
|
58
58
|
/**
|
|
59
59
|
* Paper size, exactly as returned by {@link PrinterInfo.papers}
|
|
60
60
|
* (e.g. `"Letter"`, `"A4"`). Omit to use the printer's current default.
|
|
61
|
+
*
|
|
62
|
+
* Rejects with `unsupported_value` when the printer lists paper sizes and
|
|
63
|
+
* this is not one of them — the error's `supported` array names the real
|
|
64
|
+
* ones. A printer that lists none accepts anything, with a
|
|
65
|
+
* `capability_unverified` warning. Matching ignores case.
|
|
61
66
|
*/
|
|
62
67
|
paperSize?: string;
|
|
63
68
|
/**
|
|
64
69
|
* Input tray, exactly as returned by {@link TrayInfo.name} inside
|
|
65
70
|
* {@link PrinterInfo.trays} (e.g. `"Tray 1"`, `"Auto"`).
|
|
66
71
|
* Omit to use the printer's current default.
|
|
72
|
+
*
|
|
73
|
+
* Rejects with `unsupported_value` when the printer lists trays and this is
|
|
74
|
+
* not one of them — the error's `supported` array names the real ones. A
|
|
75
|
+
* printer that lists none accepts anything, with a `capability_unverified`
|
|
76
|
+
* warning. Matching ignores case.
|
|
67
77
|
*/
|
|
68
78
|
tray?: string;
|
|
69
79
|
/**
|