@poe-platform/safe-bash 0.1.710 → 0.1.712

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.
Files changed (60) hide show
  1. package/README.md +21 -1
  2. package/dist/safe-bash/commands/fmt/index.d.ts +2 -0
  3. package/dist/safe-bash/commands/fmt/index.d.ts.map +1 -0
  4. package/dist/safe-bash/commands/fmt/index.js +2 -0
  5. package/dist/safe-bash/commands/fmt/index.js.map +1 -0
  6. package/dist/safe-bash/commands/fmt.d.ts +1 -2
  7. package/dist/safe-bash/commands/fmt.d.ts.map +1 -1
  8. package/dist/safe-bash/commands/fmt.js +1 -838
  9. package/dist/safe-bash/commands/fmt.js.map +1 -1
  10. package/dist/safe-bash/commands/time-env/printenv.d.ts +1 -1
  11. package/dist/safe-bash/commands/time-env/printenv.d.ts.map +1 -1
  12. package/dist/safe-bash/commands/time-env/sleep.d.ts +1 -1
  13. package/dist/safe-bash/commands/time-env/sleep.d.ts.map +1 -1
  14. package/dist/safe-bash/core.browser.js +155 -2099
  15. package/dist/safe-bash/core.browser.js.map +3 -3
  16. package/dist/safe-bash/playwright/private-target-transport.d.ts.map +1 -1
  17. package/dist/safe-bash/playwright/private-target-transport.js +18 -2
  18. package/dist/safe-bash/playwright/private-target-transport.js.map +1 -1
  19. package/dist/safe-bash/playwright/profile.d.ts +3 -1
  20. package/dist/safe-bash/playwright/profile.d.ts.map +1 -1
  21. package/dist/safe-bash/playwright/profile.js +3 -3
  22. package/dist/safe-bash/playwright/profile.js.map +1 -1
  23. package/dist/safe-bash-command-exiftool/index.js +1401 -6
  24. package/dist/safe-bash-command-exiftool/index.js.map +7 -0
  25. package/dist/safe-bash-command-fmt/arguments.d.ts +8 -0
  26. package/dist/safe-bash-command-fmt/command.d.ts +20 -0
  27. package/dist/safe-bash-command-fmt/contracts.d.ts +42 -0
  28. package/dist/safe-bash-command-fmt/engine.d.ts +20 -0
  29. package/dist/safe-bash-command-fmt/index.d.ts +5 -0
  30. package/dist/safe-bash-command-fmt/index.js +2419 -0
  31. package/dist/safe-bash-command-fmt/index.js.map +7 -0
  32. package/dist/safe-bash-command-fmt/sdk.d.ts +15 -0
  33. package/dist/safe-bash-command-wkhtmltopdf/index.js +1458 -7
  34. package/dist/safe-bash-command-wkhtmltopdf/index.js.map +7 -0
  35. package/dist/safe-bash-contracts/index.d.ts +8 -0
  36. package/dist/safe-bash-contracts/index.js +8 -0
  37. package/dist/safe-playwright-cloudflare/browser-run-code.js +15 -1
  38. package/package.json +6 -2
  39. package/dist/safe-bash-command-exiftool/argfiles.js +0 -163
  40. package/dist/safe-bash-command-exiftool/arguments.js +0 -128
  41. package/dist/safe-bash-command-exiftool/command.js +0 -324
  42. package/dist/safe-bash-command-exiftool/csv.js +0 -78
  43. package/dist/safe-bash-command-exiftool/paths.js +0 -18
  44. package/dist/safe-bash-command-exiftool/png.js +0 -308
  45. package/dist/safe-bash-command-exiftool/publication.js +0 -80
  46. package/dist/safe-bash-command-exiftool/registry.js +0 -14
  47. package/dist/safe-bash-command-exiftool/resources.js +0 -29
  48. package/dist/safe-bash-command-exiftool/scalar.js +0 -103
  49. package/dist/safe-bash-command-exiftool/sdk.js +0 -113
  50. package/dist/safe-bash-command-exiftool/shifts.js +0 -29
  51. package/dist/safe-bash-command-wkhtmltopdf/command.js +0 -373
  52. package/dist/safe-bash-command-wkhtmltopdf/engine.js +0 -99
  53. package/dist/safe-bash-command-wkhtmltopdf/errors.js +0 -11
  54. package/dist/safe-bash-command-wkhtmltopdf/limits.js +0 -69
  55. package/dist/safe-bash-command-wkhtmltopdf/outcome.js +0 -38
  56. package/dist/safe-bash-command-wkhtmltopdf/parser.js +0 -146
  57. package/dist/safe-bash-command-wkhtmltopdf/resources.js +0 -284
  58. package/dist/safe-bash-command-wkhtmltopdf/settings.js +0 -35
  59. package/dist/safe-bash-command-wkhtmltopdf/switches.js +0 -127
  60. package/dist/safe-bash-command-wkhtmltopdf/values.js +0 -66
