@tokenoftrust/storefront-runner 7.6.10 → 7.6.11
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.
|
@@ -298,7 +298,7 @@ export function readCatalogFiles(entries, { tenantScope, inventoryProvider }) {
|
|
|
298
298
|
// LISTING_DESCRIPTION_CHARS) plus every collection whole, or, when any file fails validation, the
|
|
299
299
|
// failures. A product page reads its full file.
|
|
300
300
|
|
|
301
|
-
/** Version of the projection document;
|
|
301
|
+
/** Version of the projection document written by this build; readers accept version 1..CATALOG_LISTING_VERSION. */
|
|
302
302
|
export const CATALOG_LISTING_VERSION = 2;
|
|
303
303
|
/** Metafield namespaces a listing keeps: the compliance classification a listing's readiness and gates read. */
|
|
304
304
|
export const LISTING_METAFIELD_NAMESPACES = Object.freeze(["compliance", "bigcommerce_custom"]);
|
|
@@ -406,7 +406,13 @@ export function readCatalogListing(raw, { tenantScope, inventoryProvider }) {
|
|
|
406
406
|
} catch {
|
|
407
407
|
doc = null;
|
|
408
408
|
}
|
|
409
|
-
if (
|
|
409
|
+
if (
|
|
410
|
+
!isObject(doc) ||
|
|
411
|
+
typeof doc.version !== "number" ||
|
|
412
|
+
!Number.isInteger(doc.version) ||
|
|
413
|
+
doc.version < 1 ||
|
|
414
|
+
doc.version > CATALOG_LISTING_VERSION
|
|
415
|
+
) {
|
|
410
416
|
throw new CatalogFileError([
|
|
411
417
|
{ path: "catalog/", issues: ["the catalog listing projection is unreadable; reconcile the preview again"] },
|
|
412
418
|
]);
|
|
@@ -20,7 +20,7 @@ const { tenant, tot, basePath, features } = Astro.locals;
|
|
|
20
20
|
// A handful of collections to redirect lost visitors toward. Marketing tenants
|
|
21
21
|
// (features.catalog === false) have no /collections route at all — skip the
|
|
22
22
|
// fetch entirely rather than trust it to come back empty.
|
|
23
|
-
const collections = features.catalog ? (await tot.listCollections()).slice(0, 3) : [];
|
|
23
|
+
const collections = features.catalog ? (await tot.listCollections().catch(() => [])).slice(0, 3) : [];
|
|
24
24
|
---
|
|
25
25
|
|
|
26
26
|
<Layout
|
|
@@ -25,6 +25,17 @@ const { tenant, canonicalBase, content, basePath, apiBasePath, capabilities, fea
|
|
|
25
25
|
Astro.locals;
|
|
26
26
|
const slug = (Astro.params.slug ?? "").replace(/^\/+|\/+$/g, "");
|
|
27
27
|
|
|
28
|
+
// Astro's DefaultErrorHandler falls back to this catch-all when no 500 route exists,
|
|
29
|
+
// passing `{ error }` in Astro.props with status 500. Preserve the 500 instead of
|
|
30
|
+
// returning a body-less 404, which DefaultErrorHandler.mergeResponses would otherwise
|
|
31
|
+
// use to overwrite the 500 with an empty 404.
|
|
32
|
+
if ("error" in Astro.props || Astro.response.status === 500) {
|
|
33
|
+
return new Response("Internal Server Error", {
|
|
34
|
+
status: 500,
|
|
35
|
+
headers: { "content-type": "text/plain; charset=utf-8", "cache-control": "no-store" },
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
28
39
|
// Defensive: never let the catch-all answer for first-class route namespaces.
|
|
29
40
|
// (Keeps the commerce boundary hard — a marketing subpage can never shadow a
|
|
30
41
|
// product/collection route.)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "7.6.
|
|
3
|
+
"version": "7.6.11",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "World-shareable storefront runner: multi-tenant renderer on Astro/Cloudflare. No control plane.",
|
|
6
6
|
"packageManager": "pnpm@11.9.0",
|