@tokenoftrust/cli 4.12.1 → 4.13.0
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/package.json +1 -1
- package/src/commands/image.mjs +10 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/cli",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.0",
|
|
4
4
|
"description": "Token of Trust developer CLI — clone a tenant store, run it locally with save→reload, and submit it for preview. Installs the `tot` command.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Token of Trust",
|
package/src/commands/image.mjs
CHANGED
|
@@ -20,8 +20,13 @@ import { readFile, stat } from "node:fs/promises";
|
|
|
20
20
|
import { resolveViewerTransport } from "../viewer-session.mjs";
|
|
21
21
|
import { missingGrantsOf, refusalHint } from "../admission-hint.mjs";
|
|
22
22
|
|
|
23
|
-
/**
|
|
24
|
-
|
|
23
|
+
/**
|
|
24
|
+
* The highest upload limit any store has (the High Fidelity / Large Images tier): refused here before
|
|
25
|
+
* any bytes are sent. The CLI cannot know a store's tier and is published separately, so it holds the
|
|
26
|
+
* ceiling (pinned equal to `IMAGE_LIMITS_CEILING.maxEncodedBytes` by a test); the server enforces the
|
|
27
|
+
* store's own tier.
|
|
28
|
+
*/
|
|
29
|
+
export const MAX_IMAGE_BYTES = 30 * 1024 * 1024;
|
|
25
30
|
|
|
26
31
|
/** Parse `tot image` argv. Pure — unit-tested. */
|
|
27
32
|
export function parseImageArgs(argv) {
|
|
@@ -53,7 +58,8 @@ Use it anywhere content names an image (an <img src>, a page block, a product im
|
|
|
53
58
|
Never commit image files to your store repo — the pool holds them, your repo holds
|
|
54
59
|
these URLs. The same file always prints the same URL; uploading it again is a no-op.
|
|
55
60
|
|
|
56
|
-
Accepted: PNG, JPEG, GIF, WebP, AVIF, up to 8 MiB
|
|
61
|
+
Accepted: PNG, JPEG, GIF, WebP, AVIF, up to 8 MiB (30 MiB with the High Fidelity / Large Images
|
|
62
|
+
add-on). SVG is not accepted yet.
|
|
57
63
|
|
|
58
64
|
Options:
|
|
59
65
|
--tenant <appDomain> Store to upload to. Defaults to the current checkout's store.
|
|
@@ -114,7 +120,7 @@ export async function run(argv, ctx, deps = {}) {
|
|
|
114
120
|
return 2;
|
|
115
121
|
}
|
|
116
122
|
if (info.size > MAX_IMAGE_BYTES) {
|
|
117
|
-
err(`✗ ${file}: larger than the
|
|
123
|
+
err(`✗ ${file}: larger than the 30 MiB upload limit (8 MiB unless the store has the High Fidelity / Large Images add-on).\n\n → next: compress or resize it, then re-run.`);
|
|
118
124
|
return 2;
|
|
119
125
|
}
|
|
120
126
|
const bytes = await read(file);
|