@@ -1,146 +0,0 @@
1
- import { WkhtmltopdfError } from "./errors.js";
2
- import { ParseBudget } from "./limits.js";
3
- import { clonePageSettings, createGlobalSettings, createPageSettings } from "./settings.js";
4
- import { switches } from "./switches.js";
5
- const longOptions = new Map(switches.map(entry => [entry.name, entry]));
6
- const shortOptions = new Map(switches.filter(entry => entry.short).map(entry => [entry.short, entry]));
7
- /** Literal Unicode SDK argv, excluding argv[0]. No execution or resource acquisition. */
8
- export function parseInvocation(argv, options) {
9
- const budget = new ParseBudget(options);
10
- budget.admitArguments(argv.length);
11
- for (const arg of argv)
12
- budget.admitText(arg);
13
- budget.step(64);
14
- const global = createGlobalSettings();
15
- const defaults = createPageSettings();
16
- const objects = [];
17
- let index = 0;
18
- let literal = false;
19
- const parseOptions = (settings, scope) => {
20
- if (literal)
21
- return;
22
- while (index < (scope === "leading" ? argv.length : argv.length - 1)) {
23
- const token = argv[index];
24
- if (!token.startsWith("-") || token === "-")
25
- break;
26
- budget.step();
27
- if (token === "--" && options.endOfOptions) {
28
- index++;
29
- literal = true;
30
- break;
31
- }
32
- if (token === "--" || token.startsWith("--0")) {
33
- throw new WkhtmltopdfError("UNQUALIFIED_QUIRK", "Pinned default-mode sentinel is unqualified and not admitted", token);
34
- }
35
- index++;
36
- const names = token.startsWith("--") ? [token] : token.slice(1);
37
- for (const name of names) {
38
- budget.step();
39
- const entry = token.startsWith("--") ? longOptions.get(name) : shortOptions.get(name);
40
- if (!entry)
41
- throw new WkhtmltopdfError("UNKNOWN_OPTION", "Unknown switch", token);
42
- const allowed = entry.scope === "page" || (entry.scope === "global" ? scope === "leading" : scope === "toc");
43
- if (!allowed)
44
- throw new WkhtmltopdfError("OPTION_LOCATION", "Switch is in an incorrect object scope", entry.name);
45
- if (entry.arity > argv.length - index) {
46
- throw new WkhtmltopdfError("MISSING_OPERAND", "Switch is missing an operand", entry.name);
47
- }
48
- if (entry.disposition !== "static") {
49
- throw new WkhtmltopdfError("UNSUPPORTED_CAPABILITY", `Switch requires unavailable ${entry.disposition} capability`, entry.name);
50
- }
51
- budget.step(entry.arity + 1);
52
- const operands = argv.slice(index, index + entry.arity);
53
- index += entry.arity;
54
- try {
55
- entry.apply(global, settings, operands);
56
- }
57
- catch (error) {
58
- if (error instanceof WkhtmltopdfError)
59
- throw new WkhtmltopdfError(error.code, error.message, entry.name);
60
- throw error;
61
- }
62
- if (global.action)
63
- return;
64
- }
65
- }
66
- };
67
- parseOptions(defaults, "leading");
68
- if (global.action)
69
- return { mode: "information", global, pageDefaults: defaults, objects, output: null };
70
- if (global.readArgsFromStdin && !options.batchJob)
71
- return { mode: "batch", global, pageDefaults: defaults, objects, output: null };
72
- while (index < argv.length - 1) {
73
- budget.admitObject(defaults.replacements.length);
74
- const settings = clonePageSettings(defaults);
75
- let kind = "page";
76
- const token = argv[index++];
77
- let input = token;
78
- if (token === "toc") {
79
- kind = "toc";
80
- input = null;
81
- }
82
- else if (token === "cover" || token === "page") {
83
- kind = token;
84
- if (index >= argv.length - 1) {
85
- throw new WkhtmltopdfError("MISSING_OBJECT", "Object requires an input and a final output");
86
- }
87
- input = argv[index++];
88
- }
89
- parseOptions(settings, kind === "toc" ? "toc" : "page");
90
- if (kind === "cover") {
91
- for (const furniture of [settings.header, settings.footer]) {
92
- furniture.left = furniture.right = furniture.center = furniture.htmlUrl = "";
93
- furniture.line = false;
94
- }
95
- settings.includeInOutline = false;
96
- }
97
- objects.push({ kind, input, settings });
98
- }
99
- if (!objects.length || index !== argv.length - 1) {
100
- throw new WkhtmltopdfError("MISSING_OBJECT", "Expected at least one input object and exactly one output");
101
- }
102
- const margins = [global.marginTop, global.marginBottom, global.marginLeft, global.marginRight];
103
- if (margins.some(margin => margin.unit !== global.marginLeft.unit)) {
104
- throw new WkhtmltopdfError("MARGIN_UNITS", "All margins must use the same normalized unit");
105
- }
106
- return { mode: "conversion", global, pageDefaults: defaults, objects, output: argv[index] };
107
- }
108
- /** Pinned batch state tokenizer; no shell evaluation, expansion or quote errors. */
109
- export function tokenizeBatchLine(line, options) {
110
- const budget = new ParseBudget(options);
111
- budget.admitText(line);
112
- const tokens = [];
113
- let token = "";
114
- let quote = "";
115
- let escaped = false;
116
- const emit = () => {
117
- if (!token)
118
- return;
119
- budget.admitArguments(tokens.length + 1);
120
- tokens.push(token);
121
- token = "";
122
- };
123
- for (const character of line) {
124
- budget.step();
125
- if (escaped) {
126
- token += character;
127
- escaped = false;
128
- }
129
- else if (character === "\\")
130
- escaped = true;
131
- else if (quote) {
132
- if (character === quote)
133
- quote = "";
134
- else
135
- token += character;
136
- }
137
- else if (character === "'" || character === '"')
138
- quote = character;
139
- else if (" \t\r\n".includes(character))
140
- emit();
141
- else
142
- token += character;
143
- }
144
- emit();
145
- return tokens;
146
- }
@@ -1,284 +0,0 @@
1
- import { WkhtmltopdfError } from "./errors.js";
2
- const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
3
- // Intrinsic access checks typed-array slots across realms without consulting
4
- // producer-owned properties, tags or iterators (including Buffer subclasses).
5
- const typedArrayPrototype = Object.getPrototypeOf(Uint8Array.prototype);
6
- const byteLengthGetter = Object.getOwnPropertyDescriptor(typedArrayPrototype, "byteLength").get;
7
- const byteTypeGetter = Object.getOwnPropertyDescriptor(typedArrayPrototype, Symbol.toStringTag).get;
8
- const copyBytes = Uint8Array.prototype.set;
9
- /** One bounded invocation. Returned byte arrays are caller-owned, never borrowed. */
10
- export async function withResources(options, run) {
11
- const limits = { ...options.limits };
12
- for (const key of ["maxInputBytes", "maxDecodedBytes", "maxRetainedBytes", "maxWork", "maxResources"]) {
13
- if (!Number.isSafeInteger(limits[key]) || limits[key] < 1) {
14
- throw new WkhtmltopdfError("INVALID_VALUE", "Resource limits must be positive safe integers");
15
- }
16
- }
17
- const { vfs, fonts, network } = options;
18
- const controller = new AbortController();
19
- const signal = controller.signal;
20
- const sourceSignal = options.signal;
21
- const abort = () => controller.abort(sourceSignal.reason);
22
- sourceSignal.addEventListener("abort", abort, { once: true });
23
- if (sourceSignal.aborted)
24
- abort();
25
- const usage = { inputBytes: 0, decodedBytes: 0, retainedBytes: 0, work: 0, resources: 0 };
26
- let active = true;
27
- let busy = false;
28
- const pending = new Set();
29
- const check = () => {
30
- if (signal.aborted)
31
- throw signal.reason;
32
- if (!active)
33
- throw new WkhtmltopdfError("INVALID_VALUE", "Resource invocation has ended");
34
- };
35
- const charge = (key, amount, limit) => {
36
- check();
37
- if (amount > limit - usage[key])
38
- throw new WkhtmltopdfError("LIMIT_EXCEEDED", `Resource ${key} limit exceeded`);
39
- usage[key] += amount;
40
- };
41
- const work = (amount = 1) => charge("work", amount, limits.maxWork);
42
- const admitText = (reference) => {
43
- for (let i = 0; i < reference.length; i++) {
44
- work();
45
- const c = reference.charCodeAt(i);
46
- let size = c < 128 ? 1 : c < 2048 ? 2 : 3;
47
- if (c >= 0xd800 && c <= 0xdbff && reference.charCodeAt(i + 1) >= 0xdc00 && reference.charCodeAt(i + 1) <= 0xdfff) {
48
- size = 4;
49
- i++;
50
- work();
51
- }
52
- charge("inputBytes", size, limits.maxInputBytes);
53
- if (c === 0)
54
- throw new WkhtmltopdfError("INVALID_VALUE", "NUL resource reference");
55
- }
56
- };
57
- const retain = (size) => {
58
- charge("decodedBytes", size, limits.maxDecodedBytes);
59
- charge("retainedBytes", size, limits.maxRetainedBytes);
60
- };
61
- const data = (reference) => {
62
- const comma = reference.indexOf(",");
63
- if (comma < 0)
64
- throw new WkhtmltopdfError("INVALID_VALUE", "Data URL requires a comma");
65
- const base64 = reference.slice(5, comma).toLowerCase().endsWith(";base64");
66
- const start = comma + 1;
67
- let size = 0;
68
- const invalid = () => { throw new WkhtmltopdfError("INVALID_VALUE", "Malformed data URL byte encoding"); };
69
- const hex = (c) => {
70
- const code = c.charCodeAt(0);
71
- if (code >= 48 && code <= 57)
72
- return code - 48;
73
- if (code >= 65 && code <= 70)
74
- return code - 55;
75
- if (code >= 97 && code <= 102)
76
- return code - 87;
77
- return invalid();
78
- };
79
- if (base64) {
80
- const length = reference.length - start;
81
- if (length % 4 !== 0)
82
- invalid();
83
- for (let i = start; i < reference.length; i += 4) {
84
- work(4);
85
- const a = alphabet.indexOf(reference[i]);
86
- const b = alphabet.indexOf(reference[i + 1]);
87
- const c = alphabet.indexOf(reference[i + 2]);
88
- const d = alphabet.indexOf(reference[i + 3]);
89
- if (a < 0 || b < 0)
90
- invalid();
91
- if (reference[i + 2] === "=") {
92
- if (reference[i + 3] !== "=" || i + 4 !== reference.length || (b & 15) !== 0)
93
- invalid();
94
- size++;
95
- }
96
- else if (reference[i + 3] === "=") {
97
- if (c < 0 || i + 4 !== reference.length || (c & 3) !== 0)
98
- invalid();
99
- size += 2;
100
- }
101
- else {
102
- if (c < 0 || d < 0)
103
- invalid();
104
- size += 3;
105
- }
106
- }
107
- }
108
- else {
109
- for (let i = start; i < reference.length; i++) {
110
- work();
111
- const code = reference.charCodeAt(i);
112
- if (code > 127 || code <= 32)
113
- invalid();
114
- if (reference[i] === "%") {
115
- if (i + 2 >= reference.length)
116
- invalid();
117
- hex(reference[i + 1]);
118
- hex(reference[i + 2]);
119
- i += 2;
120
- work(2);
121
- }
122
- size++;
123
- }
124
- }
125
- work(size);
126
- retain(size);
127
- const result = new Uint8Array(size);
128
- let offset = 0;
129
- if (base64) {
130
- for (let i = start; i < reference.length; i += 4) {
131
- const a = alphabet.indexOf(reference[i]);
132
- const b = alphabet.indexOf(reference[i + 1]);
133
- const c = alphabet.indexOf(reference[i + 2]);
134
- const d = alphabet.indexOf(reference[i + 3]);
135
- result[offset++] = (a << 2) | (b >> 4);
136
- if (c >= 0)
137
- result[offset++] = (b << 4) | (c >> 2);
138
- if (d >= 0)
139
- result[offset++] = (c << 6) | d;
140
- }
141
- }
142
- else {
143
- for (let i = start; i < reference.length; i++) {
144
- result[offset++] = reference[i] === "%"
145
- ? (hex(reference[++i]) << 4) | hex(reference[++i]) : reference.charCodeAt(i);
146
- }
147
- }
148
- return result;
149
- };
150
- const read = async (reference, open) => {
151
- const lease = await open(reference, signal);
152
- let temporary = 0;
153
- const chunks = [];
154
- let primary = false;
155
- let failure;
156
- let result;
157
- try {
158
- check();
159
- const iterator = lease.chunks[Symbol.asyncIterator]();
160
- for (;;) {
161
- work();
162
- let abortRead;
163
- let next;
164
- try {
165
- next = await new Promise((resolve, reject) => {
166
- abortRead = () => reject(signal.reason);
167
- signal.addEventListener("abort", abortRead, { once: true });
168
- if (signal.aborted)
169
- abortRead();
170
- Promise.resolve().then(() => { check(); return iterator.next(); }).then(resolve, reject);
171
- });
172
- }
173
- finally {
174
- if (abortRead)
175
- signal.removeEventListener("abort", abortRead);
176
- }
177
- check();
178
- if (next.done)
179
- break;
180
- if (byteTypeGetter.call(next.value) !== "Uint8Array") {
181
- throw new WkhtmltopdfError("INVALID_VALUE", "Expected resource byte chunks");
182
- }
183
- const size = byteLengthGetter.call(next.value);
184
- charge("inputBytes", size, limits.maxInputBytes);
185
- work(size);
186
- retain(size);
187
- temporary += size;
188
- if (size) {
189
- const chunk = new Uint8Array(size);
190
- copyBytes.call(chunk, next.value);
191
- chunks.push(chunk);
192
- }
193
- }
194
- work(temporary);
195
- charge("retainedBytes", temporary, limits.maxRetainedBytes);
196
- result = new Uint8Array(temporary);
197
- let offset = 0;
198
- for (const chunk of chunks) {
199
- result.set(chunk, offset);
200
- offset += chunk.length;
201
- }
202
- }
203
- catch (error) {
204
- primary = true;
205
- failure = error;
206
- }
207
- finally {
208
- usage.retainedBytes -= temporary;
209
- try {
210
- await lease.close();
211
- check();
212
- }
213
- catch (error) {
214
- if (!primary) {
215
- primary = true;
216
- failure = error;
217
- }
218
- }
219
- }
220
- if (primary) {
221
- if (result)
222
- usage.retainedBytes -= result.byteLength;
223
- throw failure;
224
- }
225
- return result;
226
- };
227
- const load = (reference, font, base) => {
228
- const operation = (async () => {
229
- check();
230
- if (busy)
231
- throw new WkhtmltopdfError("INVALID_VALUE", "Resource reads must be sequential");
232
- busy = true;
233
- try {
234
- charge("resources", 1, limits.maxResources);
235
- admitText(reference);
236
- if (base !== undefined) {
237
- admitText(base);
238
- try {
239
- reference = new URL(reference, base).href;
240
- }
241
- catch {
242
- throw new WkhtmltopdfError("INVALID_VALUE", "Invalid resource URL or base");
243
- }
244
- // Count the normalized representation too, including Unicode escaping.
245
- admitText(reference);
246
- }
247
- if (!font) {
248
- work(reference.length);
249
- const fragment = reference.indexOf("#");
250
- if (fragment >= 0)
251
- reference = reference.slice(0, fragment);
252
- }
253
- if (!font && reference.startsWith("data:"))
254
- return data(reference);
255
- const open = font ? fonts : reference.startsWith("vfs:") ? vfs :
256
- reference.startsWith("https:") || reference.startsWith("http:") ? network : undefined;
257
- if (!open)
258
- throw new WkhtmltopdfError("UNSUPPORTED_CAPABILITY", "Resource requires an explicitly supplied capability");
259
- return await read(reference, open);
260
- }
261
- finally {
262
- busy = false;
263
- }
264
- })();
265
- pending.add(operation);
266
- void operation.then(() => pending.delete(operation), () => pending.delete(operation));
267
- return operation;
268
- };
269
- try {
270
- check();
271
- const result = await run({ load: (reference, base) => load(reference, false, base), font: name => load(name, true), get usage() { return { ...usage }; } });
272
- check();
273
- if (pending.size)
274
- throw new WkhtmltopdfError("INVALID_VALUE", "Resource reads must finish before the invocation ends");
275
- return result;
276
- }
277
- finally {
278
- active = false;
279
- controller.abort(new WkhtmltopdfError("INVALID_VALUE", "Resource invocation has ended"));
280
- await Promise.allSettled(pending);
281
- sourceSignal.removeEventListener("abort", abort);
282
- usage.retainedBytes = 0;
283
- }
284
- }
@@ -1,35 +0,0 @@
1
- export function createGlobalSettings() {
2
- return {
3
- logLevel: "info", orientation: "Portrait", pageSize: "A4", dpi: 96,
4
- copies: 1, collate: true, outline: true, outlineDepth: 4,
5
- imageDPI: 600, imageQuality: 94, useCompression: true,
6
- colorMode: "color", resolution: "high", documentTitle: "",
7
- marginTop: { value: -1, unit: "mm" },
8
- marginBottom: { value: -1, unit: "mm" },
9
- marginLeft: { value: 10, unit: "mm" },
10
- marginRight: { value: 10, unit: "mm" },
11
- pageHeight: { value: -1, unit: "mm" },
12
- pageWidth: { value: -1, unit: "mm" },
13
- pageOffset: 0, resolveRelativeLinks: true, viewportSize: "",
14
- readArgsFromStdin: false, action: "",
15
- };
16
- }
17
- export function createPageSettings() {
18
- return {
19
- header: { fontSize: 12, fontName: "Arial", left: "", right: "", center: "", line: false, htmlUrl: "", spacing: 0 },
20
- footer: { fontSize: 12, fontName: "Arial", left: "", right: "", center: "", line: false, htmlUrl: "", spacing: 0 },
21
- toc: { useDottedLines: true, captionText: "Table of Contents", forwardLinks: true, backLinks: false, indentation: "1em", fontScale: Math.fround(0.8) },
22
- web: { background: true, loadImages: true, enableJavascript: true, enableIntelligentShrinking: true, minimumFontSize: -1, defaultEncoding: "", enablePlugins: false },
23
- load: { jsdelay: 200, zoomFactor: 1, blockLocalFileAccess: true, stopSlowScripts: true, loadErrorHandling: "abort", mediaLoadErrorHandling: "ignore", printMediaType: false },
24
- includeInOutline: true, pagesCount: true, produceForms: false,
25
- useLocalLinks: true, useExternalLinks: true,
26
- replacements: [],
27
- };
28
- }
29
- export function clonePageSettings(settings) {
30
- return {
31
- ...settings, header: { ...settings.header }, footer: { ...settings.footer },
32
- toc: { ...settings.toc }, web: { ...settings.web }, load: { ...settings.load },
33
- replacements: settings.replacements.map(([key, value]) => [key, value]),
34
- };
35
- }
@@ -1,127 +0,0 @@
1
- import { integer, float32, length, choice } from "./values.js";
2
- // Source-derived inventory; parser admission does not qualify renderer support.
3
- const declarations = [
4
- { name: "--help", short: "h", scope: "global", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.action = "help"; } },
5
- { name: "--version", short: "V", scope: "global", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.action = "version"; } },
6
- { name: "--license", short: "", scope: "global", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.action = "license"; } },
7
- { name: "--extended-help", short: "H", scope: "global", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.action = "extended-help"; } },
8
- { name: "--manpage", short: "", scope: "global", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.action = "manpage"; } },
9
- { name: "--htmldoc", short: "", scope: "global", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.action = "htmldoc"; } },
10
- { name: "--readme", short: "", scope: "global", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.action = "readme"; } },
11
- { name: "--quiet", short: "q", scope: "global", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.logLevel = "none"; } },
12
- { name: "--log-level", short: "", scope: "global", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.logLevel = choice(_a[0], ["none", "error", "warn", "info", "debug"]); } },
13
- { name: "--no-collate", short: "", scope: "global", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.collate = false; } },
14
- { name: "--collate", short: "", scope: "global", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.collate = true; } },
15
- { name: "--copies", short: "", scope: "global", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.copies = integer(_a[0], 1, 2147483647); } },
16
- { name: "--orientation", short: "O", scope: "global", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.orientation = choice(_a[0], ["Portrait", "Landscape"]); } },
17
- { name: "--page-size", short: "s", scope: "global", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.pageSize = choice(_a[0], ["A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "B10", "C5E", "Comm10E", "DLE", "Executive", "Folio", "Ledger", "Legal", "Letter", "Tabloid"]); } },
18
- { name: "--grayscale", short: "g", scope: "global", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.colorMode = "grayscale"; } },
19
- { name: "--lowquality", short: "l", scope: "global", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.resolution = "screen"; } },
20
- { name: "--title", short: "", scope: "global", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.documentTitle = _a[0]; } },
21
- { name: "--read-args-from-stdin", short: "", scope: "global", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.readArgsFromStdin = true; } },
22
- { name: "--margin-bottom", short: "B", scope: "global", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.marginBottom = length(_a[0]); } },
23
- { name: "--margin-left", short: "L", scope: "global", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.marginLeft = length(_a[0]); } },
24
- { name: "--margin-right", short: "R", scope: "global", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.marginRight = length(_a[0]); } },
25
- { name: "--margin-top", short: "T", scope: "global", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.marginTop = length(_a[0]); } },
26
- { name: "--dpi", short: "d", scope: "global", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.dpi = integer(_a[0], 1, 2147483647); } },
27
- { name: "--page-height", short: "", scope: "global", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.pageHeight = length(_a[0]); } },
28
- { name: "--page-width", short: "", scope: "global", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.pageWidth = length(_a[0]); } },
29
- { name: "--cookie-jar", short: "", scope: "global", arity: 1, qtPatched: false, disposition: "resource" },
30
- { name: "--image-quality", short: "", scope: "global", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _g.imageQuality = integer(_a[0], 0, 100); } },
31
- { name: "--image-dpi", short: "", scope: "global", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _g.imageDPI = integer(_a[0], 1, 2147483647); } },
32
- { name: "--no-pdf-compression", short: "", scope: "global", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _g.useCompression = false; } },
33
- { name: "--use-xserver", short: "", scope: "global", arity: 0, qtPatched: true, disposition: "excluded" },
34
- { name: "--outline", short: "", scope: "global", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _g.outline = true; } },
35
- { name: "--no-outline", short: "", scope: "global", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _g.outline = false; } },
36
- { name: "--outline-depth", short: "", scope: "global", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _g.outlineDepth = integer(_a[0], 0, 2147483647); } },
37
- { name: "--dump-outline", short: "", scope: "global", arity: 1, qtPatched: true, disposition: "resource" },
38
- { name: "--dump-default-toc-xsl", short: "", scope: "global", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _g.action = "dump-default-toc-xsl"; } },
39
- { name: "--default-header", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p) => { _p.header.left = "[webpage]"; _p.header.right = "[page]/[topage]"; _p.header.line = true; _g.marginTop = { value: 20, unit: "mm" }; } },
40
- { name: "--viewport-size", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _g.viewportSize = _a[0]; } },
41
- { name: "--enable-plugins", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "excluded" },
42
- { name: "--disable-plugins", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _p.web.enablePlugins = false; } },
43
- { name: "--minimum-font-size", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _p.web.minimumFontSize = integer(_a[0], 1, 2147483647); } },
44
- { name: "--user-style-sheet", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
45
- { name: "--no-images", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _p.web.loadImages = false; } },
46
- { name: "--images", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _p.web.loadImages = true; } },
47
- { name: "--disable-javascript", short: "n", scope: "page", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _p.web.enableJavascript = false; } },
48
- { name: "--enable-javascript", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "harness" },
49
- { name: "--encoding", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _p.web.defaultEncoding = _a[0]; } },
50
- { name: "--no-background", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _p.web.background = false; } },
51
- { name: "--background", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _p.web.background = true; } },
52
- { name: "--include-in-outline", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.includeInOutline = true; } },
53
- { name: "--exclude-from-outline", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.includeInOutline = false; } },
54
- { name: "--disable-smart-shrinking", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.web.enableIntelligentShrinking = false; } },
55
- { name: "--enable-smart-shrinking", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.web.enableIntelligentShrinking = true; } },
56
- { name: "--print-media-type", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.load.printMediaType = true; } },
57
- { name: "--no-print-media-type", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.load.printMediaType = false; } },
58
- { name: "--enable-forms", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.produceForms = true; } },
59
- { name: "--disable-forms", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.produceForms = false; } },
60
- { name: "--disable-internal-links", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.useLocalLinks = false; } },
61
- { name: "--enable-internal-links", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.useLocalLinks = true; } },
62
- { name: "--disable-external-links", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.useExternalLinks = false; } },
63
- { name: "--enable-external-links", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.useExternalLinks = true; } },
64
- { name: "--resolve-relative-links", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _g.resolveRelativeLinks = true; } },
65
- { name: "--keep-relative-links", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _g.resolveRelativeLinks = false; } },
66
- { name: "--enable-toc-back-links", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.toc.backLinks = true; } },
67
- { name: "--disable-toc-back-links", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.toc.backLinks = false; } },
68
- { name: "--proxy", short: "p", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
69
- { name: "--proxy-hostname-lookup", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "resource" },
70
- { name: "--bypass-proxy-for", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
71
- { name: "--username", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
72
- { name: "--password", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
73
- { name: "--ssl-key-path", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
74
- { name: "--ssl-key-password", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
75
- { name: "--ssl-crt-path", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
76
- { name: "--load-error-handling", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _p.load.loadErrorHandling = choice(_a[0], ["abort", "skip", "ignore"]); } },
77
- { name: "--load-media-error-handling", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _p.load.mediaLoadErrorHandling = choice(_a[0], ["abort", "skip", "ignore"]); } },
78
- { name: "--custom-header", short: "", scope: "page", arity: 2, qtPatched: false, disposition: "resource" },
79
- { name: "--custom-header-propagation", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "resource" },
80
- { name: "--no-custom-header-propagation", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "resource" },
81
- { name: "--javascript-delay", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "harness" },
82
- { name: "--window-status", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "harness" },
83
- { name: "--zoom", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _p.load.zoomFactor = float32(_a[0], true); } },
84
- { name: "--cookie", short: "", scope: "page", arity: 2, qtPatched: false, disposition: "resource" },
85
- { name: "--post", short: "", scope: "page", arity: 2, qtPatched: false, disposition: "resource" },
86
- { name: "--post-file", short: "", scope: "page", arity: 2, qtPatched: false, disposition: "resource" },
87
- { name: "--disable-local-file-access", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _p.load.blockLocalFileAccess = true; } },
88
- { name: "--enable-local-file-access", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "resource" },
89
- { name: "--allow", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
90
- { name: "--cache-dir", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
91
- { name: "--debug-javascript", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "harness" },
92
- { name: "--no-debug-javascript", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "harness" },
93
- { name: "--stop-slow-scripts", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "harness" },
94
- { name: "--no-stop-slow-scripts", short: "", scope: "page", arity: 0, qtPatched: false, disposition: "harness" },
95
- { name: "--run-script", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "harness" },
96
- { name: "--checkbox-svg", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
97
- { name: "--checkbox-checked-svg", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
98
- { name: "--radiobutton-svg", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
99
- { name: "--radiobutton-checked-svg", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "resource" },
100
- { name: "--page-offset", short: "", scope: "page", arity: 1, qtPatched: false, disposition: "static", apply: (_g, _p, _a) => { _g.pageOffset = integer(_a[0], -2147483648, 2147483647); } },
101
- { name: "--footer-center", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.footer.center = _a[0]; } },
102
- { name: "--footer-font-name", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.footer.fontName = _a[0]; } },
103
- { name: "--footer-font-size", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.footer.fontSize = integer(_a[0], 1, 2147483647); } },
104
- { name: "--footer-left", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.footer.left = _a[0]; } },
105
- { name: "--footer-line", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.footer.line = true; } },
106
- { name: "--no-footer-line", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.footer.line = false; } },
107
- { name: "--footer-right", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.footer.right = _a[0]; } },
108
- { name: "--footer-spacing", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.footer.spacing = float32(_a[0], false); } },
109
- { name: "--footer-html", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "resource" },
110
- { name: "--header-center", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.header.center = _a[0]; } },
111
- { name: "--header-font-name", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.header.fontName = _a[0]; } },
112
- { name: "--header-font-size", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.header.fontSize = integer(_a[0], 1, 2147483647); } },
113
- { name: "--header-left", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.header.left = _a[0]; } },
114
- { name: "--header-line", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.header.line = true; } },
115
- { name: "--no-header-line", short: "", scope: "page", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.header.line = false; } },
116
- { name: "--header-right", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.header.right = _a[0]; } },
117
- { name: "--header-spacing", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.header.spacing = float32(_a[0], false); } },
118
- { name: "--header-html", short: "", scope: "page", arity: 1, qtPatched: true, disposition: "resource" },
119
- { name: "--replace", short: "", scope: "page", arity: 2, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.replacements.push([_a[0], _a[1]]); } },
120
- { name: "--xsl-style-sheet", short: "", scope: "toc", arity: 1, qtPatched: true, disposition: "resource" },
121
- { name: "--toc-header-text", short: "", scope: "toc", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.toc.captionText = _a[0]; } },
122
- { name: "--disable-toc-links", short: "", scope: "toc", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.toc.forwardLinks = false; } },
123
- { name: "--disable-dotted-lines", short: "", scope: "toc", arity: 0, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.toc.useDottedLines = false; } },
124
- { name: "--toc-text-size-shrink", short: "", scope: "toc", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.toc.fontScale = float32(_a[0], true); } },
125
- { name: "--toc-level-indentation", short: "", scope: "toc", arity: 1, qtPatched: true, disposition: "static", apply: (_g, _p, _a) => { _p.toc.indentation = _a[0]; } },
126
- ];
127
- export const switches = Object.freeze(declarations.map(entry => Object.freeze(entry)));